@pikacss/plugin-typography 0.0.46 → 0.0.47
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/dist/index.mjs +42 -45
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -307,6 +307,47 @@ const proseTablesStyle = defineStyleDefinition({
|
|
|
307
307
|
|
|
308
308
|
//#endregion
|
|
309
309
|
//#region src/index.ts
|
|
310
|
+
const proseShortcutModules = [
|
|
311
|
+
["prose-paragraphs", proseParagraphsStyle],
|
|
312
|
+
["prose-links", proseLinksStyle],
|
|
313
|
+
["prose-emphasis", proseEmphasisStyle],
|
|
314
|
+
["prose-kbd", proseKbdStyle],
|
|
315
|
+
["prose-lists", proseListsStyle],
|
|
316
|
+
["prose-hr", proseHrStyle],
|
|
317
|
+
["prose-headings", proseHeadingsStyle],
|
|
318
|
+
["prose-quotes", proseQuotesStyle],
|
|
319
|
+
["prose-media", proseMediaStyle],
|
|
320
|
+
["prose-code", proseCodeStyle],
|
|
321
|
+
["prose-tables", proseTablesStyle]
|
|
322
|
+
];
|
|
323
|
+
const proseSizeVariants = {
|
|
324
|
+
"sm": {
|
|
325
|
+
fontSize: "0.875rem",
|
|
326
|
+
lineHeight: "1.71"
|
|
327
|
+
},
|
|
328
|
+
"lg": {
|
|
329
|
+
fontSize: "1.125rem",
|
|
330
|
+
lineHeight: "1.77"
|
|
331
|
+
},
|
|
332
|
+
"xl": {
|
|
333
|
+
fontSize: "1.25rem",
|
|
334
|
+
lineHeight: "1.8"
|
|
335
|
+
},
|
|
336
|
+
"2xl": {
|
|
337
|
+
fontSize: "1.5rem",
|
|
338
|
+
lineHeight: "1.66"
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
function registerTypographyShortcuts(engine) {
|
|
342
|
+
engine.shortcuts.add(["prose-base", proseBaseStyle]);
|
|
343
|
+
proseShortcutModules.forEach(([name, style]) => {
|
|
344
|
+
engine.shortcuts.add([name, ["prose-base", style]]);
|
|
345
|
+
});
|
|
346
|
+
engine.shortcuts.add(["prose", proseShortcutModules.map(([name]) => name)]);
|
|
347
|
+
Object.entries(proseSizeVariants).forEach(([size, overrides]) => {
|
|
348
|
+
engine.shortcuts.add([`prose-${size}`, ["prose", overrides]]);
|
|
349
|
+
});
|
|
350
|
+
}
|
|
310
351
|
function typography() {
|
|
311
352
|
let typographyConfig = {};
|
|
312
353
|
return defineEnginePlugin({
|
|
@@ -319,51 +360,7 @@ function typography() {
|
|
|
319
360
|
...typographyVariables,
|
|
320
361
|
...typographyConfig.variables
|
|
321
362
|
});
|
|
322
|
-
engine
|
|
323
|
-
engine.shortcuts.add(["prose-paragraphs", ["prose-base", proseParagraphsStyle]]);
|
|
324
|
-
engine.shortcuts.add(["prose-links", ["prose-base", proseLinksStyle]]);
|
|
325
|
-
engine.shortcuts.add(["prose-emphasis", ["prose-base", proseEmphasisStyle]]);
|
|
326
|
-
engine.shortcuts.add(["prose-kbd", ["prose-base", proseKbdStyle]]);
|
|
327
|
-
engine.shortcuts.add(["prose-lists", ["prose-base", proseListsStyle]]);
|
|
328
|
-
engine.shortcuts.add(["prose-hr", ["prose-base", proseHrStyle]]);
|
|
329
|
-
engine.shortcuts.add(["prose-headings", ["prose-base", proseHeadingsStyle]]);
|
|
330
|
-
engine.shortcuts.add(["prose-quotes", ["prose-base", proseQuotesStyle]]);
|
|
331
|
-
engine.shortcuts.add(["prose-media", ["prose-base", proseMediaStyle]]);
|
|
332
|
-
engine.shortcuts.add(["prose-code", ["prose-base", proseCodeStyle]]);
|
|
333
|
-
engine.shortcuts.add(["prose-tables", ["prose-base", proseTablesStyle]]);
|
|
334
|
-
engine.shortcuts.add(["prose", [
|
|
335
|
-
"prose-paragraphs",
|
|
336
|
-
"prose-links",
|
|
337
|
-
"prose-emphasis",
|
|
338
|
-
"prose-kbd",
|
|
339
|
-
"prose-lists",
|
|
340
|
-
"prose-hr",
|
|
341
|
-
"prose-headings",
|
|
342
|
-
"prose-quotes",
|
|
343
|
-
"prose-media",
|
|
344
|
-
"prose-code",
|
|
345
|
-
"prose-tables"
|
|
346
|
-
]]);
|
|
347
|
-
Object.entries({
|
|
348
|
-
"sm": {
|
|
349
|
-
fontSize: "0.875rem",
|
|
350
|
-
lineHeight: "1.71"
|
|
351
|
-
},
|
|
352
|
-
"lg": {
|
|
353
|
-
fontSize: "1.125rem",
|
|
354
|
-
lineHeight: "1.77"
|
|
355
|
-
},
|
|
356
|
-
"xl": {
|
|
357
|
-
fontSize: "1.25rem",
|
|
358
|
-
lineHeight: "1.8"
|
|
359
|
-
},
|
|
360
|
-
"2xl": {
|
|
361
|
-
fontSize: "1.5rem",
|
|
362
|
-
lineHeight: "1.66"
|
|
363
|
-
}
|
|
364
|
-
}).forEach(([size, overrides]) => {
|
|
365
|
-
engine.shortcuts.add([`prose-${size}`, ["prose", overrides]]);
|
|
366
|
-
});
|
|
363
|
+
registerTypographyShortcuts(engine);
|
|
367
364
|
}
|
|
368
365
|
});
|
|
369
366
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.47",
|
|
8
8
|
"author": "DevilTea <ch19980814@gmail.com>",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@pikacss/core": "0.0.
|
|
37
|
+
"@pikacss/core": "0.0.47"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@pikacss/core": "0.0.
|
|
40
|
+
"@pikacss/core": "0.0.47"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsdown",
|