在 Slim 中创建 HTML5 Boilerplate 条件 HTML 类
HTML5 Boilerplate 使用以下条件 类:
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
我想知道如何可以在基于 Slim 的模板中重现此内容。
到目前为止,这是我所得到的:
doctype html
/! paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
/[ if lt IE 7 ]
html class="no-js ie6" lang="en"
/[ if IE 7 ]
html class="no-js ie7" lang="en"
/[ if IE 8 ]
html class="no-js ie8" lang="en"
/[ if (gte IE 9)|!(IE) ]
html class="no-js" lang="en"
head
最后一个条件给我带来了麻烦。
HTML5 Boilerplate uses the following conditional <html>
classes:
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
I'm wondering how I can reproduce this in a Slim-based template.
Here's what I have so far:
doctype html
/! paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
/[ if lt IE 7 ]
html class="no-js ie6" lang="en"
/[ if IE 7 ]
html class="no-js ie7" lang="en"
/[ if IE 8 ]
html class="no-js ie8" lang="en"
/[ if (gte IE 9)|!(IE) ]
html class="no-js" lang="en"
head
The last conditional is giving me trouble.
看起来您可以使用管道字符来逃避处理。
请参阅 API 文档的线路指示器部分。
Looks like you can use the pipe character to escape processing.
See the Line Indicators section of the API docs.