CSS style not loading when printing. #205
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
By default, Rails uses Make sure to use vite_javascript_tag 'application', media: 'all'
vite_stylesheet_tag 'styles.scss', media: 'all' |
Beta Was this translation helpful? Give feedback.
-
yeah thats exactly the problem , How can i do this if its an scss file . Right now its imported in
I tried removing it and adding it in However i get an error: |
Beta Was this translation helpful? Give feedback.
-
Thank you @ElMassimo . That got it working. Might be a good idea to add this in the FAQs since others might also encounter this problem. |
Beta Was this translation helpful? Give feedback.
By default, Rails uses
media: 'screen'
when rendering stylesheets, so Vite Ruby applies the same default for styles injected from a script.Make sure to use
media: 'all'
when injecting the scripts or stylesheets if you want to apply those styles forprint
as well.