Built-in css pre-compilers in riot compiler? #1195

Closed
emilebosch opened this Issue Sep 8, 2015 · 5 comments

Projects

None yet

3 participants

@emilebosch

Hi i was wondering if there some way i can use SASS in the riot tag compiler? The tag

<style type='sass'>

Tells me i can't use it unfortnately

@nippur72
Contributor
nippur72 commented Sep 8, 2015

I've never tried it, but I think you can setup a custom CSS parser that renders SASS (with the help of sass.js):

riot.parsers.css.myCssParser = function(tagName, css) {
  return Sass.compile(css);
}
@GianlucaGuarini
Member

In the next riot release this will be easily possible, for now you can just use:

var riot = require('riot')
riot.parsers.css.sass = function(tagName, css) {
  return Sass.compile(css);
}
var myTag = require('my-tag.tag')
@emilebosch

Thanks!

@emilebosch

Any idea on when the next release will be?

@GianlucaGuarini
Member

You are welcome @emilebosch keep an eye on this page https://github.com/riot/riot/milestones

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