cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.07k stars 398 forks source link

[cli] css/cssx/less/sass/stylus adapter. #166

Open trusktr opened 8 years ago

trusktr commented 8 years ago

So we can write styles using one or more of those languages, then do things like:

import style from 'path/to/style.less' // or path/to/style.css, path/to/style.sass, path/to/style.styl

// ...
    // it's a jss stylesheet, apply it when needed:
    style.attach()

There could be some way to handle name-spaced styles...

kof commented 8 years ago

You mean in a namespaced way?

kof commented 8 years ago

For this one we need to use a parser from those languages and modify compilation from pure css to jss flavored json.

kof commented 8 years ago

It would be part of jss-cli repository. If someone want to do it, just let me know, we can discuss details.

kof commented 8 years ago

Also it makes sense to add every converter to the repl

kof commented 7 years ago

Using https://github.com/axept/prejss this should be now possible cc @DenisIzmaylov @lttb

lttb commented 7 years ago

@kof I've made prejss-styles-loader for webpack. It would work with every kind of syntax, that supported by postcss (less, scss, sugarss etc.)

import styles from './styles.css' // .scss/less/sss etc.

const sheet = jss.createStyleSheet(styles).attach()
kof commented 7 years ago

cool