Sunday, 15 September 2013

Nesting CSS based on class of body

Nesting CSS based on class of body

I have multiple themes for my website, such as a light or dark theme. This
is applied via a class to body. I would like to apply certain styling if
body has dark.
I have tried this:
body.dark {
.sidebar {
background-color: #444;
}
.intro {
background-color: #CCC;
}
/* etc */
}
However, none of the styles are applied. What would be the correct way to
this condition?
I can do .sidebar.dark, however the current dark CSS file is in .intro,
.sidebar, etc.

No comments:

Post a Comment