pub struct Shortcuts(/* private fields */);Expand description
Configuration for the Config::shortcuts field.
It defines a list of shortcuts used to combine several utility classes into one.
§Example
use encre_css::Config;
let mut config = Config::default();
config.shortcuts.add("btn", "border-1 rounded-xl bg-red-500");
let generated = encre_css::generate(
[r#"<button class="btn">Click me</button>"#],
&config,
);
assert!(generated.ends_with(r#".btn {
border-radius: 0.75rem;
}
.btn {
border-width: 1px;
}
.btn {
background-color: oklch(63.7% .237 25.331);
}"#));§Corresponding TOML configuration
[shortcuts]
btn = "border-1 rounded-xl bg-red-500"Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Shortcuts
impl<'de> Deserialize<'de> for Shortcuts
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Shortcuts
impl StructuralPartialEq for Shortcuts
Auto Trait Implementations§
impl Freeze for Shortcuts
impl RefUnwindSafe for Shortcuts
impl Send for Shortcuts
impl Sync for Shortcuts
impl Unpin for Shortcuts
impl UnwindSafe for Shortcuts
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