Open faceleg opened 8 years ago
Could you provide the repo please?
My suggestion is that you should use parsers: { 'postcss': 'postcss' }
option from here https://github.com/SC5/sc5-styleguide#build-options but maybe something else, cannot guess without seeing your code.
@varya Using CLI --parsers argument with option "{ css: 'postcss' }" and "{ postcss: 'postcss' }", the script reports the same error both times when using postcss-nested:
Parsing error: Please check validity of the block starting from line #8
7 | .test-component {
8*| &::before {
9 | content: 'Should work';
10 | }
Syntax: css
Gonzales PE version: 3.0.0-31
Oh and one more thing: currently I'm using the styleguide:ignore:start and styleguide:ignore:end flags in source css, but it would be awesome to get away without the ignore flags.
Currently postCSS support does not support additional plug-ins. The postCSS tree processing is located in https://github.com/SC5/sc5-styleguide/blob/master/lib/modules/parsers/postcss.js and currently it is not possible to inject 3rd party postCSS processers. However this is very useful feature so we consider implementing it.
Just plug your postcss in pipes after styleguide
@glebmachine yep, that's the option I have resorted to now, but it is a workaround. It would be cool to have postcss additional plugin support. As hannu said, I think it should be considered for implementation.
@karolis-adapt not really. Piping postcss after styleguide is canonical gulp way to achieve your goal. Postccss integration is unnecessary here.
@glebmachine wait a sec. I think I misunderstood your previous comment. Currently, I'm generating the styleguide using the built css files. If I use styleguide with postcss files (not piping anything anywhere except for the read stream I guess) the error mentioned in the original comment gets logged out. Not using gulp, just cli interface of sc5 styleguide.
@karolis-adapt Ou, i missunderstood you too. It's may possible to implement after this issue https://github.com/SC5/sc5-styleguide/issues/767
You still have option to create custom gulp postcss task, with full postprocessing chain btw.
@faceleg @karolis-adapt Could you try out this version, does it help? https://github.com/SC5/sc5-styleguide/releases/tag/0.3.41 It does not work with PostCSS plugins yet, but uses PostCSS parser for the source code. It may be enough to avoid StyleGuide fail on your project.
@varya the issue persists. Updated the issue example repo to use the latest sc5-styleguide.
Wow I look away for a second and this blows up.
Thanks for continuing to work towards this!
Has anyone gotten this to work?
I use a few postCSS plugins in my workflow. Is there a way to have sc5-styleguide use them as well?
When I attempt to run the given example in my gulpfile, I get sytnax errors due to the additional syntax my postCSS plugins allow.