Skip to content

Allow specifying fonts as CSS variables #18

@dstaley

Description

@dstaley

(gonna PR this soon, but wanted to make an issue anyway)

It would be nice to have the ability to specify font as a CSS variable. When font is a CSS variable (beginning with the string var(), the Google Fonts fontImports string should not be added to the <style> tag, and the font value should be not be enclosed in quotes.

{ font: 'var(--font-family-body)' }
text { font-family: ${font.startsWith('var(') ? font : `'${font}'`}, system-ui, sans-serif; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions