Skip to content

Feature: brand-mode to choose light or dark brand in Typst#12387

Merged
gordonwoodhull merged 2 commits intomainfrom
feature/typst-choose-brand
Apr 1, 2025
Merged

Feature: brand-mode to choose light or dark brand in Typst#12387
gordonwoodhull merged 2 commits intomainfrom
feature/typst-choose-brand

Conversation

@gordonwoodhull
Copy link
Copy Markdown
Member

@gordonwoodhull gordonwoodhull commented Mar 26, 2025

As promised, this turned out to be quite simple once everything else was in place.

Filing as draft because

  • this needs a better name than choose-brand
  • some lingering cases in typst_css.lua where it needs access to choose-brand instead of hard-coded brandMode = 'light'
  • needs tests

Cases like

:::{style="background-color: var(--brand-dark-grey); color: var(--brand-blue)"}
This div is blue on dark grey.
:::

@gordonwoodhull gordonwoodhull force-pushed the feature/typst-choose-brand branch from 07f0173 to 90cc79f Compare March 26, 2025 20:39
Copy link
Copy Markdown
Member

@cscheid cscheid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM aside from the schema name.

Comment thread src/resources/schema/document-layout.yml Outdated
@gordonwoodhull gordonwoodhull changed the title Feature: choose light or dark brand in Typst Feature: brand-mode to choose light or dark brand in Typst Mar 27, 2025
@gordonwoodhull gordonwoodhull added this to the v1.7 milestone Mar 27, 2025
@gordonwoodhull gordonwoodhull force-pushed the feature/typst-choose-brand branch from 90cc79f to 0b6c052 Compare March 31, 2025 16:35
@gordonwoodhull gordonwoodhull marked this pull request as ready for review March 31, 2025 16:36
@gordonwoodhull gordonwoodhull force-pushed the feature/typst-choose-brand branch from 0b6c052 to df01c7f Compare April 1, 2025 02:54
@gordonwoodhull gordonwoodhull dismissed cscheid’s stale review April 1, 2025 02:56

Renamed to brand-mode

@gordonwoodhull
Copy link
Copy Markdown
Member Author

gordonwoodhull commented Apr 1, 2025

Note: this doesn't consider author preference, i.e. if dark is put before light in brand or theme, brand-mode will still default to light.

Since we are moving away from author preference online #12426, this seems less urgent. But it could in theory be initialized from TS in the Quarto front-end. Order of YAML objects is unavailable in Lua metadata! 😮

@gordonwoodhull gordonwoodhull merged commit bc45896 into main Apr 1, 2025
49 checks passed
@gordonwoodhull gordonwoodhull deleted the feature/typst-choose-brand branch April 1, 2025 20:33
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

Successfully merging this pull request may close these issues.

2 participants