Module utils

Module utils 

Source
Expand description

Utility Functions for CSS Generation

This module provides utility functions for CSS generation, including helper functions and common operations.

Functions§

create_css_property
Create a CSS property with optional important flag
create_important_property
Create CSS property with important flag
create_media_query
Create a media query
create_multiple_properties
Create multiple CSS properties for a single value
create_normal_property
Create CSS property without important flag
create_responsive_selector
Create a responsive selector
create_selector
Create a CSS rule selector
extract_numeric_value
Extract numeric value from class string
hex_to_rgba
Convert hex color to RGBA with opacity
is_valid_color
Check if a value is a valid CSS color
is_valid_length
Check if a value is a valid CSS length
matches_pattern
Check if a class matches a pattern
merge_properties
Merge CSS properties
normalize_property_name
Normalize CSS property name
normalize_property_value
Normalize CSS property value
numeric_to_css_unit
Convert numeric value to CSS unit
parse_opacity_from_class
Parse opacity from class string (e.g., “bg-blue-500/50”)
percentage_to_css
Convert percentage to CSS
pixel_to_css
Convert pixel value to CSS
remove_opacity_suffix
Remove opacity suffix from class string
sort_properties
Sort CSS properties by name
spacing_to_css
Convert spacing value to CSS
validate_css_property
Validate CSS property
viewport_to_css
Convert viewport unit to CSS