Skip to content

Option to render CSS into component - #91

Open
p3k wants to merge 19 commits into
guybedford:masterfrom
weblyzard:feature/component-less
Open

Option to render CSS into component#91
p3k wants to merge 19 commits into
guybedford:masterfrom
weblyzard:feature/component-less

Conversation

@p3k

@p3k p3k commented Jun 20, 2018

Copy link
Copy Markdown

This PR adds the option less.component to the RequireJS config and – if set to true – renders the LESS code as CSS into the component where it was required from.

We are currently using this to enable LESS in RactiveJS components.

Example:

import Ractive from 'ractive';
import css from 'less!./App';
import template from 'text!./App.html';

const App = Ractive.extend({
  template,
  css
});

export { App };

Furthermore, the cless.js and cless-builder.js wrappers allow per-file CSS output to a component; just use these as replacement plugin like import css from 'cless!/.App'.

Would be glad if you considered this, please let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant