Skip to content

feat(ui): add shared ArtCraft dark role palette - #102

Open
pourie-he wants to merge 2 commits into
storytold:mainfrom
pourie-he:codex/shared-artcraft-dark-palette
Open

pourie-he wants to merge 2 commits into
storytold:mainfrom
pourie-he:codex/shared-artcraft-dark-palette

Conversation

@pourie-he

@pourie-he pourie-he commented Oct 14, 2026 •

Copy link
Copy Markdown

Standard dark interface colours are duplicated across Craft app token implementations. Add SuitePalette::ARTCRAFT_DARK with 21 immutable Color32 roles so Rust frontends can map their standard Dark preset to one shared source. Apps retain local themes, preferences, extra tokens, accents and overrides; the existing WidgetPalette operation 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 strict craft-ui Clippy for all targets passed. Strict workspace Clippy stops on an unchanged chunks_exact_to_as_chunks warning in crates/cms/tests/fogra39.rs:549 under 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.

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 aiongg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread crates/ui/src/theme/mod.rs Outdated
Comment on lines +9 to +17
/// 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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 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 {

Comment thread crates/ui/src/theme/mod.rs Outdated
Comment on lines +41 to +43
impl SuiteDarkPalette {
/// The canonical ArtCraft standard-dark role palette.
pub const ARTCRAFT: Self = Self {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
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 {

Comment thread crates/ui/src/theme/mod.rs Outdated

#[test]
fn artcraft_roles_match_the_dark_theme_contract() {
let palette = SuiteDarkPalette::ARTCRAFT;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
let palette = SuiteDarkPalette::ARTCRAFT;
let palette = SuitePalette::ARTCRAFT_DARK;

Comment thread crates/ui/src/theme/mod.rs Outdated

#[test]
fn artcraft_intended_foregrounds_have_readable_contrast() {
let palette = SuiteDarkPalette::ARTCRAFT;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
let palette = SuiteDarkPalette::ARTCRAFT;
let palette = SuitePalette::ARTCRAFT_DARK;

Comment thread docs/theme-infrastructure.md Outdated
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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
The additive `SuiteDarkPalette::ARTCRAFT` now supplies canonical standard-dark interface roles;
The additive `SuitePalette::ARTCRAFT_DARK` now supplies canonical standard-dark interface roles;

Comment thread docs/theme-infrastructure.md Outdated
Comment on lines 82 to 83
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
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

Comment thread docs/theme-infrastructure.md Outdated

## Canonical ArtCraft standard dark roles

`craft_ui::theme::SuiteDarkPalette::ARTCRAFT` is the shared source of truth for the 21 role

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
`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

@aiongg

aiongg commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

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 FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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.

3 participants