前提・実現したいこと
railsでアプリケーションを制作しており、現在scssファイルの編集中です。
bootstrapをapplication.scssに記載することにより全ページに共通でスタイルを適用させた後、ページ毎(またはアクション毎)にscssを作成してスタイルを上書きしたいです。
トップページについて、以下のコードの通りスタイルを上書きしようとしたのですが、反映されませんでした。
どうすれば、ページ毎にスタイル(scss)を上書きできるのかご教示いただければ幸いです。
assets/stylesheets/application.scss
@import "bootstrap"; // @import "devise_bootstrap_views"; /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's * vendor/assets/stylesheets directory can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the bottom of the * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS * files in this directory. Styles in this file should be added after the last require_* statement. * It is generally better to create a new file per style scope. * *= require_self *= require_tree . */
assets/stylesheets/top.scss
.top-wrapper{ width: 100%; height: 400px; display: flex; align-items: center; justify-content: center; background-color: #2B5797; .top-title{ font-size: 100px ; color: #fff; } }
views/top/index.html.slim
.top-wrapper .top-title 農災App
controllers/concerns/top_controller.rb
class TopController < ApplicationController def index end end
あなたの回答
tips
プレビュー