前提・実現したいこと
variables.scssでデザインのベースになるものを変数で置き換えたい。
試したこと
全角、半角、スペルミスの確認。
variables.scssのインポート
発生している問題・エラーメッセージ
該当のソースコード
guest.scss
.request { width: 90%; margin: 0 auto; padding: 16px; background-color: #FFF; border-radius: 5px; &-title { color: $txt-head; font-weight: bolder; margin-bottom: 16px; &-p { font-size: small; margin-top: 0; } } &-detail { color: #000; } }
variables.scss
// テキスト $txt-head: #669999 !default; // ボタン $main-button: #669999;
application.scss
/* * 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_tree . *= require_self */ @import "variables"; @import "guest"; @import "user";
↑上記scssにはvariables以外の他のスタイルも追加されています。
補足
スペルミスもなく半角全角などの相違もなく、該当の「color: $txt-head;」の「$」を削除するとエラーは回避できるのですが、読みこんでいるはずのvariables.scssに指定している色になりません…。
お気づきの点がありましたらどなたかご助言いただけますと幸いです。
回答3件
あなたの回答
tips
プレビュー