grahamrhay grahamrhay - 4 months ago 90
Jade Question

How can I add a style tag in the header with jade/pug?

I want something like this:

html
head
style(type="text/css")
table {
width: 100%
}
body
table


But can't find the right incantation. This results in an "unexpected text" error. I tried escaping the css with a |, to no avail; and the best I've achieved so far is getting a table tag rendered in the header :(

Is it possible to do this with jade/pug?

Iso Iso
Answer

Yes, you can add arbitrary text to any tag by suffixing it with a dot:

style(type="text/css").
  table {
    width: 100%
  }