pub struct LayoutTheme {Show 19 fields
pub spacing: Pixels,
pub radius: Pixels,
pub field_radius: Pixels,
pub border_width: Pixels,
pub field_border_width: Pixels,
pub disabled_opacity: f32,
pub ring_offset_width: Pixels,
pub surface_shadow: Vec<BoxShadow>,
pub overlay_shadow: Vec<BoxShadow>,
pub field_shadow: Vec<BoxShadow>,
pub skeleton_animation: SkeletonAnimation,
pub tooltip_delay_ms: u64,
pub tooltip_close_delay_ms: u64,
pub overlay_hairline: Option<Hsla>,
pub cursor_interactive: CursorStyle,
pub tabs_hover_opacity: f32,
pub tooltip_cooldown_ms: u64,
pub long_press_ms: u64,
pub hover_fade_ms: u64,
}Expand description
Spacing, radius, border and shadow tokens shared by all components.
Fields§
§spacing: Pixels--spacing: 0.25rem
radius: Pixels--radius: 0.5rem — the base every other radius is calculated from.
field_radius: Pixels--field-radius: calc(var(--radius) * 1.5)
border_width: Pixels--border-width: 1px
field_border_width: Pixels--field-border-width: 0px
disabled_opacity: f32--disabled-opacity: 0.5
ring_offset_width: Pixels--ring-offset-width: 2px
surface_shadow: Vec<BoxShadow>--surface-shadow — cards, accordions and other inline containers.
overlay_shadow: Vec<BoxShadow>--overlay-shadow — tooltips, popovers, modals and menus.
field_shadow: Vec<BoxShadow>--field-shadow — inputs and other form controls.
skeleton_animation: SkeletonAnimation--skeleton-animation
tooltip_delay_ms: u64--tooltip-delay: 1500ms
tooltip_close_delay_ms: u64--tooltip-close-delay: 500ms
overlay_hairline: Option<Hsla>The hairline a floating panel draws instead of a border.
v3 gives its panels no border at all: light mode separates them with
--overlay-shadow, and dark mode adds 0 0 1px 0 rgba(255,255,255,.3) **inset** – a one-pixel highlight just inside the edge. gpui has no
inset shadow, so the closest reproduction is a one-pixel border in that
colour, and in light mode there is none.
cursor_interactive: CursorStyleThe cursor an interactive control shows while the pointer is over it.
v3 gives every clickable control cursor: pointer, so the default is
gpui::CursorStyle::PointingHand — the variant GPUI’s own
Styled::cursor_pointer() sets, which keeps stock rendering identical.
A theme that wants the platform arrow everywhere sets
gpui::CursorStyle::Arrow once here instead of restyling components.
tabs_hover_opacity: f32The opacity a hovered Tabs item drops to.
v3 hardcodes opacity: 0.7 on an unselected .tabs__tab:hover; this
port names it so a theme can soften or disable the dim. Not a v3 CSS
variable, and not consumed by Link: its root hover draws an underline.
tooltip_cooldown_ms: u64The warm window after the pointer leaves a tooltip during which the next tip opens without its delay.
The cooldown starts when the tooltip is dismissed (hover exit) and
lasts max(this, close_delay), so a per-tooltip close delay extends
the window. React Aria uses the same 500 ms.
long_press_ms: u64How long a DropdownTrigger::LongPress waits before it opens.
React Aria uses 500 ms.
hover_fade_ms: u64The background fade duration anim::hover_fade eases between two
colors. The default is the button’s own 100ms (anim::TRANSITION_MS);
zero resolves immediately, like reduced motion.
Implementations§
Source§impl LayoutTheme
impl LayoutTheme
pub fn light() -> Self
pub fn dark() -> Self
Sourcepub fn radius_2xl(&self) -> Pixels
pub fn radius_2xl(&self) -> Pixels
--radius-2xl: calc(var(--radius) * 2)
Sourcepub fn radius_3xl(&self) -> Pixels
pub fn radius_3xl(&self) -> Pixels
--radius-3xl: calc(var(--radius) * 3)
Sourcepub fn radius_4xl(&self) -> Pixels
pub fn radius_4xl(&self) -> Pixels
--radius-4xl: calc(var(--radius) * 4)
Trait Implementations§
Source§impl Clone for LayoutTheme
impl Clone for LayoutTheme
Source§fn clone(&self) -> LayoutTheme
fn clone(&self) -> LayoutTheme
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayoutTheme
impl Debug for LayoutTheme
Auto Trait Implementations§
impl Freeze for LayoutTheme
impl RefUnwindSafe for LayoutTheme
impl Send for LayoutTheme
impl Sync for LayoutTheme
impl Unpin for LayoutTheme
impl UnsafeUnpin for LayoutTheme
impl UnwindSafe for LayoutTheme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().