@gnist/themes 4.5.1 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +7 -49
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -157,8 +157,10 @@ const box = gnistStyle([
157
157
 
158
158
  ### Typography
159
159
 
160
- The `typography` module exports helpers for setting correct typography styles (`responsiveTypography` and `densityTypography`),
161
- and a css class for setting global text styles.
160
+ The `typography` module exports `responsiveTypography` for responsive text styles
161
+ and `globalTextStyles` for setting global text styles.
162
+
163
+ For a more compact component layout, use `density="compact"` on components that support it.
162
164
 
163
165
  #### Responsive typography
164
166
 
@@ -171,59 +173,15 @@ Some examples:
171
173
  ```tsx
172
174
  import { gnistStyle } from "@gnist/themes/layers.css.js";
173
175
  import { atoms } from "@gnist/themes/atoms.css.js";
174
- import { responsiveTypography } from "@gnist/themes/typography.css.js"
176
+ import { responsiveTypography } from "@gnist/themes/typography.css.js";
175
177
 
176
178
  const someStyle = gnistStyle([
177
179
  atoms({ display: "flex", padding: "xs" }),
178
180
  responsiveTypography.lead,
179
- ])
181
+ ]);
180
182
 
181
183
  // or inline
182
- <div className={responsiveTypography.description}>{children}</div>
183
- ```
184
-
185
- #### Density typography
186
-
187
- `densityTypography` helps you create a recipe (for use with `@vanilla-extract/recipe`) for the given typography styles, which has the `density: "default" | "compact"` variants,
188
- and sets the correct css classes. It uses [`atoms`](#atoms) under the hood.
189
-
190
- It is a record which, when given a typography style, returns an object with the `variants` prop which is suitable for merging into a recipe.
191
-
192
- Example:
193
-
194
- ```ts
195
- import { gnistRecipe } from "@gnist/themes/layers.css.js";
196
- import { atoms } from "@gnist/themes/atoms.css.js";
197
- import { densityTypography } from "@gnist/themes/typography.css.js";
198
-
199
- const action = gnistRecipe({
200
- base: atoms({ display: "block" }),
201
- ...densityTypography.action,
202
- });
203
-
204
- const className = action({ density: "default" });
205
- ```
206
-
207
- Combining with other variants:
208
-
209
- ```ts
210
- import { gnistRecipe } from "@gnist/themes/layers.css.js";
211
- import { atoms } from "@gnist/themes/atoms.css.js";
212
- import { densityTypography } from "@gnist/themes/typography.css.js";
213
-
214
- const box = gnistRecipe({
215
- base: [atoms({ display: "block" })],
216
- variants: {
217
- color: {
218
- primary: boxColors["primary-container"],
219
- secondary: boxColors["secondary-container"],
220
- },
221
- ...densityTypography.notice.variants,
222
- },
223
- defaultVariants: { color: "primary", density: "default" },
224
- });
225
-
226
- const className = box({ color: "secondary", density: "compact" });
184
+ <div className={responsiveTypography.description}>{children}</div>;
227
185
  ```
228
186
 
229
187
  #### Global text styles
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gnist/themes",
3
- "version": "4.5.1",
3
+ "version": "4.5.2",
4
4
  "license": "UNLICENSED",
5
5
  "description": "",
6
6
  "type": "module",
@@ -69,5 +69,5 @@
69
69
  "token-transformer": "0.0.19",
70
70
  "tsx": "^4.23.15"
71
71
  },
72
- "gitHead": "7ac360f4c2778036689082d2b569d1be2c055328"
72
+ "gitHead": "2a9e64884f6dd563d65f44c99bff5cf61df5ec23"
73
73
  }