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

Allow space after forward slashes #4

Closed
teddybradford opened this issue Jun 9, 2015 · 9 comments
Closed

Allow space after forward slashes #4

teddybradford opened this issue Jun 9, 2015 · 9 comments

Comments

@teddybradford
Copy link

I get an error with the following code:
// display: flex;
but this works fine:
//display: flex;
It would be nice if the first example worked too. Many text editors insert a space by default when you comment a line.

@moczolaszlo
Copy link
Owner

I'm affraid, but it's impossible now, because postCSS can't parse that yet. :(

Maybe @ai can refute me... :)

@ai
Copy link

ai commented Jun 9, 2015

Yes, we need to wait Custom Syntaxes :-)

@ScottSmith95
Copy link

Custom syntaxes are here, so is this a possibility again?

@ai
Copy link

ai commented Sep 15, 2015

@ScottSmith95 it is already done with postcss-scss

@ScottSmith95
Copy link

Seems like that is a much larger plugin than I need for this feature. Also, not sure if it's broken with gulp-postcss, but it doesn't seem to run as a plugin.

@ai
Copy link

ai commented Sep 15, 2015

@ScottSmith95 postcss-scss is not a plugin, it is a parser. You should set it to parser option in process method. I created a issue in gulp-postcss to add syntax options to docs.

@ScottSmith95
Copy link

So what is the way to declare this (in the meantime)?

 var processors = [
    parser(require('postcss-scss')),
    require('postcss-import')({skipDuplicates: false}),
    require('postcss-custom-properties'),
    require('postcss-mixins'),
    require('postcss-nested'),
    require('postcss-custom-media'),
    require('autoprefixer')('last 4 versions', '> 1%', 'ie 9', 'ie 8', 'Firefox ESR'),
    require('css-mqpacker')({sort: true})
  ];

(My current process array)

@ai
Copy link

ai commented Sep 15, 2015

@ScottSmith95 it is option, not plugin ;)

var postcss = require('gulp-postcss');
var scss    = require('postcss-scss');

var plugins = [];

return gulp.src('src/*.css')
    .pipe( postcss(plugins, { parser: scss }) )

@ScottSmith95
Copy link

Thanks! I'd still submit that a custom parser seems a bit scary for what seems like a small feature, although I know it's hard to parse without a custom parser.

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

No branches or pull requests

4 participants