-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
PostCSS fonts #1190
Comments
Thank you for opening this.
Can you provide an example of how you included these styles? I want to get a better understanding of the use case. |
First
In your
Build the css and go to the root path of your rails app. Notice the console it says its missing a font. Then add
to your |
Closes #1190 When including styles from `node_modules` via `@import`, we discovered that static assets referenced in those style sheets are not loaded, resulting in an error. Since [cssbundling-rails][] ships with [postcss-import][], we are already encouraging the use of importing styles from `node_modules`. This commit aims to solve this problem by installing and configuring [postcss-url][]. One thing to note is that we override the `postcss.config.js` generated by the cssbundling-rails installation script, which assumes that the following plugins have been installed. - `postcss-import` - `postcss-nesting` - `autoprefixer` Should that change, this file would be invalid, and those packages would need to be installed. [cssbundling-rails]: https://github.com/rails/cssbundling-rails [postcss-import]: https://github.com/postcss/postcss-import [postcss-url]: https://github.com/postcss/postcss-url
Closes #1190 When including styles from `node_modules` via `@import`, we discovered that static assets referenced in those style sheets are not loaded, resulting in an error. Since [cssbundling-rails][] ships with [postcss-import][], we are already encouraging the use of importing styles from `node_modules`. This commit aims to solve this problem by installing and configuring [postcss-url][]. Because `postcss-url` needs a directory to copy assets to, we create `app/assets/static` as part of the generator. One thing to note is that we override the `postcss.config.js` generated by the cssbundling-rails installation script, which assumes that the following plugins have been installed. - `postcss-import` - `postcss-nesting` - `autoprefixer` Should that change, this file would be invalid, and those packages would need to be installed. [cssbundling-rails]: https://github.com/rails/cssbundling-rails [postcss-import]: https://github.com/postcss/postcss-import [postcss-url]: https://github.com/postcss/postcss-url
Closes #1190 When including styles from `node_modules` via `@import`, we discovered that static assets referenced in those style sheets are not loaded, resulting in an error. Since [cssbundling-rails][] ships with [postcss-import][], we are already encouraging the use of importing styles from `node_modules`. This commit aims to solve this problem by installing and configuring [postcss-url][]. Because `postcss-url` needs a directory to copy assets to, we create `app/assets/static` as part of the generator. One thing to note is that we override the `postcss.config.js` generated by the cssbundling-rails installation script, which assumes that the following plugins have been installed. - `postcss-import` - `postcss-nesting` - `autoprefixer` Should that change, this file would be invalid, and those packages would need to be installed. [cssbundling-rails]: https://github.com/rails/cssbundling-rails [postcss-import]: https://github.com/postcss/postcss-import [postcss-url]: https://github.com/postcss/postcss-url
Closes #1190 When including styles from `node_modules` via `@import`, we discovered that static assets referenced in those style sheets are not loaded, resulting in console errors. Since [cssbundling-rails][] ships with [postcss-import][], we are already encouraging the use of importing styles from `node_modules`. This commit aims to solve this problem by installing and configuring [postcss-url][]. Because `postcss-url` needs a directory to copy assets to, we create `app/assets/static` as part of the generator. One thing to note is that we override the `postcss.config.js` generated by the cssbundling-rails installation script, which assumes that the following plugins have been installed. - `postcss-import` - `postcss-nesting` - `autoprefixer` Should that change, this file would be invalid, and those packages would need to be installed. [cssbundling-rails]: https://github.com/rails/cssbundling-rails [postcss-import]: https://github.com/postcss/postcss-import [postcss-url]: https://github.com/postcss/postcss-url
Closes #1190 When including styles from `node_modules` via `@import`, we discovered that static assets referenced in those style sheets are not loaded, resulting in console errors. Since [cssbundling-rails][] ships with [postcss-import][], we are already encouraging the use of importing styles from `node_modules`. This commit aims to solve this problem by installing and configuring [postcss-url][]. Because `postcss-url` needs a directory to copy assets to, we create `app/assets/static` as part of the generator. One thing to note is that we override the `postcss.config.js` generated by the cssbundling-rails installation script, which assumes that the following plugins have been installed. - `postcss-import` - `postcss-nesting` - `autoprefixer` Should that change, this file would be invalid, and those packages would need to be installed. [cssbundling-rails]: https://github.com/rails/cssbundling-rails [postcss-import]: https://github.com/postcss/postcss-import [postcss-url]: https://github.com/postcss/postcss-url
Fixed in #1191 |
Closes #1190 When including styles from `node_modules` via `@import`, we discovered that static assets referenced in those style sheets are not loaded, resulting in console errors. Since [cssbundling-rails][] ships with [postcss-import][], we are already encouraging the use of importing styles from `node_modules`. This commit aims to solve this problem by installing and configuring [postcss-url][]. Because `postcss-url` needs a directory to copy assets to, we create `app/assets/static` as part of the generator. One thing to note is that we override the `postcss.config.js` generated by the cssbundling-rails installation script, which assumes that the following plugins have been installed. - `postcss-import` - `postcss-nesting` - `autoprefixer` Should that change, this file would be invalid, and those packages would need to be installed. [cssbundling-rails]: https://github.com/rails/cssbundling-rails [postcss-import]: https://github.com/postcss/postcss-import [postcss-url]: https://github.com/postcss/postcss-url
When including styles from node_modules, sometimes the font faces refer to the packages font files. When PostCSS process that, it doesn't copy the font files over.
For example with primereact installed at
node_modules/primereact/resources/themes/lara-dark-amber/theme.css
Suspenders didn't add additional postcss modules, but this is what I had to do to get that working:
The text was updated successfully, but these errors were encountered: