Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 542
grahamrhay Avatar asked Jul 07 '16 16:07

grahamrhay


1 Answers

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

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

In the documentation: https://pugjs.org/language/plain-text.html#recommended-solutions

like image 51
Iso Avatar answered Sep 28 '22 02:09

Iso