Question: 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 : #{item.background}; color: #{item.foreground}; }

```

However this gives the following error:

```
ReferenceError: media='print')
    7|  style(type='text/css')
  > 8|      - for(var item in colors)
    9|          .#{item.class} { background-color : #{item.background}; color: #{item.foreground}; }
    10| block Content
    11|     include scheduleTemplate

item is not defined

```

If I remove the style tag, it renders fine. Is there any way to use iteration within a style block?

Answer: 
Another way is to import your own css stylesheet. In the [Jade doc](http://jade-lang.com/reference/includes/), you can see that you can include a style sheet with such code:

```
html
  head
    style
      include style.css

```

Then, you can define any CSS in a separate file that you can reference.
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.