Repository navigation
Conversation
Expose the 21 approved standard-dark interface colors as additive craft-ui data. Keep app preferences, widget styling, alternate themes, and document colors local. Document adapter boundaries and verify values, contrast, and existing widget behavior.
aiongg
left a comment
There was a problem hiding this comment.
This goes against the original direction in docs/theme-infrastructure.md, which keeps complete palettes in the apps. We agree with the change: a shared palette for the basic colors every app uses, with apps still free to add their own tokens, accents and overrides. Since most of the UI is being unified, one palette fits better than each app defining the whole scheme with small differences, and it gives ArtCraft the same look. Creative and office apps may need different schemes; that's still open. Whether craft-libs takes this direction is up to the maintainers.
The suggestions rename the type to SuitePalette with ARTCRAFT_DARK, so a light scheme, a scheme per app group or an app's own scheme is another constant of the same type, and an app can override single roles with ..SuitePalette::ARTCRAFT_DARK. One also states the changed position in the doc.
Could the doc link the "ArtCraft dark theme contract (14 October 2026)"? artcraft-native's theme.rs uses translucent hairlines and washes where this has solid colors.
| /// Canonical ArtCraft colors for standard dark interface roles. | ||
| /// | ||
| /// The values follow the ArtCraft dark theme contract (14 October 2026). Applications map | ||
| /// these roles into local tokens; this data does not apply a theme or select a preference. | ||
| /// Alternate themes, semantic colors and document/canvas pixels remain application-owned. | ||
| /// `on_accent` is the foreground for blue filled controls; `selection_text` is the foreground | ||
| /// for selected interface rows. `primary`/`on_primary` support inverted primary buttons. | ||
| #[derive(Clone, Copy, Debug, PartialEq, Eq)] | ||
| pub struct SuiteDarkPalette { |
There was a problem hiding this comment.
| /// Canonical ArtCraft colors for standard dark interface roles. | |
| /// | |
| /// The values follow the ArtCraft dark theme contract (14 October 2026). Applications map | |
| /// these roles into local tokens; this data does not apply a theme or select a preference. | |
| /// Alternate themes, semantic colors and document/canvas pixels remain application-owned. | |
| /// `on_accent` is the foreground for blue filled controls; `selection_text` is the foreground | |
| /// for selected interface rows. `primary`/`on_primary` support inverted primary buttons. | |
| #[derive(Clone, Copy, Debug, PartialEq, Eq)] | |
| pub struct SuiteDarkPalette { | |
| /// Interface role colors shared by the Craft apps, one constant per scheme. | |
| /// | |
| /// `ARTCRAFT_DARK` follows the ArtCraft dark theme contract (14 October 2026). Applications map | |
| /// these roles into local tokens; this data does not apply a theme or select a preference. | |
| /// An app can define its own scheme, or override single roles with | |
| /// `SuitePalette { accent, ..SuitePalette::ARTCRAFT_DARK }`. | |
| /// Alternate themes, semantic colors and document/canvas pixels remain application-owned. | |
| /// `on_accent` is the foreground for blue filled controls; `selection_text` is the foreground | |
| /// for selected interface rows. `primary`/`on_primary` support inverted primary buttons. | |
| #[derive(Clone, Copy, Debug, PartialEq, Eq)] | |
| pub struct SuitePalette { |
| impl SuiteDarkPalette { | ||
| /// The canonical ArtCraft standard-dark role palette. | ||
| pub const ARTCRAFT: Self = Self { |
There was a problem hiding this comment.
| impl SuiteDarkPalette { | |
| /// The canonical ArtCraft standard-dark role palette. | |
| pub const ARTCRAFT: Self = Self { | |
| impl SuitePalette { | |
| /// The ArtCraft standard-dark scheme. | |
| pub const ARTCRAFT_DARK: Self = Self { |
|
|
||
| #[test] | ||
| fn artcraft_roles_match_the_dark_theme_contract() { | ||
| let palette = SuiteDarkPalette::ARTCRAFT; |
There was a problem hiding this comment.
| let palette = SuiteDarkPalette::ARTCRAFT; | |
| let palette = SuitePalette::ARTCRAFT_DARK; |
|
|
||
| #[test] | ||
| fn artcraft_intended_foregrounds_have_readable_contrast() { | ||
| let palette = SuiteDarkPalette::ARTCRAFT; |
There was a problem hiding this comment.
| let palette = SuiteDarkPalette::ARTCRAFT; | |
| let palette = SuitePalette::ARTCRAFT_DARK; |
| LightCraft use the same operation. Their complete palettes, theme choices, fonts and preferences | ||
| remain in their frontends. | ||
| LightCraft use the same operation. Theme choices, fonts, preferences and application-specific palettes remain in their frontends. | ||
| The additive `SuiteDarkPalette::ARTCRAFT` now supplies canonical standard-dark interface roles; |
There was a problem hiding this comment.
| The additive `SuiteDarkPalette::ARTCRAFT` now supplies canonical standard-dark interface roles; | |
| The additive `SuitePalette::ARTCRAFT_DARK` now supplies canonical standard-dark interface roles; |
| and belongs beside the controls it styles. A universal application token structure, theme enum, application | ||
| identifier or global context key is unnecessary. Constructing another large visual-options |
There was a problem hiding this comment.
| and belongs beside the controls it styles. A universal application token structure, theme enum, application | |
| identifier or global context key is unnecessary. Constructing another large visual-options | |
| and belongs beside the controls it styles. Shared role colors live in `SuitePalette`, because one | |
| palette keeps the apps consistent; a theme enum, application identifier or global context key is | |
| unnecessary. Constructing another large visual-options |
|
|
||
| ## Canonical ArtCraft standard dark roles | ||
|
|
||
| `craft_ui::theme::SuiteDarkPalette::ARTCRAFT` is the shared source of truth for the 21 role |
There was a problem hiding this comment.
| `craft_ui::theme::SuiteDarkPalette::ARTCRAFT` is the shared source of truth for the 21 role | |
| `craft_ui::theme::SuitePalette::ARTCRAFT_DARK` is the shared source of truth for the 21 role |
|
The suite theme ArtCraft (craft-libs#397) is based on PhotoCraft's palette, and defaults move to it through the suite selection, so the per-app 'Unify dark chrome' PRs aren't needed for that. |
FredApps
left a comment
There was a problem hiding this comment.
Source read in full (theme/mod.rs, both docs): SuitePalette::ARTCRAFT_DARK is plain Copy data, the 21 constants match the contract table, the contrast tests hold when I recompute them by hand, and WidgetPalette is untouched. No code defects found.
The PR is CONFLICTING with main at 8134693, so it cannot merge as is. Please rebase. Note too the earlier comment that the suite theme (craft-libs#397) now carries the ArtCraft palette; if that makes this constant redundant, say so or close this PR. I am not approving until it is rebased and the fork CI can run on the result.
Standard dark interface colours are duplicated across Craft app token implementations. Add
SuitePalette::ARTCRAFT_DARKwith 21 immutableColor32roles so Rust frontends can map their standard Dark preset to one shared source. Apps retain local themes, preferences, extra tokens, accents and overrides; the existingWidgetPaletteoperation is unchanged. Other schemes can be constants of the same type.The dark-theme contract records every role and explains the intentional opaque choices relative to ArtCraft’s translucent hairlines and washes. The infrastructure doc now explicitly describes the revised sharing boundary. ArtCraft’s CSS frontend keeps a parity-checked adapter.
Validation on the complete checkout:
cargo fmt --check,cargo test --workspace --locked(273 passed, 2 ignored), and strictcraft-uiClippy for all targets passed. Strict workspace Clippy stops on an unchangedchunks_exact_to_as_chunkswarning incrates/cms/tests/fogra39.rs:549under Rust 1.99; that file and Cargo.lock are unchanged by this PR. Independent review confirmed the API rename changes no colour values or runtime behaviour. Consumer adapters are separate PRs and must use a reviewed commit on craft-libs main before merging.