Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(preset-typography): inherit mono font from theme (#1000)
* feat: Replace hardcoded `font-family` with CSS var

* chore(typography): Update snapshot for code font family
  • Loading branch information
equt committed May 23, 2022
1 parent 69dcee2 commit 49a20e5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 2 additions & 0 deletions packages/preset-typography/src/index.ts
Expand Up @@ -105,6 +105,8 @@ export function presetTypography(options?: TypographyOptions): Preset {
'--un-prose-invert-code': colorObject[100] ?? baseColor,
'--un-prose-invert-borders': colorObject[700] ?? baseColor,
'--un-prose-invert-bg-soft': colorObject[800] ?? baseColor,

'--un-prose-font-mono': theme.fontFamily?.mono,
}
},
{ layer: 'typography' },
Expand Down
3 changes: 1 addition & 2 deletions packages/preset-typography/src/preflights/default.ts
Expand Up @@ -54,8 +54,7 @@ export const DEFAULT = {
'color': 'var(--un-prose-code)',
'font-size': '.875em',
'font-weight': 600,
'font-family':
'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation-Mono,Courier-New,monospace',
'font-family': 'var(--un-prose-font-mono)',
},
':not(pre) > code::before,:not(pre) > code::after': {
content: '"`"',
Expand Down

0 comments on commit 49a20e5

Please sign in to comment.