Hacker News new | past | comments | ask | show | jobs | submit login

I was informed that the color palette can be changed with `override-colors` css rule, but havent had time to update the blog post yet.



I tried it (via Firefox DevTools) on your example page by inserting a @font-palette-values rule alongside the @font-face that loads the font:

    @font-palette-values --mycolors {
      font-family: Monaspace;
      base-palette: 0;
      override-colors: 0 red, 1 green, 2 blue,
                       3 magenta, 4 cyan, 5 yellow;
    }
(I just picked some arbitrary colors as a proof-of-concept; they don't actually look good.) Then adding the property:

    font-palette: --mycolors;
to the textarea element causes it to use these colors instead of the defaults in the font.


Maybe this could also be implemented using variable fonts[0]. This would probably make it easier to configure in non-browser environments (once this is better supported by font selectors etc).

[0]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_fonts/V...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: