streamich / nano-css

Distilled CSS-in-JS for gourmet developers
The Unlicense
426 stars 24 forks source link

"content" styles aren't handled well #204

Closed TheBosZ closed 5 years ago

TheBosZ commented 5 years ago

When I use "content" styles, the styles have to be surrounded by an extra pair of quotes or it'll get messed up.

An example original CSS:

.divider {
  &:after {
    content: '|';
  }
}

Code:

nano.rule({
  divider: {
    '&:after': {
      content: '|',
    },
  },
});

Resulting CSS:

.__1elt25k-divider:after {
    content:|;
}

Notice that the quotes have been stripped from the content character. If I use a doubly-quoted string content: '"|"', it works just fine.

I'm not sure that this is a bug or more of a "I have to look out for content rules since they're special" thing.

streamich commented 5 years ago

It simply inserts value as-is. There is no special treatment for content property.

TheBosZ commented 5 years ago

Okay, not a problem. I updated my SASS-to-JSON converter to handle it: https://thebosz.bitbucket.io/

streamich commented 5 years ago

Nice, I might use it as well.