Writing dynamic CSS with Jade

后端 未结 4 1416
[愿得一人]
[愿得一人] 2021-01-11 11:44

I\'m trying to write out some dynamic CSS using Jade, like so:

style(type=\'text/css\')
    each item in colors
        .#{item.class} { background-color :          


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-11 12:04

    I ran into a similar issue where I wanted to add a specific class to the body tag depending on the route, similar to what I've done in PHP. In the end, I used jade's template inheritance to achieve a similar result.

提交回复
热议问题