How to use the style tag with jade templates?

邮差的信 提交于 2019-12-02 17:50:23

There are three ways of putting text inside your tags in Jade

1. Put text just after the tag e.g.

h1 Some header text

And the output will be:

<h1>Some header text</h1>

2. Put indented text below the tag with | e.g.

p
    | Some text goes 
    | here

And the output will be:

<p>Some text goes here</p>

3. Suffix the tag with a dot and indent your text below (with no |) e.g.

p.
    This way 3rd way of putting 
    text inside

And the output will be:

<p>This way 3rd way of putting text inside</p>

So based on the above, the approach you chose (as in your comment) is correct (option 3).

doctype 5
html(lang="en")
    head
        style(type='text/css').
           .ui-title {
                margin: 0.6em 10% 0.8em !important;
            }

I hope that will help.

Gene Bo

This worked for me:

style.
  body {
    background-color: {{themeColor}};
  }

Got it from: https://github.com/mquandalle/meteor-jade/issues/102 where the post suggests to use "dot notation"

This is the way to do it (designer version)

include [some-html-include-name].html

Then in that include file put your style tag and styles

<style type="text/css">
/* your styles here */

Work for me in jade file

style(media='screen', type='text/css')
     @media (min-width: 1200px) {
        .container{
           max-width: 970px;
             }
          }
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!