質問するログイン新規登録

質問編集履歴

1

追記しました。

2020/01/15 01:24

投稿

smty
smty

スコア33

title CHANGED
File without changes
body CHANGED
@@ -22,4 +22,41 @@
22
22
  `.breadcrumb` はmaterializeで定義されているクラスになります。
23
23
  `font-size: 12px !important;` でも元の`.breadcrumb`のスタイルが当たっています。
24
24
 
25
+ app/assets/stylesheets/application.scss
26
+ ```
27
+ /*
28
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
29
+ * listed below.
30
+ *
31
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
32
+ * vendor/assets/stylesheets directory can be referenced here using a relative path.
33
+ *
34
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
35
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
36
+ * files in this directory. Styles in this file should be added after the last require_* statement.
37
+ * It is generally better to create a new file per style scope.
38
+ *
39
+ *= require_tree .
40
+ *= require_self
41
+ *= require material_icons
42
+ */
43
+ @import "materialize";
44
+ ```
45
+ application.scssと同階層に`example.scss` が存在します。
46
+ webpackでコンパイルしています。
47
+ `example.scss` の他のスタイル(独自で作ったクラスなど)は反映されています。
48
+ ただ、以下のように`example-class ` にスタイルを当てて上書きしようとしても、
49
+ `breadcrumb` クラスが優先されている状態です。
50
+ ```
51
+ <nav>
52
+ <div class="nav-wrapper">
53
+ <div class="col s12">
54
+ <a href="#!" class="example-class breadcrumb">First</a>
55
+ <a href="#!" class="breadcrumb">Second</a>
56
+ <a href="#!" class="breadcrumb">Third</a>
57
+ </div>
58
+ </div>
59
+ </nav>
60
+ ```
61
+
25
62
  どなたかわかる方いたら教えてください。