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

Query font features #4156

Open
scottkellum opened this issue Jul 29, 2019 · 0 comments
Open

Query font features #4156

scottkellum opened this issue Jul 29, 2019 · 0 comments

Comments

@scottkellum
Copy link

Query font features in CSS on a particular element. Possibly similar to Adobe’s Web Font Loader but focus on features rather than a specific font. Also because the font might change on various elements, this may need to either be limited to the :root font or work similar to an element query. This may also be similar to the @supports syntax but regarding what the font supports rather than the browser.

sup {
  @font-supports (font-variant-position: sup) {
    font-variant-position: sup;
  }
  @font-supports not (font-variant-position: sup) {
    font-size: 0.6em;
    vertical-align: super;
  }
}

This may also be used for variable font axis:

strong {
  @font-supports (font-variation-settings: 'wght' 632) {
    font-variation-settings: 'wght' 632;
  }
  @font-supports not (font-variation-settings: 'wght' 632) {
    font-weight: bold;
  }
}

This is slightly related to #520 Supported variation font axes and font features are not discoverable

From a CSSRemedy discussion on sub & sup.

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

No branches or pull requests

2 participants