pub struct CssGenerator { /* private fields */ }Expand description
CSS generator that converts Tailwind classes to CSS rules
Implementations§
Source§impl CssGenerator
impl CssGenerator
Sourcepub fn add_responsive_class(
&mut self,
breakpoint: Breakpoint,
class: &str,
) -> Result<()>
pub fn add_responsive_class( &mut self, breakpoint: Breakpoint, class: &str, ) -> Result<()>
Add a responsive class
Sourcepub fn add_custom_property(&mut self, name: &str, value: &str)
pub fn add_custom_property(&mut self, name: &str, value: &str)
Add a custom CSS property
Sourcepub fn generate_css(&self) -> String
pub fn generate_css(&self) -> String
Generate CSS from all added classes
Sourcepub fn generate_minified_css(&self) -> String
pub fn generate_minified_css(&self) -> String
Generate minified CSS
Sourcepub fn rule_count(&self) -> usize
pub fn rule_count(&self) -> usize
Get the number of generated rules
Sourcepub fn remove_rule(&mut self, selector: &str) -> Option<CssRule>
pub fn remove_rule(&mut self, selector: &str) -> Option<CssRule>
Remove a CSS rule by selector
Sourcepub fn update_rule(&mut self, selector: &str, rule: CssRule)
pub fn update_rule(&mut self, selector: &str, rule: CssRule)
Update a CSS rule
Trait Implementations§
Source§impl Clone for CssGenerator
impl Clone for CssGenerator
Source§fn clone(&self) -> CssGenerator
fn clone(&self) -> CssGenerator
Returns a duplicate of the value. Read more
1.0.0 · 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 CssGenerator
impl Debug for CssGenerator
Auto Trait Implementations§
impl Freeze for CssGenerator
impl RefUnwindSafe for CssGenerator
impl Send for CssGenerator
impl Sync for CssGenerator
impl Unpin for CssGenerator
impl UnwindSafe for CssGenerator
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