Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional based on font-variation-settings #231

Open
jayliu50 opened this issue Sep 22, 2019 · 0 comments
Open

Conditional based on font-variation-settings #231

jayliu50 opened this issue Sep 22, 2019 · 0 comments

Comments

@jayliu50
Copy link

Hi,

I'm still trying to wrap my head around some basic concepts, so apologies if this is too basic of a question...

I'm trying to conditionally support a variable font. I want the following to apply to all elements:

* {
      font-family: Work Sans, sans-serif;
      @supports (font-variation-settings: normal) {
        fontFamily: Work Sans Variable, sans-serif;
      }
}

I'm trying to do the following but it doesn't work:

const theme = Typography({
  overrideStyles: ({ adjustFontSizeTo, rhythm }, options, styles) => ({
    "*": {
      fontFamily: ["Work Sans", "Trebuchet MS", "sans-serif"].join(","),

      "@supports (font-variation-settings: normal)": {
        fontFamily: ["Work Sans Variable", "Trebuchet MS", "sans-serif"].join(
          ","
        ),
      },
    },
  }),
})

Any advice on how to best implement this concept using typography.js?

Thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant