Skip to content

Instantly share code, notes, and snippets.

@bengrunfeld
Created March 25, 2021 15:53
Show Gist options
  • Save bengrunfeld/f732b1014c265a28b024fbf431f54d29 to your computer and use it in GitHub Desktop.
Save bengrunfeld/f732b1014c265a28b024fbf431f54d29 to your computer and use it in GitHub Desktop.
CSS in JSX
// style.module.css
.pageWrapper { display: flex; }
.investorForm { width: 90%; }
.addInvestorBtn{ background: green; }
.clearFormBtn{ background: red; }
.nextPageBtn{ background: blue; }
// Page.jsx
import styles from './mystyle.module.css';
const Page = () => (
<div className={styles.pageWrapper>
<div className={styles.investorForm>
<input className={styles.investorInput} />
<button className={styles.addInvestorBtn}>Add Investor</button>
</div>
<button className={styles.clearFormBtn}Clear form</button>
<button className={styles.nextPageBtn}Next</button>
</div>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment