|
1 | 1 | # @capsizecss/core |
2 | 2 |
|
| 3 | +## 4.1.3 |
| 4 | + |
| 5 | +### Patch Changes |
| 6 | + |
| 7 | +- [#239](https://github.com/seek-oss/capsize/pull/239) [`41ef5b0`](https://github.com/seek-oss/capsize/commit/41ef5b0663f468575369485152b800ea48c53812) Thanks [@delucis](https://github.com/delucis)! - Bundle Capsize packages with [tsdown](https://tsdown.dev/) instead of Crackle. This is an internal change only and does not affect the public API. |
| 8 | + |
3 | 9 | ## 4.1.2 |
4 | 10 |
|
5 | 11 | ### Patch Changes |
|
35 | 41 | ```ts |
36 | 42 | createFontStack([merriweatherSans, arial], { |
37 | 43 | fontFaceProperties: { |
38 | | - sizeAdjust: '300%', |
| 44 | + sizeAdjust: "300%", |
39 | 45 | }, |
40 | 46 | }); |
41 | 47 | ``` |
|
97 | 103 |
|
98 | 104 | ```ts |
99 | 105 | const { fontFamily, fontFaces } = createFontStack([lobster, arial], { |
100 | | - subset: 'thai', |
| 106 | + subset: "thai", |
101 | 107 | }); |
102 | 108 | ``` |
103 | 109 |
|
|
110 | 116 | Migrating Capsize packages to be precompiled with [Crackle], with a key change being Crackle now handles entry points instead of [Preconstruct]. |
111 | 117 |
|
112 | 118 | Other benefits include: |
113 | | - |
114 | 119 | - Modern module entry point syntax using the ["exports" field] with better tooling compatibility. |
115 | 120 | - Improved types and better ESM and CJS compatibility |
116 | 121 | - Better alignment between compiled code and module entry points |
|
138 | 143 | The `fontFamily` returned from `createFontStack` now includes the original fallback font name(s). These are appended to the end of the font stack in the case the preferred font and generated fallbacks are not available. |
139 | 144 |
|
140 | 145 | ```ts |
141 | | - import lobster from '@capsizecss/metrics/lobster'; |
142 | | - import arial from '@capsizecss/metrics/arial'; |
| 146 | + import lobster from "@capsizecss/metrics/lobster"; |
| 147 | + import arial from "@capsizecss/metrics/arial"; |
143 | 148 |
|
144 | 149 | const { fontFamily } = createFontStack([lobster, arial]); |
145 | 150 | ``` |
|
176 | 181 | ### Example usage |
177 | 182 |
|
178 | 183 | ```ts |
179 | | - import { createFontStack } from '@capsizecss/core'; |
180 | | - import lobster from '@capsizecss/metrics/lobster'; |
181 | | - import helveticaNeue from '@capsizecss/metrics/helveticaNeue'; |
182 | | - import arial from '@capsizecss/metrics/arial'; |
| 184 | + import { createFontStack } from "@capsizecss/core"; |
| 185 | + import lobster from "@capsizecss/metrics/lobster"; |
| 186 | + import helveticaNeue from "@capsizecss/metrics/helveticaNeue"; |
| 187 | + import arial from "@capsizecss/metrics/arial"; |
183 | 188 |
|
184 | 189 | const { fontFamily, fontFaces } = createFontStack([ |
185 | 190 | lobster, |
|
198 | 203 | ```css |
199 | 204 | /* `fontFaces` */ |
200 | 205 | @font-face { |
201 | | - font-family: 'Lobster Fallback: Helvetica Neue'; |
202 | | - src: local('Helvetica Neue'); |
| 206 | + font-family: "Lobster Fallback: Helvetica Neue"; |
| 207 | + src: local("Helvetica Neue"); |
203 | 208 | ascent-override: 115.1741%; |
204 | 209 | descent-override: 28.7935%; |
205 | 210 | size-adjust: 86.8251%; |
206 | 211 | } |
207 | 212 | @font-face { |
208 | | - font-family: 'Lobster Fallback: Arial'; |
209 | | - src: local('Arial'); |
| 213 | + font-family: "Lobster Fallback: Arial"; |
| 214 | + src: local("Arial"); |
210 | 215 | ascent-override: 113.5679%; |
211 | 216 | descent-override: 28.392%; |
212 | 217 | size-adjust: 88.053%; |
|
262 | 267 | Accepts capsize `options` and returns a string representation of the capsize styles that can then be templated into a HTML `style` tag or appended to a stylesheet. |
263 | 268 |
|
264 | 269 | ```ts |
265 | | - import { createStyleString } from '@capsizecss/core'; |
| 270 | + import { createStyleString } from "@capsizecss/core"; |
266 | 271 |
|
267 | | - const capsizedStyleRule = createStyleString('capsizedText', { |
| 272 | + const capsizedStyleRule = createStyleString("capsizedText", { |
268 | 273 | fontSize: 18, |
269 | 274 | fontMetrics: { |
270 | 275 | // ... |
|
0 commit comments