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

Rendering styles in custom tags #11

Closed
jrans opened this issue Oct 12, 2016 · 4 comments
Closed

Rendering styles in custom tags #11

jrans opened this issue Oct 12, 2016 · 4 comments

Comments

@jrans
Copy link
Member

jrans commented Oct 12, 2016

riot.render strips out all css and from custom tags and therefore lose any tag stylesheets

As riot offers and even recommends adding style sheets to tags to keep them modular shall we offer this feature?

a suggested solution can be found here

I personally love styles within tags so to have this feature would be pretty cool.

@jrans
Copy link
Member Author

jrans commented Oct 12, 2016

@nelsonic this process would want to be cached

@jrans
Copy link
Member Author

jrans commented Oct 12, 2016

@nelsonic

A quick simple example of this in action would be to add to https://github.com/dwyl/hapi-riot/blob/master/lib/index.js#L51

    output += '<style>';
    output += Riot.compile(require('fs').readFileSync(renderOpts.filename, 'utf8'), { entities: true })[0].css;
    output += '</style>'

but as I said we would want to be slightly more clever.

@nelsonic
Copy link
Member

@jrans give it a go. 👍

@jrans
Copy link
Member Author

jrans commented Oct 12, 2016

excited about this

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

No branches or pull requests

3 participants