Skip to content

React: Styling React Applications - examples for css modules #29635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions react/the_react_ecosystem/styling_react_applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ This section contains a general overview of topics that you will learn in this l

Regular CSS is the simplest way to style. CSS Modules let you write CSS style declarations that are scoped locally, which means that we finally no longer have to worry about our class names potentially conflicting with other classes in the global scope.

```jsx
import styles from './styles.module.css';

function Button() {
return <button className={styles.success_btn}>Success</button>
}
```

### CSS in JS

Why even write CSS in CSS when you can write it in JavaScript? Just kidding, of course!
Expand Down