//= require stylesheet with webpacker

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

//= require stylesheet with webpacker

fugee ohu
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/58c1a214-6a7c-4b16-8e02-60a17cbb15d9%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: //= require stylesheet with webpacker

Ariel Juodziukynas
"//= 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 (<[hidden email]>) 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/58c1a214-6a7c-4b16-8e02-60a17cbb15d9%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcB%2BnhTt-gFNAVHCJYZpGTeDFFATDZr820%2Bf5xqaU-wzsQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: //= require stylesheet with webpacker

fugee ohu


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 <a href="https://github.com/rails/webpacker/blob/master/docs/css.md" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frails%2Fwebpacker%2Fblob%2Fmaster%2Fdocs%2Fcss.md\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNETpm6oorw-u_Fq6A5IkhrZ2OEPKw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frails%2Fwebpacker%2Fblob%2Fmaster%2Fdocs%2Fcss.md\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNETpm6oorw-u_Fq6A5IkhrZ2OEPKw&#39;;return true;">https://github.com/rails/webpacker/blob/master/docs/css.md

El sáb., 18 ene. 2020 a las 4:00, fugee ohu (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="6wSQnKxuDQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="6wSQnKxuDQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/58c1a214-6a7c-4b16-8e02-60a17cbb15d9%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/58c1a214-6a7c-4b16-8e02-60a17cbb15d9%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/58c1a214-6a7c-4b16-8e02-60a17cbb15d9%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/55b87f6f-45e9-4f46-8c1b-b3bbfb4b6f41%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: //= require stylesheet with webpacker

Jason Fleetwood-Boldt
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 <a href="https://github.com/rails/webpacker/blob/master/docs/css.md" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frails%2Fwebpacker%2Fblob%2Fmaster%2Fdocs%2Fcss.md\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNETpm6oorw-u_Fq6A5IkhrZ2OEPKw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frails%2Fwebpacker%2Fblob%2Fmaster%2Fdocs%2Fcss.md\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNETpm6oorw-u_Fq6A5IkhrZ2OEPKw&#39;;return true;">https://github.com/rails/webpacker/blob/master/docs/css.md

El sáb., 18 ene. 2020 a las 4:00, fugee ohu (<[hidden email]>) 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 [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/58c1a214-6a7c-4b16-8e02-60a17cbb15d9%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/58c1a214-6a7c-4b16-8e02-60a17cbb15d9%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/58c1a214-6a7c-4b16-8e02-60a17cbb15d9%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/67ee24bd-88bd-4289-b865-bb0c77eea749%40googlegroups.com.