Skip to main content

CustomProp

Struct CustomProp 

Source
pub struct CustomProp {
    pub name: &'static str,
    pub owner: &'static str,
    pub default: &'static str,
    pub description: &'static str,
}
Expand description

A CSS custom property a theme may set to reconfigure a component.

These are read by moss’s stylesheets as var(--moss-foo, <fallback>) and are deliberately never declared — that is exactly what makes them opt-in escape hatches rather than design tokens. A token has a value in :root and cascades site-wide; one of these has no value until a theme sets it, and it is set on a component or a scope to change that component.

The distinction matters because it is the whole theming API in practice. Audited 2026-08-03: the two most heavily customized moss sites (okagaki, 在場) overrode zero design tokens between them and set six of these. None was discoverable — not in moss describe --json, not in any published doc — so okagaki hand-fought the hero height caps that --moss-hero-max-height exists to lift, across three selectors and a 12-line comment.

Fields§

§name: &'static str

Property name including the leading dashes (e.g. "--moss-hero-max-height").

§owner: &'static str

Class of the component whose rules read it, or a scope selector when no single class owns it (e.g. "body"). Free-form: this is documentation, not a foreign key.

§default: &'static str

The fallback moss’s own CSS uses when the theme does not set it. Taken verbatim from the var() call site — never invented.

§description: &'static str

What setting it does, and when you would want to.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.