Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/home/light_themed_dock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ script_mod! {
draw_bg +: {
// Unselected tabs: subtle neutral surface. Selected tab: teal accent
// (RBX_ACCENT) — the unified UI selection color, replacing the legacy
// bright blue COLOR_ACTIVE_PRIMARY.
// COLOR_ACTIVE_PRIMARY (the accent teal).
color: (RBX_BG_SURFACE_SUBTLE)
color_hover: (RBX_BG_HOVER)
color_active: (RBX_ACCENT)
Expand Down
16 changes: 9 additions & 7 deletions src/shared/design_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
//! - `RBX_FOCUS_*` keyboard-nav focus ring
//! - `RBX_TEXT_*` type-scale `TextStyle` presets
//!
//! ## Primary color migration
//! The legacy primary is the bright blue `COLOR_ACTIVE_PRIMARY` (#0F88FE) in
//! `styles.rs`, used across ~80 existing call sites. The new visual language uses
//! the teal `RBX_ACCENT` (#119FB3) as the single primary/CTA/focus color. New UI
//! MUST use `RBX_ACCENT`; legacy blue is deprecated and migrated per surface as
//! §5 refactors land (see spec §3 "Primary 迁移"). `RBX_LEGACY_BLUE` names the old
//! value only so migrations can reference it explicitly.
//! ## Primary color migration — done
//! The teal `RBX_ACCENT` (#119FB3) is the single primary/CTA/focus color, and
//! `COLOR_ACTIVE_PRIMARY` in `styles.rs` now resolves to it, so the ~40 remaining
//! call sites moved together rather than a screen at a time — every one of them
//! means "primary", "active" or "focus", and staging them would only have grown
//! the stretch where blue and teal sat side by side. New UI should still name
//! `RBX_ACCENT` directly; `COLOR_ACTIVE_PRIMARY` survives as a compatibility
//! alias for the call sites that have not been renamed yet.
//! `RBX_LEGACY_BLUE` records the retired #0F88FE and now has no users.
//!
//! Tokens are registered into the global `mod.widgets.*` namespace (so any other
//! `script_mod!` block can read them via `(RBX_TOKEN)` after `use mod.widgets.*`).
Expand Down
2 changes: 1 addition & 1 deletion src/shared/icon_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ script_mod! {
use mod.widgets.*

// The base Robrix button widget.
// Uses COLOR_ACTIVE_PRIMARY (blue) background with white text by default.
// Uses COLOR_ACTIVE_PRIMARY (the accent teal) background with white text by default.
// See also the preset variants below:
// RobrixPositiveIconButton, RobrixNegativeIconButton, RobrixNeutralIconButton.
mod.widgets.RobrixIconButton = Button {
Expand Down
28 changes: 21 additions & 7 deletions src/shared/styles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ script_mod! {
mod.widgets.COLOR_BG_DANGER_RED = #FFF0F0
mod.widgets.COLOR_FG_DISABLED = #B3B3B3
mod.widgets.COLOR_BG_DISABLED = #E0E0E0
mod.widgets.COLOR_INFO_BLUE = #0f88fe
// Informational accent — it only ever shared a value with the retired legacy
// primary. Now the system's own info blue (literal mirroring RBX_INFO_FG;
// see the registration-order note further down), so it stays blue while the
// primary moves to teal.
mod.widgets.COLOR_INFO_BLUE = #1E6FBF
mod.widgets.COLOR_WARNING_YELLOW = #fcdb03
mod.widgets.COLOR_TEXT_WARNING_NOT_FOUND = #953800

Expand All @@ -222,9 +226,18 @@ script_mod! {
mod.widgets.COLOR_SECONDARY = #E3E3E3
mod.widgets.COLOR_SECONDARY_DARKER = #C8C8C8

mod.widgets.COLOR_ACTIVE_PRIMARY = #0f88fe
// The primary/CTA/focus colour. Was the legacy bright blue `#0f88fe`; now the
// accent teal, completing the migration design_tokens.rs describes. Every one
// of the ~40 call sites means "primary", "active" or "focus", which is
// exactly what the accent is defined to be, so they all move together —
// migrating a screen at a time would have left blue and teal side by side for
// as long as the migration ran.
// Literals mirroring RBX_ACCENT / RBX_ACCENT_HOVER: this file is registered
// before design_tokens.rs, so `RBX_*` is not resolvable here (see the note on
// COLOR_PRIMARY_DARKER above).
mod.widgets.COLOR_ACTIVE_PRIMARY = #119FB3

mod.widgets.COLOR_ACTIVE_PRIMARY_DARKER = #106fcc
mod.widgets.COLOR_ACTIVE_PRIMARY_DARKER = #0E8C9E

mod.widgets.COLOR_BG_PREVIEW = #F0F5FF

Expand Down Expand Up @@ -391,10 +404,11 @@ script_mod! {

/// #FFFFFF
pub const COLOR_PRIMARY: Vec4 = vec4(1.0, 1.0, 1.0, 1.0);
/// #0F88FE
pub const COLOR_ACTIVE_PRIMARY: Vec4 = vec4(0.059, 0.533, 0.996, 1.0);
/// #106FCC
pub const COLOR_ACTIVE_PRIMARY_DARKER: Vec4 = vec4(0.063, 0.435, 0.682, 1.0);
/// The primary/CTA/focus colour, now the accent teal (was the legacy `#0F88FE`).
/// The Rust side has no registration-order constraint, so it names the tokens
/// directly and stays tied to the DSL literals above by construction.
pub const COLOR_ACTIVE_PRIMARY: Vec4 = crate::shared::design_tokens::RBX_ACCENT;
pub const COLOR_ACTIVE_PRIMARY_DARKER: Vec4 = crate::shared::design_tokens::RBX_ACCENT_HOVER;
/// #138808
pub const COLOR_FG_ACCEPT_GREEN: Vec4 = vec4(0.074, 0.533, 0.031, 1.0);
/// #F0FFF0
Expand Down
Loading