pub struct ShadowList<'a>(/* private fields */);Expand description
A list of shadows, used in the box-shadow CSS property.
Implementations§
Source§impl<'a> ShadowList<'a>
impl<'a> ShadowList<'a>
Sourcepub fn parse(value: &'a str) -> Option<Self>
pub fn parse(value: &'a str) -> Option<Self>
Parse an arbitrary string into a ShadowList.
§Example
use encre_css::utils::shadow::ShadowList;
assert_eq!(ShadowList::parse("10px 20px 30px 40px rgb(12 12 12)").unwrap().to_string(), "10px 20px 30px 40px rgb(12 12 12)".to_string());
assert_eq!(ShadowList::parse("1px 2px 3px 4px"), None);Sourcepub fn replace_all_colors(&mut self, new_color: &'a str)
pub fn replace_all_colors(&mut self, new_color: &'a str)
Replace the color of all shadows with the color given as the first argument.
If the given color contains {}, it will be replaced by the old color.
Trait Implementations§
Source§impl<'a> Debug for ShadowList<'a>
impl<'a> Debug for ShadowList<'a>
Source§impl Display for ShadowList<'_>
impl Display for ShadowList<'_>
Source§impl<'a> PartialEq for ShadowList<'a>
impl<'a> PartialEq for ShadowList<'a>
impl<'a> StructuralPartialEq for ShadowList<'a>
Auto Trait Implementations§
impl<'a> Freeze for ShadowList<'a>
impl<'a> RefUnwindSafe for ShadowList<'a>
impl<'a> Send for ShadowList<'a>
impl<'a> Sync for ShadowList<'a>
impl<'a> Unpin for ShadowList<'a>
impl<'a> UnwindSafe for ShadowList<'a>
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