Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Siriuszx committed Apr 28, 2024
1 parent c0e709f commit 1413aef
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions react/the_react_ecosystem/styling_react_applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@ Up until now you've been using vanilla CSS to style your React projects, but the

This section contains a general overview of topics that you will learn in this lesson.

- Know about ways to style React applications
- Know about ways to style React applications

### Vanilla CSS
### Vanilla CSS

Vanilla CSS is the simplest way to style. In the previous courses, you've learned a lot of CSS and all of those skills are applicable to React. There are a couple of things we'd like to highlight.

1. `CSS Modules` let you write CSS style declarations that are scoped locally.
1. `CSS Utility Frameworks` are a popular choice for styling React applications. They provide a set of pre-defined classes that you can directly use in your HTML, or JSX in our case. [Tailwind CSS](https://tailwindcss.com) is by far the most popular choice.

1. `CSS Utility Frameworks` are a popular choice for styling React applications. They provide a set of pre-defined classes that you can directly use in your HTML, or JSX in our case. [Tailwind CSS](https://tailwindcss.com) is by far the most popular choice.

### CSS in JS

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

CSS-in-JS is a paradigm for styling front-end projects. It allows you to entirely take control of CSS with JavaScript and extends it with various features. Additionally, it also helps to apply styling in a logical fashion i.e. based on state. There are various CSS-in-JS solutions. One of the most popular ones in the React ecosystem is [styled-components](https://styled-components.com/).

### Component libraries

What if everything's already done for you? Styling, behavior, and accessibility are taken care of for you in component libraries. As the name suggests, these libraries provide adaptable and reusable components that you can use directly in your project. These components include, but are not limited to, dropdowns, drawers, calendars, toggles, tabs, and all other components you can think of.
What if everything's already done for you? Styling, behavior, and accessibility are taken care of for you in component libraries. As the name suggests, these libraries provide adaptable and reusable components that you can use directly in your project. These components include, but are not limited to, dropdowns, drawers, calendars, toggles, tabs, and all other components you can think of.

[Material UI](https://mui.com/), [Radix](https://www.radix-ui.com/), and [Chakra UI](https://chakra-ui.com/) are worth a mention when talking about component libraries.

<div class="lesson-note lesson-note--tip" markdown="1" >

For the learning purposes throughout this course, we recommend that you avoid using CSS frameworks or component libraries, and instead implement your component's styling from scratch i.e. use [CSS Modules](#vanilla-css) or a [CSS-in-JS](#css-in-js) option.
For learning purposes throughout this course, we recommend that you avoid using CSS frameworks or component libraries, and instead implement your component's styling from scratch i.e. use [CSS Modules](#vanilla-css) or a [CSS-in-JS](#css-in-js) option.

</div>

Expand All @@ -48,14 +47,14 @@ For the learning purposes throughout this course, we recommend that you avoid us

### Knowledge check

This section contains questions for you to check your understanding of this lesson on your own. If you’re having trouble answering a question, click it and review the material it links to.
The following questions are an opportunity to reflect on key topics in this lesson. If you can't answer a question, click on it to review the material, but keep in mind you are not expected to memorize or master this knowledge.

- [How can you use CSS Modules in your React app?](https://www.makeuseof.com/react-components-css-modules-style/)
- [What does CSS-in-JS mean?](#css-in-js)
- [What are component libraries?](#component-libraries)

### Additional resources

This section contains helpful links to related content. It isnt required, so consider it supplemental.
This section contains helpful links to related content. It isn't required, so consider it supplemental.

- Josh Comeau has a nice article on [getting the most out of styled-components](https://www.joshwcomeau.com/css/styled-components/).
- Josh Comeau has a nice article on [getting the most out of styled-components](https://www.joshwcomeau.com/css/styled-components/).

0 comments on commit 1413aef

Please sign in to comment.