rtsao / csjs

:sparkles: Modular, scoped CSS with ES6
MIT License
575 stars 32 forks source link

Is it possible to use nested SASS/SCSS-like styles? #57

Closed avesus closed 8 years ago

avesus commented 8 years ago

Like here: http://www.snaptrax.org/assets/scss/_component-examples.scss

.bd-example-row {
  .row {
    margin-bottom: 1rem;

    > [class^="col-"] {
      padding-top: .75rem;
      padding-bottom: .75rem;
      background-color: rgba(86,61,124,.15);
      border: 1px solid rgba(86,61,124,.2);
    }
  }
}
rtsao commented 8 years ago

Yes, but you'll need Babel to transform it to CSS at build-time. You should be able to use this: https://github.com/rtsao/babel-plugin-csjs-postcss and this: https://github.com/postcss/postcss-nested to get what you need.

avesus commented 8 years ago

Thanks!