pub struct ScopeAttr {
pub selector: &'static str,
pub name: &'static str,
pub values: &'static [&'static str],
pub description: &'static str,
}Expand description
A data-* attribute moss emits on an element that carries no moss-* class.
<body data-page="home"> is the case that forced this to exist. It is a
first-class part of the contract — the only thing that tells a stylesheet
which page it is on, and okagaki’s entire front page hangs off it — but
<body> has no class, so declaring it would have meant inventing a
moss-body entry for a class moss never emits. That is the orphan-entry
problem (#777) in miniature: a contract that names selectors moss does not
produce teaches agents to target dead ones.
Fields§
§selector: &'static strCSS selector for the element carrying it (e.g. "body").
name: &'static strAttribute name including the data- prefix.
values: &'static [&'static str]Allowed values. Empty means free-form.
description: &'static strWhat it marks, and what to scope to it.
Auto Trait Implementations§
impl Freeze for ScopeAttr
impl RefUnwindSafe for ScopeAttr
impl Send for ScopeAttr
impl Sync for ScopeAttr
impl Unpin for ScopeAttr
impl UnsafeUnpin for ScopeAttr
impl UnwindSafe for ScopeAttr
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