@pikacss/plugin-typography 0.0.38 → 0.0.39

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.
package/README.md CHANGED
@@ -16,7 +16,9 @@ import { defineEngineConfig } from '@pikacss/core'
16
16
  import { typography } from '@pikacss/plugin-typography'
17
17
 
18
18
  export default defineEngineConfig({
19
- plugins: [typography()]
19
+ plugins: [
20
+ typography() // Note: must call function
21
+ ]
20
22
  })
21
23
  ```
22
24
 
@@ -185,7 +187,7 @@ Size modifiers apply the complete `prose` styles with different font sizes:
185
187
 
186
188
  ### Customization
187
189
 
188
- Override color variables when creating the plugin:
190
+ Override color variables in the engine configuration:
189
191
 
190
192
  **pika.config.ts**:
191
193
  ```typescript
@@ -194,14 +196,15 @@ import { typography } from '@pikacss/plugin-typography'
194
196
 
195
197
  export default defineEngineConfig({
196
198
  plugins: [
197
- typography({
198
- variables: {
199
- '--pk-prose-color-body': '#374151',
200
- '--pk-prose-color-headings': '#111827',
201
- '--pk-prose-color-links': '#2563eb',
202
- }
203
- })
204
- ]
199
+ typography() // Note: must call function
200
+ ],
201
+ typography: {
202
+ variables: {
203
+ '--pk-prose-color-body': '#374151',
204
+ '--pk-prose-color-headings': '#111827',
205
+ '--pk-prose-color-links': '#2563eb',
206
+ }
207
+ }
205
208
  })
206
209
  ```
207
210
 
@@ -284,7 +287,7 @@ Using modular shortcuts can significantly reduce CSS bundle size:
284
287
 
285
288
  ## Documentation
286
289
 
287
- For complete documentation, visit: [PikaCSS Documentation](https://pikacss.dev)
290
+ For complete documentation, visit: [PikaCSS Documentation](https://pikacss.github.io/pikacss/)
288
291
 
289
292
  ## License
290
293
 
package/dist/index.cjs CHANGED
@@ -307,13 +307,17 @@ const proseTablesStyle = (0, _pikacss_core.defineStyleDefinition)({
307
307
 
308
308
  //#endregion
309
309
  //#region src/index.ts
310
- function typography(options = {}) {
310
+ function typography() {
311
+ let typographyConfig = {};
311
312
  return (0, _pikacss_core.defineEnginePlugin)({
312
313
  name: "typography",
314
+ configureRawConfig: (config) => {
315
+ if (config.typography) typographyConfig = config.typography;
316
+ },
313
317
  configureEngine: async (engine) => {
314
318
  engine.variables.add({
315
319
  ...typographyVariables,
316
- ...options.variables
320
+ ...typographyConfig.variables
317
321
  });
318
322
  engine.shortcuts.add(["prose-base", proseBaseStyle]);
319
323
  engine.shortcuts.add(["prose-paragraphs", ["prose-base", proseParagraphsStyle]]);
package/dist/index.d.cts CHANGED
@@ -34,6 +34,6 @@ declare module '@pikacss/core' {
34
34
  typography?: TypographyPluginOptions;
35
35
  }
36
36
  }
37
- declare function typography(options?: TypographyPluginOptions): EnginePlugin;
37
+ declare function typography(): EnginePlugin;
38
38
  //#endregion
39
39
  export { TypographyPluginOptions, typography };
package/dist/index.d.mts CHANGED
@@ -34,6 +34,6 @@ declare module '@pikacss/core' {
34
34
  typography?: TypographyPluginOptions;
35
35
  }
36
36
  }
37
- declare function typography(options?: TypographyPluginOptions): EnginePlugin;
37
+ declare function typography(): EnginePlugin;
38
38
  //#endregion
39
39
  export { TypographyPluginOptions, typography };
package/dist/index.mjs CHANGED
@@ -307,13 +307,17 @@ const proseTablesStyle = defineStyleDefinition({
307
307
 
308
308
  //#endregion
309
309
  //#region src/index.ts
310
- function typography(options = {}) {
310
+ function typography() {
311
+ let typographyConfig = {};
311
312
  return defineEnginePlugin({
312
313
  name: "typography",
314
+ configureRawConfig: (config) => {
315
+ if (config.typography) typographyConfig = config.typography;
316
+ },
313
317
  configureEngine: async (engine) => {
314
318
  engine.variables.add({
315
319
  ...typographyVariables,
316
- ...options.variables
320
+ ...typographyConfig.variables
317
321
  });
318
322
  engine.shortcuts.add(["prose-base", proseBaseStyle]);
319
323
  engine.shortcuts.add(["prose-paragraphs", ["prose-base", proseParagraphsStyle]]);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.0.38",
7
+ "version": "0.0.39",
8
8
  "author": "DevilTea <ch19980814@gmail.com>",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -39,10 +39,10 @@
39
39
  "dist"
40
40
  ],
41
41
  "peerDependencies": {
42
- "@pikacss/core": "0.0.38"
42
+ "@pikacss/core": "0.0.39"
43
43
  },
44
44
  "devDependencies": {
45
- "@pikacss/core": "0.0.38"
45
+ "@pikacss/core": "0.0.39"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "tsdown",