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

質問編集履歴

6

2021/03/03 02:20

投稿

guiyouxiaoyu
guiyouxiaoyu

スコア0

title CHANGED
@@ -1,1 +1,1 @@
1
- Nextjsでコンポーネントにクラス名を渡す
1
+ Next.jsでコンポーネントにクラス名を渡す
body CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  ◼️button.module.css
13
13
  .red {
14
- color :red;
14
+ color: red;
15
15
  }
16
16
 
17
17
  対応方法についてご教示いただければ幸いです。

5

2021/03/03 02:20

投稿

guiyouxiaoyu
guiyouxiaoyu

スコア0

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,6 @@
1
- 以下のようなButtonコンポーネントにpropsでを渡したい(<Button color="red">)のですが、button.module.cssで.redにcolor:redを設定しても適用されません。
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

2021/03/03 02:19

投稿

guiyouxiaoyu
guiyouxiaoyu

スコア0

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

2021/03/03 00:54

投稿

guiyouxiaoyu
guiyouxiaoyu

スコア0

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

2021/03/03 00:50

投稿

guiyouxiaoyu
guiyouxiaoyu

スコア0

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.red}
8
+ <button className={styles.color}
9
9
  )
10
10
 
11
11
  対応方法についてご教示いただければ幸いです。

1

2021/03/03 00:47

投稿

guiyouxiaoyu
guiyouxiaoyu

スコア0

title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,4 @@
1
- 以下のようなbuttonコンポーネントにpropsで色を渡したい(<Button color="red">)のですが、cssが適用されません。
1
+ 以下のようなButtonコンポーネントにpropsで色を渡したい(<Button color="red">)のですが、cssが適用されません。
2
2
 
3
3
  import styles from './button.module.css';
4
4
  type props {