pub struct FieldColors {
pub background: Hsla,
pub foreground: Hsla,
pub placeholder: Hsla,
pub border: Hsla,
}Expand description
Form-field tokens. v3 keeps these separate from buttons so inputs can be styled independently.
Fields§
§background: Hsla--field-background
foreground: Hsla--field-foreground
placeholder: Hsla--field-placeholder
border: Hsla--field-border — transparent by default.
Implementations§
Source§impl FieldColors
impl FieldColors
Sourcepub fn hover(&self) -> Hsla
pub fn hover(&self) -> Hsla
--color-field-hover: color-mix(in oklab, var(--field-background) 90%, var(--field-foreground) 2%)
CSS normalises the 90/2 weights, so the foreground contributes 2/92.
Sourcepub fn border_hover(&self) -> Hsla
pub fn border_hover(&self) -> Hsla
--field-border-hover: color-mix(in oklab, var(--field-border) 88%, var(--field-foreground) 10%)
The weights sum to 98, which CSS normalises, so the foreground
contributes 10/98. Invisible while --field-border-width is 0, and the
token exists for a caller who gives their fields a border.
Sourcepub fn border_focus(&self) -> Hsla
pub fn border_focus(&self) -> Hsla
--field-border-focus: color-mix(in oklab, var(--field-border) 74%, var(--field-foreground) 22%)
Trait Implementations§
Source§impl Clone for FieldColors
impl Clone for FieldColors
Source§fn clone(&self) -> FieldColors
fn clone(&self) -> FieldColors
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FieldColors
Auto Trait Implementations§
impl Freeze for FieldColors
impl RefUnwindSafe for FieldColors
impl Send for FieldColors
impl Sync for FieldColors
impl Unpin for FieldColors
impl UnsafeUnpin for FieldColors
impl UnwindSafe for FieldColors
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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 more