application.scssで
*= require_self
*= require_tree .
がないとapplication.scss以外のcssが反映されません。
ただ、あると、そもそもcssが反映されん。
どうすれば、application.scssをテンプレートのcssとして、そのほかを追加のcssとして反映することができますか?
scss
1//application.scss 2/* 3 * This is a manifest file that'll be compiled into application.css, which 4 * will include all the files listed below. 5 * 6 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, 7 * vendor/assets/stylesheets, or vendor/assets/stylesheets of plugins, if any, 8 * can be referenced here using a relative path. 9 * 10 * You're free to add application-wide styles to this file and they'll appear 11 * at the bottom of the compiled file so the styles you add here take 12 * precedence over styles defined in any styles defined in the other CSS/SCSS 13 * files in this directory. It is generally better to create a new file per 14 * style scope. 15 *= require_self 16 *= require_tree . 17*/ 18// Custom bootstrap variables must be set or imported *before* bootstrap. 19@import "bootstrap";
scss
1//order.scss 2.table-striped>tbody>tr:nth-child(odd)>td, 3.table-striped>tbody>tr:nth-child(odd)>th { 4 background-color: red; 5 } 6
application.html.erb
erb
1<!DOCTYPE html> 2<html> 3 <head> 4 <title>OctansLocal</title> 5 <%= csrf_meta_tags %> 6 7 <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 8 <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> 9 </head> 10..
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/01/04 02:28 編集
2019/01/04 02:32