discourse/lib/stylesheet
Martin Brennan 83cc97994f
FEATURE: Handle special font properties from discourse-fonts (#30891)
In https://github.com/discourse/discourse-fonts/pull/15 we are
introducing special font properties for certain fonts,
specifically the `font-variation-settings` and `font-feature-settings`.
For now this will only apply to Inter, but we may do it for other
fonts in future.

This commit makes it so the color_definitions.css file includes
these special properties for each font, either defined on the
root `html` element for the body font or on the `h1-h6` elements
for the heading font. This is done in this way because defining
them on `@font-face` is ignored by the browser.

This also ensures special CSS classes for the wizard container
e.g. wizard-container-font-FONTID are defined, this is so we can
use these special properties scoped to the font selected in the
wizard, which will affect the way the canvas preview is rendered.

Here is an example of before/after with special properties applied to
Inter,
in this case:

```css
font-variation-settings: 'opsz' 28;
font-feature-settings: 'calt' 0, 'ccmp' 0, 'ss02' 1;
```
2025-01-22 10:56:09 +10:00
..
manager SECURITY: Generate more category CSS on client 2024-03-15 14:24:11 +08:00
compiler.rb SECURITY: Generate more category CSS on client 2024-03-15 14:24:11 +08:00
importer.rb FEATURE: Handle special font properties from discourse-fonts (#30891) 2025-01-22 10:56:09 +10:00
manager.rb FIX: Invalidate stylesheet cache when discourse-fonts is bumped (#30869) 2025-01-20 12:25:28 +00:00
watcher.rb DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00