Ruby on Rails Tuesday, February 18, 2020

Fugee-


when you switch from css to scss, you need to rename application.css to application.scss and do the following:

stop using //= require

instead use @import always and from now on when using scss. Do not use //= require syntax anymore

this is explained in the "IMPORTANT NOTE" at the top of the sass-rails docs:



if you are trying to install Bootstrap, there are some bad tutorials on the internet. I think one of them tells you to put the bootstrap.scss into your application.js file. Don't do that.

instead backtrack on what you did and use webpack to install Bootstrap (this is NOT the same as the 'old way' which you could still do on a Rails 6 app), simple instructions here : https://gorails.com/forum/install-bootstrap-with-webpack-with-rails-6-beta

-jason








On Saturday, January 18, 2020 at 10:23:56 PM UTC-5, fugee ohu wrote:


On Saturday, January 18, 2020 at 11:11:11 AM UTC-5, Ariel Juodziukynas wrote:
"//= require ..." is Sprocket's syntax (most known as rails' assets pipeline), not webpacker's. If you really want to handle CSS assets with webpacker you should start by reading this https://github.com/rails/webpacker/blob/master/docs/css.md

El sáb., 18 ene. 2020 a las 4:00, fugee ohu (<fuge...@gmail.com>) escribió:
I have my stylesheet in app/javascript/stylesheets and need to include actiontext.scss in application.scss where both files are located in app/javascript/stylesheets but using
//= require actiontext has no effect, styling is still not being applied

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/58c1a214-6a7c-4b16-8e02-60a17cbb15d9%40googlegroups.com.

Nothing in there about loaders I'm trying to get actiontext.scss to load I have listed in app/javascripts/packs/application.js
import "../stylesheets/actiontext.scss"
but the styling's  not being applied

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/67ee24bd-88bd-4289-b865-bb0c77eea749%40googlegroups.com.

No comments:

Post a Comment