pub struct CssGenerator { /* private fields */ }Expand description
CSS generator that converts Tailwind classes to CSS rules
Implementations§
Source§impl CssGenerator
impl CssGenerator
Sourcepub fn new() -> CssGenerator
pub fn new() -> CssGenerator
Create a new CSS generator
Sourcepub fn add_class(&mut self, class: &str) -> Result<(), TailwindError>
pub fn add_class(&mut self, class: &str) -> Result<(), TailwindError>
Add a class to the generator
Sourcepub fn add_responsive_class(
&mut self,
breakpoint: Breakpoint,
class: &str,
) -> Result<(), TailwindError>
pub fn add_responsive_class( &mut self, breakpoint: Breakpoint, class: &str, ) -> Result<(), TailwindError>
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 rules generated
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 (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 CssGenerator
impl Debug for CssGenerator
Source§impl Default for CssGenerator
impl Default for CssGenerator
Source§fn default() -> CssGenerator
fn default() -> CssGenerator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CssGenerator
impl RefUnwindSafe for CssGenerator
impl Send for CssGenerator
impl Sync for CssGenerator
impl Unpin for CssGenerator
impl UnsafeUnpin 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