You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/pigment-react/README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,8 @@ Pigment CSS is a zero-runtime CSS-in-JS library that extracts the colocated sty
24
24
25
25
## Getting started
26
26
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.
28
29
29
30
### Why choose Pigment CSS
30
31
@@ -33,7 +34,7 @@ Thanks to recent advancements in CSS (like CSS variables and `color-mix()`), "tr
33
34
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.
34
35
35
36
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 MaterialUI 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 MaterialUI users when migrating from Emotion in v5 to Pigment CSS in v6.
37
38
38
39
### Start with Next.js
39
40
@@ -189,7 +190,7 @@ function App() {
189
190
The Pigment CSS library differs from "standard" runtime CSS-in-JS libraries in a few ways:
190
191
191
192
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.
193
194
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.
> 💡 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.
300
301
301
302
Use a callback function as a value to create a dynamic style for the specific CSS property:
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.
503
504
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:
505
506
506
507
```jsx
507
508
extendTheme({
@@ -558,7 +559,8 @@ function App() {
558
559
559
560
#### Styling based on color scheme
560
561
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.
0 commit comments