質問編集履歴
6
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
Next.jsでコンポーネントにクラス名を渡す
|
body
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
◼️button.module.css
|
13
13
|
.red {
|
14
|
-
color
|
14
|
+
color: red;
|
15
15
|
}
|
16
16
|
|
17
17
|
対応方法についてご教示いただければ幸いです。
|
5
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
以下のようなButtonコンポーネントにpropsで
|
1
|
+
以下のようなButtonコンポーネントにpropsでクラス名を渡したい(<Button color="red">)のですが、cssが適用されません。
|
2
2
|
|
3
|
+
◼️Button.tsx
|
3
4
|
import styles from './button.module.css';
|
4
5
|
type props {
|
5
6
|
color: string
|
@@ -8,4 +9,9 @@
|
|
8
9
|
<button className={styles.color}ボタン</button>
|
9
10
|
)
|
10
11
|
|
12
|
+
◼️button.module.css
|
13
|
+
.red {
|
14
|
+
color :red;
|
15
|
+
}
|
16
|
+
|
11
17
|
対応方法についてご教示いただければ幸いです。
|
4
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
color: string
|
6
6
|
}
|
7
7
|
export const Button: FC<props> = ({ color }) => (
|
8
|
-
<button className={styles.color}
|
8
|
+
<button className={styles.color}ボタン</button>
|
9
9
|
)
|
10
10
|
|
11
11
|
対応方法についてご教示いただければ幸いです。
|
3
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
以下のようなButtonコンポーネントにpropsで色を渡したい(<Button color="red">)のですが、css
|
1
|
+
以下のようなButtonコンポーネントにpropsで色を渡したい(<Button color="red">)のですが、button.module.cssで.redにcolor:redを設定しても適用されません。
|
2
2
|
|
3
3
|
import styles from './button.module.css';
|
4
4
|
type props {
|
2
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
color: string
|
6
6
|
}
|
7
7
|
export const Button: FC<props> = ({ color }) => (
|
8
|
-
<button className={styles.
|
8
|
+
<button className={styles.color}
|
9
9
|
)
|
10
10
|
|
11
11
|
対応方法についてご教示いただければ幸いです。
|
1
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
以下のような
|
1
|
+
以下のようなButtonコンポーネントにpropsで色を渡したい(<Button color="red">)のですが、cssが適用されません。
|
2
2
|
|
3
3
|
import styles from './button.module.css';
|
4
4
|
type props {
|