-
Notifications
You must be signed in to change notification settings - Fork 10
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
Indented Sass #3
Comments
I'm not way a expert with nodeJS but I have worked a very elegant hack. Seems like node-sass render.file some how knows when a file is .scss or .sass and but render.data does not. The easiest way I found to fix this was by checking if if (input.data.indexOf(';') === -1 && input.data.indexOf(' {') === -1) {
input.indentedSyntax = true;
} // Passes as sass
=test($property, $value)
#{$property}: $value
body
+test(color, red) // note if uglyfied it will pass as sass
@mixin yo($property, $value){#{$property}: $value}
body{@include yo(color, red)} I also noticed var path = require('path');
var context = path.dirname(module.parent.filename);
input.includePaths = [context]; I know you can pass in options in when using it javascript but im using it as a jade template filter which doesn't allow me doing it and adds versatility for other uses. body
style
:sass
@import awesomeMixinLibrary.scss
h1
color: &
+span(6)
+center(vertical) I hope this helps anyone else |
Not good idea! But thanks for the opening this issue. Is there some module that handle both cases? There should have module like that with some option to support that, and will just use him. Options is completely optional, JStransformer dont do anything, we just provide options to user. I'll review the issue. |
@Monteirocode To get indented syntax, you'd manually pass Not sure if automatic detection of it is a good idea directly in Might be worth a shot at using that one! Provide your thoughts over there, Forbes also had some thoughts on it. |
yep.. it works partially, only test for renderFile fails.
|
Okey, it was the file extension, nah. But okey, @Monteirocode it's not our job to do detecting and do some tricks and hacks to allow to income both syntaxes. It's works for both syntaxes, you just should add |
@Monteirocode just use |
I'm suggesting we adapt |
Hey, is there any change to make this support indented sass styles? Similar to how webpack's sass-loader or gulp-sass or use node-sass but with support for both version.
The text was updated successfully, but these errors were encountered: