JSS 0.2 – Nested CSS update

So I thought I’d update the JSS script I wrote previously with a few changes I’ve been thinking about for a while.

The primary reason for the update is to add a new ‘non-CSS’ property of ‘include’. This property allows you to include styles that have already been defined in the current class.

For example, if you had a stylesheet that looked like this:

.bold {
  font-weight: bold;

.important {
  font-weight: bold;

You could rewrite this using:

  ".bold": {
    "font-weight": "bold"
  ".important": {
    "include": ".bold"

Which I know you shouldn’t really do, and yes, it probably does go against the whole point of CSS, but I’m sure it’ll be useful in some situation at some point… No? Well it was interesting making it anyway.

Other minor updates are a PHP version so you can write nested stylesheets and output minified CSS all server-side and a bunch of HTML colour names that are actually shorter than the 6 digit hex codes.

I might work on doing other languages if I fancy the practice… Probably make a CSS to JSS conversion script first though…

You can see the updated demo page here, or just download the files here and have a look for yourself.

One Reply to “JSS 0.2 – Nested CSS update”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.