Skip to content

Commit

Permalink
feat(preset-mini): add arbitrary font-weight support (#2520)
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng committed Apr 20, 2023
1 parent aaa2051 commit 063f427
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/preset-mini/src/_rules/typography.ts
Expand Up @@ -66,7 +66,7 @@ export const fonts: Rule<Theme>[] = [
// weights
[
/^(?:font|fw)-?([^-]+)$/,
([, s]) => ({ 'font-weight': weightMap[s] || h.global.number(s) }),
([, s]) => ({ 'font-weight': weightMap[s] || h.bracket.global.number(s) }),
{ autocomplete: `(font|fw)-(100|200|300|400|500|600|700|800|900|${Object.keys(weightMap).join('|')})` },
],

Expand Down
1 change: 1 addition & 0 deletions test/assets/output/preset-mini-targets.css
Expand Up @@ -330,6 +330,7 @@ unocss .scope-\[unocss\]\:block{display:block;}
.text-size-unset{font-size:unset;}
.as-parent .group .group-\[\.as-parent_\&\]\:font-13{font-weight:13;}
.as-parent .group\/label .group-\[\.as-parent_\&\]\/label\:font-18{font-weight:18;}
.font-\[550\]{font-weight:550;}
.font-050,
.font-50,
.fw-050,
Expand Down
1 change: 1 addition & 0 deletions test/assets/preset-mini-targets.ts
Expand Up @@ -790,6 +790,7 @@ export const presetMiniTargets: string[] = [
// typography
'font-mono',
'font-[system-ui]',
'font-[550]',
'font-$font-name',
'text-4xl',
'text-base',
Expand Down

0 comments on commit 063f427

Please sign in to comment.