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

Suggestion: config to force postcss preprocessing on all files #5

Open
arggh opened this issue Jul 23, 2021 · 1 comment · May be fixed by #6
Open

Suggestion: config to force postcss preprocessing on all files #5

arggh opened this issue Jul 23, 2021 · 1 comment · May be fixed by #6

Comments

@arggh
Copy link

arggh commented Jul 23, 2021

I haven't really given this much thought yet, but I ran into a situation where I would like to have autoprefixer mangle the CSS of various Svelte components in our app, some of them residing in separate packages.

Now, to achieve that, it seems I'd need to somehow add lang="postcss" attribute to all those components' <style> tags.

Would be great, if I could configure zodern:melte to always run postcss plugins as preprocessors, regardless of any lang-attributes.

Alternatively, instead of a config, the logic could work like so:

Use postcss as preprocessor if...

this.postcss exists...
...and there is no lang attribute in the <style> block...
...or, if there is, it has to be postcss

This would enable the use of PostCSS preprocessor, like Autoprefixer, without having to go through all your files setting the lang="postcss" attribute.

@zodern
Copy link
Owner

zodern commented Jul 23, 2021

This makes sense, and seems to be what svelte-preprocess does, though it will be a breaking change if we enable it by default.

Another option is with #2 and setting css: false, you should be able to use juliancwirko:postcss on all css, unless you want to only run it on css from svelte components.

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

Successfully merging a pull request may close this issue.

2 participants