pub struct ThemeMetadata {
pub name: Option<String>,
pub author: Option<String>,
pub license: Option<String>,
pub version: Option<String>,
pub description: Option<String>,
}Expand description
Theme metadata: parses descriptive --theme-* custom properties
out of a theme token CSS file.
Theme files may declare these alongside their colour/font tokens in :root,
e.g.:
:root {
--theme-name: 'GitHub';
--theme-author: 'Kim Skov Rasmussen';
--theme-license: 'MIT';
--theme-version: '0.24.0';
--theme-description: 'GitHub-inspired theme (Primer palette)';
/* ...regular colour/font tokens... */
}Because these are ordinary CSS custom properties, they need no support from
base_css() — they simply carry data through
the same mechanism as every other token. Consumers (e.g. a theme picker UI)
call parse_theme_metadata on the raw theme CSS to read them back out,
instead of deriving a display name from the filename.
Fields§
§name: Option<String>§license: Option<String>§version: Option<String>§description: Option<String>Trait Implementations§
Source§impl Clone for ThemeMetadata
impl Clone for ThemeMetadata
Source§fn clone(&self) -> ThemeMetadata
fn clone(&self) -> ThemeMetadata
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 moreSource§impl Debug for ThemeMetadata
impl Debug for ThemeMetadata
Source§impl Default for ThemeMetadata
impl Default for ThemeMetadata
Source§fn default() -> ThemeMetadata
fn default() -> ThemeMetadata
Returns the “default value” for a type. Read more
impl Eq for ThemeMetadata
Source§impl PartialEq for ThemeMetadata
impl PartialEq for ThemeMetadata
Source§fn eq(&self, other: &ThemeMetadata) -> bool
fn eq(&self, other: &ThemeMetadata) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ThemeMetadata
Auto Trait Implementations§
impl Freeze for ThemeMetadata
impl RefUnwindSafe for ThemeMetadata
impl Send for ThemeMetadata
impl Sync for ThemeMetadata
impl Unpin for ThemeMetadata
impl UnsafeUnpin for ThemeMetadata
impl UnwindSafe for ThemeMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.