diff --git a/src/rules/border.ts b/src/rules/border.ts index 534b7f3..e10450a 100644 --- a/src/rules/border.ts +++ b/src/rules/border.ts @@ -2,7 +2,7 @@ import type { CSSEntries, CSSObject, Rule, RuleContext } from '@unocss/core' import type { Theme } from '../theme' import { colorOpacityToString, colorToString, cornerMap, directionMap, globalKeywords, handler as h, hasParseableColor, parseColor } from '../utils' -const borderStyles = ['solid', 'dashed', 'dotted', 'double', 'hidden', 'none', 'groove', 'ridge', 'inset', 'outset', ...globalKeywords] +export const borderStyles = ['solid', 'dashed', 'dotted', 'double', 'hidden', 'none', 'groove', 'ridge', 'inset', 'outset', ...globalKeywords] export const borders: Rule[] = [ // compound diff --git a/src/rules/typography.ts b/src/rules/typography.ts index c9372fe..a6f9cb0 100644 --- a/src/rules/typography.ts +++ b/src/rules/typography.ts @@ -63,11 +63,11 @@ export const fonts: Rule[] = [ ], // synthesis - [ - /^font-synthesis-(.+)$/, - ([, s]) => ({ 'font-synthesis': s }), - { autocomplete: 'font-synthesis-(none|weight|style|small-caps)' }, - ], + ['font-synthesis-weight', { 'font-synthesis': 'weight' }], + ['font-synthesis-style', { 'font-synthesis': 'style' }], + ['font-synthesis-small-caps', { 'font-synthesis': 'small-caps' }], + ['font-synthesis-none', { 'font-synthesis': 'none' }], + [/^font-synthesis-(.+)$/, ([, s]) => ({ 'font-synthesis': h.bracket.cssvar.global(s) })], // tracking [ diff --git a/test/__snapshots__/preset-mini.test.ts.snap b/test/__snapshots__/preset-mini.test.ts.snap index 16cbb74..34871bd 100644 --- a/test/__snapshots__/preset-mini.test.ts.snap +++ b/test/__snapshots__/preset-mini.test.ts.snap @@ -300,9 +300,11 @@ div:hover .group-\\\\[div\\\\:hover\\\\]-\\\\[combinator\\\\:test-4\\\\]{combina .lh-\\\\$variable{line-height:var(--variable);} .leading-inherit{line-height:inherit;} .lh-\\\\[1\\\\.5\\\\]{line-height:1.5;} -.font-synthesis-inherit{font-synthesis:inherit;} -.font-synthesis-small-caps{font-synthesis:small-caps;} .font-synthesis-weight{font-synthesis:weight;} +.font-synthesis-small-caps{font-synthesis:small-caps;} +.font-synthesis-\\\\[weight_style\\\\]{font-synthesis:weight style;} +.font-synthesis-\\\\$synth{font-synthesis:var(--synth);} +.font-synthesis-inherit{font-synthesis:inherit;} .font-tracking-1em{letter-spacing:1em;} .tracking-\\\\[2\\\\/5\\\\]{letter-spacing:2/5;} .tracking-\\\\$variable{letter-spacing:var(--variable);} diff --git a/test/__snapshots__/preset-weapp.test.ts.snap b/test/__snapshots__/preset-weapp.test.ts.snap index 4f5dcc2..d7e5271 100644 --- a/test/__snapshots__/preset-weapp.test.ts.snap +++ b/test/__snapshots__/preset-weapp.test.ts.snap @@ -393,8 +393,8 @@ exports[`preset-weapp > typography 1`] = ` .font-leading-2, .leading-2{line-height:16rpx;} .leading-inherit{line-height:inherit;} -.font-synthesis-small-caps{font-synthesis:small-caps;} .font-synthesis-weight{font-synthesis:weight;} +.font-synthesis-small-caps{font-synthesis:small-caps;} .font-tracking-1em{letter-spacing:1em;} .tracking-2{letter-spacing:16rpx;} .tracking-inherit{letter-spacing:inherit;} diff --git a/test/assets/preset-mini-targets.ts b/test/assets/preset-mini-targets.ts index 6b365ea..bdf24e9 100644 --- a/test/assets/preset-mini-targets.ts +++ b/test/assets/preset-mini-targets.ts @@ -721,6 +721,8 @@ export const presetMiniTargets: string[] = [ 'font-50', 'font-synthesis-weight', 'font-synthesis-small-caps', + 'font-synthesis-[weight_style]', + 'font-synthesis-$synth', 'font-synthesis-inherit', 'font-inherit', 'fw-900',