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

Add PostCSS import plugin as default #126

Merged
merged 1 commit into from Jul 25, 2023

Conversation

pinzonjulian
Copy link
Contributor

@pinzonjulian pinzonjulian commented Jun 30, 2023

https://github.com/postcss/postcss-import

It felt natural to me to immediately use the @import directive right after installing PostCSS and after fighting a bit with it I realised the plugin wasn't installed so it seemed like it would be a sensible default to have.

Adding the official postcss-import plugin enables the usage of PostCSS's @import directive out of the box so when adding a CSS library (like open-props) or when adding custom stylesheets it works seamlessly.

From the PostCSS-import docs:

PostCSS plugin to transform @import rules by inlining content.
This plugin can consume local files, node modules or web_modules. To resolve path of an @import rule, it can look into root directory (by default process.cwd()), web_modules, node_modules or local modules. When importing a module, it will look for index.css or file referenced in package.json in the style or main fields. You can also provide manually multiples paths where to look at.

Note that this is not the CSS native @import which didn't work on a vanilla installation of Rails with Propshaft. I'm actually not sure if it's supposed to, to be honest.

https://github.com/postcss/postcss-import

It felt natural to me to immediately use the @import directive and after fighting a bit with it I relised the plugin wasn't installed so it seemed like it would be a sensible default to have.

Adding the official postcss-import plugin enables the usage of PostCSS's @import directive out of the box so when adding a CSS library (like open-props) or when adding custom stylesheets it works seamlessly

Note that this is **not** the CSS native @import.
@guilleiguaran guilleiguaran merged commit 6ca4d10 into rails:main Jul 25, 2023
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 this pull request may close these issues.

None yet

2 participants