@unocss/preset-typography 0.33.0 → 0.33.4

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
@@ -12,8 +12,7 @@ pnpm add @unocss/preset-typography -D
12
12
 
13
13
  ```js
14
14
  // unocss.config.js
15
- import { defineConfig, presetAttributify, presetUno } from 'unocss'
16
- import { presetTypography } from '@unocss/preset-typography'
15
+ import { defineConfig, presetAttributify, presetTypography, presetUno } from 'unocss'
17
16
 
18
17
  export default defineConfig({
19
18
  presets: [
package/dist/index.cjs CHANGED
@@ -189,8 +189,8 @@ function getCSS(selectorProse, className, preflights) {
189
189
  return css;
190
190
  }
191
191
  function getPreflights(selectorProse, className, cssExtend) {
192
- if (!selectorProse.startsWith("["))
193
- selectorProse = `.${selectorProse}`;
192
+ if (!selectorProse.startsWith("."))
193
+ selectorProse = `:is(${selectorProse},.${className})`;
194
194
  if (cssExtend)
195
195
  return getCSS(selectorProse, className, core.mergeDeep(DEFAULT, cssExtend));
196
196
  return getCSS(selectorProse, className, DEFAULT);
@@ -213,7 +213,7 @@ function presetTypography(options) {
213
213
  classNameRE,
214
214
  (_, { rawSelector }) => {
215
215
  hasProseClass = true;
216
- selectorProse = rawSelector;
216
+ selectorProse = core.toEscapedSelector(rawSelector);
217
217
  return { "color": "var(--un-prose-body)", "max-width": "65ch" };
218
218
  },
219
219
  { layer: "typography" }
package/dist/index.d.ts CHANGED
@@ -26,8 +26,7 @@ interface TypographyOptions {
26
26
  *
27
27
  * ```js
28
28
  * // unocss.config.js
29
- * import { presetAttributify, presetUno, defineConfig } from 'unocss'
30
- * import { presetTypography } from '@unocss/preset-typography'
29
+ * import { presetAttributify, presetUno, defineConfig, presetTypography } from 'unocss'
31
30
  *
32
31
  * export default defineConfig({
33
32
  * presets: [
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { mergeDeep } from '@unocss/core';
1
+ import { mergeDeep, toEscapedSelector } from '@unocss/core';
2
2
 
3
3
  const DEFAULT = {
4
4
  "h1,h2,h3,h4,h5,h6": {
@@ -185,8 +185,8 @@ function getCSS(selectorProse, className, preflights) {
185
185
  return css;
186
186
  }
187
187
  function getPreflights(selectorProse, className, cssExtend) {
188
- if (!selectorProse.startsWith("["))
189
- selectorProse = `.${selectorProse}`;
188
+ if (!selectorProse.startsWith("."))
189
+ selectorProse = `:is(${selectorProse},.${className})`;
190
190
  if (cssExtend)
191
191
  return getCSS(selectorProse, className, mergeDeep(DEFAULT, cssExtend));
192
192
  return getCSS(selectorProse, className, DEFAULT);
@@ -209,7 +209,7 @@ function presetTypography(options) {
209
209
  classNameRE,
210
210
  (_, { rawSelector }) => {
211
211
  hasProseClass = true;
212
- selectorProse = rawSelector;
212
+ selectorProse = toEscapedSelector(rawSelector);
213
213
  return { "color": "var(--un-prose-body)", "max-width": "65ch" };
214
214
  },
215
215
  { layer: "typography" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-typography",
3
- "version": "0.33.0",
3
+ "version": "0.33.4",
4
4
  "description": "Typography preset for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -32,7 +32,7 @@
32
32
  ],
33
33
  "sideEffects": false,
34
34
  "dependencies": {
35
- "@unocss/core": "0.33.0"
35
+ "@unocss/core": "0.33.4"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "unbuild",