Skip to content

Commit 72660ad

Browse files
fixes along the way
1 parent 3417541 commit 72660ad

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

packages/pigment-react/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ Pigment CSS is a zero-runtime CSS-in-JS library that extracts the colocated sty
2424

2525
## Getting started
2626

27-
Pigment CSS supports Next.js and Vite with support for more bundlers in future. You must install the corresponding plugin, as shown below.
27+
Pigment CSS supports Next.js and Vite with support for more bundlers in the future.
28+
You must install the corresponding plugin, as shown below.
2829

2930
### Why choose Pigment CSS
3031

@@ -33,7 +34,7 @@ Thanks to recent advancements in CSS (like CSS variables and `color-mix()`), "tr
3334
Pigment CSS addresses the needs of the modern React developer by providing a zero-runtime CSS-in-JS styling solution as a successor to tools like Emotion and styled-components.
3435

3536
Compared to its predecessors, Pigment CSS offers improved DX and runtime performance (though at the cost of increased build time) while also being compatible with React Server Components.
36-
Pigment CSS is built on top of [WyW-in-JS](https://wyw-in-js.dev/), enabling us to provide the smoothest possible experience for Material UI users when migrating from Emotion in v5 to Pigment in v6.
37+
Pigment CSS is built on top of [WyW-in-JS](https://wyw-in-js.dev/), enabling us to provide the smoothest possible experience for Material UI users when migrating from Emotion in v5 to Pigment CSS in v6.
3738

3839
### Start with Next.js
3940

@@ -189,7 +190,7 @@ function App() {
189190
The Pigment CSS library differs from "standard" runtime CSS-in-JS libraries in a few ways:
190191

191192
1. You never get direct access to props in your styled declarations. This is because prop values are only available at runtime, but the CSS is extracted at build time. See [Styling based on runtime values](#styling-based-on-runtime-values) for a workaround.
192-
2. Your styles must be declarative, and must account for all combinations of props that you want to style.
193+
2. Your styles must be declarative and must account for all combinations of props that you want to style.
193194
3. The theme lets you declare CSS tokens that become part of the CSS bundle after the build. Any other values and methods that it might have are only available during build time—not at runtime. This leads to smaller bundle sizes.
194195

195196
#### Styling based on props
@@ -296,7 +297,7 @@ const Button = styled('button')({
296297

297298
#### Styling based on runtime values
298299

299-
> 💡 This approach is recommended when the value of a prop is **unknown** ahead of time or possibly unlimited values, e.g. styling based on the user's input.
300+
> 💡 This approach is recommended when the value of a prop is **unknown** ahead of time or possibly unlimited values, for example styling based on the user's input.
300301
301302
Use a callback function as a value to create a dynamic style for the specific CSS property:
302303

@@ -501,7 +502,7 @@ console.log(theme.vars.colors.primary); // 'var(--colors-primary)'
501502

502503
Some tokens, especially color-related tokens, can have different values for different scenarios. For example in a daylight condition, the background color might be white, but in a dark condition, it might be black.
503504

504-
The `extendTheme` utility lets you define theme with a special `colorSchemes` key:
505+
The `extendTheme` utility lets you define a theme with a special `colorSchemes` key:
505506

506507
```jsx
507508
extendTheme({
@@ -558,7 +559,8 @@ function App() {
558559

559560
#### Styling based on color scheme
560561

561-
The `extendTheme` utility attach a function called `applyStyles` to the theme object. It receives a color scheme as the first argument followed by a style object. It will return a proper CSS selector based on the theme configuration.
562+
The `extendTheme` utility attaches a function called `applyStyles` to the theme object. It receives a color scheme as the first argument followed by a style object.
563+
It will return a proper CSS selector based on the theme configuration.
562564

563565
```jsx
564566
const Heading = styled('h1')(({ theme }) => ({

0 commit comments

Comments
 (0)