Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to render CSS into component #91

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

p3k
Copy link

@p3k p3k commented Jun 20, 2018

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