CSS Modules
組み込みの CSS Modules サポートを使用するには、まずアプリケーションで CSS バンドル を設定していることを確認してください。
次に、.module.css
ファイル名の規約を使用して CSS Modules を選択できます。例:
.root {
border: solid 1px;
background: white;
color: #454545;
}
import styles from "./styles.module.css";
export const Button = React.forwardRef(
({ children, ...props }, ref) => {
return (
<button
{...props}
ref={ref}
className={styles.root}
/>
);
}
);
Button.displayName = "Button";