Episodes
claudiug PRO said 11 months ago on Fixing Assets in CSS Bundling for Rails :
how this will work with slim-select for example
I try to add in application.sass.scss 

@use 'slim-select/dist/slimselect.css';
@
import also
I try to also add it inside of the js
neither work.

any tips here?


claudiug PRO said 11 months ago on Fixing Assets in CSS Bundling for Rails :
@use 'slim-select/dist/slimselect.css';
@use 'bootstrap/scss/bootstrap';

using this will load all of them

michalkorzawski PRO said 10 months ago on Fixing Assets in CSS Bundling for Rails :
did you try adding 
`Rails.application.config.assets.paths << Rails.root.join('node_modules')`
to `config/initializers/assets.rb` ?

Stephane PAQUET PRO said 9 months ago on Fixing Assets in CSS Bundling for Rails :
There seem to be a catch when using `--css tailwind`. When you add the @import at the end of the `application.tailwind.css` file the imported styles are not loading. While if you place them before the @tailwind lines everything works as planned.

I encountered this issue when I tried to add actiontext to a project configured with tailwind css. The actiontext.css file was placed after the @tailwind lines and Trix style was'nt applied.

My configuration:
Rails 7.0.1 with tailwind and esbuild
Ruby 3.0.3


marklar said 9 months ago on Fixing Assets in CSS Bundling for Rails :
  Stephane PAQUET have you been able to get fontawesome working in production with this approach? 

@import '@fortawesome/fontawesome-pro/css/all';
@tailwind base;
@tailwind components;
@tailwind utilities;

For me, this works in development, however, the fonts aren't displayed correctly when deployed to Heroku.

Do you know the correct path to use in manifest.js when importing fontawesome into application.tailwind.css?

Stephane PAQUET PRO said 9 months ago on Fixing Assets in CSS Bundling for Rails :
  marklar did you try following  David Kimura  tutorial?

marklar said 9 months ago on Fixing Assets in CSS Bundling for Rails :
Do you mean in the video where Dave copies the fonts from the node modules folder? If yes, I’m not keen on that approach. 

I think I’ll try using tailwind with postcss and see how I go.

odthoma PRO said 7 months ago on Fixing Assets in CSS Bundling for Rails :
I found a pretty good solution to this. I think this is a better approach than copying the fonts over.

Add this to config/initializers/assets.rb:
Rails.application.config.assets.paths << Rails.root.join('node_modules/@fortawesome/fontawesome-pro')

And then set the FontAwesome font-path sass variable to:
$fa-font-path: './webfonts';

Login to Comment