Skip to content

Instantly share code, notes, and snippets.

@KevinVR
Created August 15, 2021 13:04
Show Gist options
  • Save KevinVR/c1ffb65bdb4e6ddeaea5e286c3b7cac1 to your computer and use it in GitHub Desktop.
Save KevinVR/c1ffb65bdb4e6ddeaea5e286c3b7cac1 to your computer and use it in GitHub Desktop.
// Text.module.css
.custom-text {
color: red;
font-size: 20px;
}
// Text.jsx
import TextStyles from './Text.module.css';
function Text({ text }) {
return <div className={TextStyles.customText}>
// Notice we use the TextStyles value
// as the final class name is auto-generated
{text}
</div>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment