# cjm-tailwind-utils
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
### Installation
``` sh
$ pip install cjm_tailwind_utils
```
## Project Structure
nbs/
├── all.ipynb # Convenience module that imports all TailwindBuilder methods and the global tw instance.
├── colors.ipynb # Color system with validation for Tailwind colors, hex, RGB, HSL, and CSS variables. Provides color validation and normalization for style utilities.
├── core.ipynb # Core TailwindBuilder class with chainable API, deduplication, and utility methods. This is the foundation - always import this module first.
├── layout.ipynb # Layout utilities for spacing (padding, margin), sizing (width, height), positioning, flexbox, and grid. Essential for component structure and spacing.
├── modern.ipynb # Tailwind v4+ features including container queries, `:has()` pseudo-class, and `@supports`. Optional module for cutting-edge CSS features.
├── style.ipynb # Visual styling utilities for typography, backgrounds, borders, shadows, and effects. Depends on colors module for color validation.
├── types.ipynb # Type definitions for Tailwind values (spacing, colors, sizes, etc.). Import only when you need type hints for better IDE support and type checking.
├── validation.ipynb # Validation functions and error handling for Tailwind utilities. Internal module - typically not imported directly unless creating custom utilities.
└── variants.ipynb # State variants (hover, focus), responsive breakpoints (sm, md, lg), dark mode, and modifier utilities. Add interactivity and responsiveness to components.
Total: 10 notebooks
## Module Dependencies
``` mermaid
graph LR
all[all<br/>All]
colors[colors<br/>Colors]
core[core<br/>Core]
layout[layout<br/>Layout]
modern[modern<br/>Modern]
style_mod[style<br/>Style]
types[types<br/>Type Definitions]
validation[validation<br/>Validation]
variants[variants<br/>Variants]
all --> modern
all --> style_mod
all --> layout
all --> core
all --> variants
colors --> types
colors --> validation
core --> types
core --> validation
layout --> types
layout --> core
layout --> validation
modern --> core
style_mod --> types
style_mod --> core
style_mod --> colors
style_mod --> validation
variants --> core
classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
```
*18 cross-module dependencies detected*
## CLI Reference
No CLI commands found in this project.
## Module Overview
Detailed documentation for each module in the project:
### Colors (`colors.ipynb`)
> Color system with validation for Tailwind colors, hex, RGB, HSL, and
> CSS variables. Provides color validation and normalization for style
> utilities.
#### Import
``` python
from cjm_tailwind_utils.colors import (
TAILWIND_COLORS,
SPECIAL_COLORS,
HEX_PATTERN,
RGB_PATTERN,
HSL_PATTERN,
VAR_PATTERN,
is_valid_color,
normalize_color,
validate_color_value,
color_with_opacity,
make_color
)
```
#### Functions
``` python
def is_valid_color(
color: str # Color string to validate
) -> bool: # True if valid color, False otherwise
"Validate if a string is a valid color value. Valid colors include: - Tailwind color names (with or without shade) - Special color keywords - Hex colors (#RGB, #RRGGBB, #RRGGBBAA) - RGB/RGBA functions - HSL/HSLA functions - CSS variables"
```
``` python
def normalize_color(
color: str # Color string to normalize
) -> str: # Normalized color string
"Normalize color value for use in Tailwind classes. This function handles: - Standard Tailwind colors (returns as-is) - CSS color functions (ensures proper formatting) - CSS variables (ensures proper formatting)"
```
``` python
def validate_color_value(
color: str, # The color value to validate
allow_opacity_suffix: bool = False # Whether to allow opacity suffix like 'white/80'
) -> None: # TODO: Add return description
"Validate a color value using the is_valid_color function."
```
``` python
def color_with_opacity(
color: str, # Base color value
opacity: Optional[OpacityValue] = None # Optional opacity value (0-100)
) -> str: # Color string with opacity modifier if provided
"Generate color string with optional opacity modifier."
```
``` python
def make_color(
base: BaseColor, # Base color name
shade: ColorShade # Color shade value
) -> str: # Complete color string (e.g., "blue-500")
"Create a color string from base color and shade."
```
#### Variables
``` python
TAILWIND_COLORS = {22 items} # Predefined Tailwind color palette
SPECIAL_COLORS # Special colors that don't have shades
HEX_PATTERN # ([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$') # CSS Hex color format patterns
RGB_PATTERN # CSS RGB color format patterns
HSL_PATTERN # CSS HSL color format patterns
VAR_PATTERN # CSS VAR color format patterns
```
### Core (`core.ipynb`)
> Core TailwindBuilder class with chainable API, deduplication, and
> utility methods. This is the foundation - always import this module
> first.
#### Import
``` python
from cjm_tailwind_utils.core import (
tw,
TailwindBuilder
)
```
#### Functions
``` python
@patch
def arbitrary(
self:TailwindBuilder,
prefix: str, # CSS utility prefix (e.g., 'p', 'w', 'text')
value: str, # Arbitrary value (e.g., '23px', '#1da1f2', 'calc(100%-1rem)')
suffix: Optional[str] = None # Optional suffix (e.g., for p-[20px]/50)
) -> Union[str, Self]: # Arbitrary value utility class string or self for chaining
"""
Generate arbitrary value utility class.
Examples:
tw.arbitrary('w', '23px') # Returns 'w-[23px]'
tw.arbitrary('bg', '#1da1f2') # Returns 'bg-[#1da1f2]'
tw.arbitrary('p', '20px', '50') # Returns 'p-[20px]/50'
"""
```
``` python
@patch
def util(
self:TailwindBuilder,
*classes: str # Raw Tailwind utility classes to add
) -> Union[str, Self]: # Utility classes string or self for chaining
"""
Add raw Tailwind utility classes without validation.
This method allows adding any Tailwind utility classes directly,
useful for custom utilities, newer Tailwind features, or third-party plugins.
Args:
*classes: One or more Tailwind utility class strings
Returns:
Combined utility classes string or self for chaining
Examples:
tw.util('backdrop-blur-sm') # Returns 'backdrop-blur-sm'
tw.util('animate-fade-in', 'will-change-transform') # Returns 'animate-fade-in will-change-transform'
tw.chain().util('custom-utility').p(4) # Chainable
"""
```
``` python
@patch
def add_class(
self:TailwindBuilder,
class_str: str # TODO: Add description
) -> Self: # TODO: Add return description
"Add arbitrary class string (only available in chain mode)."
```
``` python
@patch
def build(
self:TailwindBuilder
) -> str: # TODO: Add return description
"Build and return the final class string (only available in chain mode)."
```
``` python
@patch
def __str__(
self:TailwindBuilder
) -> str: # TODO: Add return description
"String representation."
```
``` python
@patch
def __repr__(
self:TailwindBuilder
) -> str: # TODO: Add return description
"Representation."
```
``` python
@patch
def merge(
self:TailwindBuilder,
*class_strings: str,
dedupe: bool = True # Whether to deduplicate conflicting classes (default: True)
) -> str: # Merged class string
"Merge multiple class strings into one, with optional deduplication. This is a utility method that doesn't require chain mode."
```
``` python
@patch
def chain(self:TailwindBuilder, *classes: str, dedupe: bool = True) -> Self: # Chainable TailwindBuilder instance
"""Create a chainable builder instance with optional starting classes.
Args:
*classes: Optional initial classes to add
dedupe: Whether to deduplicate conflicting classes (default: True)
Returns:
A new chainable TailwindBuilder instance
"""
builder = TailwindBuilder(_chain_mode=True, dedupe=dedupe)
if classes
"""
Create a chainable builder instance with optional starting classes.
Args:
*classes: Optional initial classes to add
dedupe: Whether to deduplicate conflicting classes (default: True)
Returns:
A new chainable TailwindBuilder instance
"""
```
``` python
@patch
def _spacing_class(
self:TailwindBuilder,
prefix: str, # CSS class prefix (e.g., 'p', 'mx', 'gap')
value: Union[SpacingValue, str] # Spacing value to format
) -> str: # Complete CSS class string
"Build spacing utility class."
```
``` python
@patch
def _size_class(
self:TailwindBuilder,
prefix: str, # CSS class prefix (e.g., 'w', 'h', 'max-w')
value: Union[SizeValue, str] # Size value to format
) -> str: # Complete CSS class string
"Build size utility class."
```
``` python
def _format_spacing_value(
value: SpacingValue # Spacing value to format (numeric or string)
) -> str: # Formatted string for CSS class name
"Format spacing value for class name."
```
#### Classes
``` python
class TailwindBuilder:
def __init__(
self,
_chain_mode: bool = False, # TODO: Add description
dedupe: bool = True # TODO: Add description
)
"""
Dynamic Tailwind CSS utility class builder with full type safety and chainable API.
This builder provides methods for generating Tailwind utility classes with proper type hints
and validation. It supports both direct string returns and chainable fluent API.
Usage:
tw.p(4) # Returns "p-4"
tw.chain().p(4).bg("blue-500") # Returns chainable builder
"""
def __init__(
self,
_chain_mode: bool = False, # TODO: Add description
dedupe: bool = True # TODO: Add description
)
"Initialize builder.
Args:
_chain_mode: Internal flag for chainable mode
dedupe: Whether to deduplicate conflicting classes (default: True)"
```
#### Variables
``` python
tw # Global instance of TailwindBuilder for convenience
```
### Layout (`layout.ipynb`)
> Layout utilities for spacing (padding, margin), sizing (width,
> height), positioning, flexbox, and grid. Essential for component
> structure and spacing.
#### Import
``` python
from cjm_tailwind_utils.layout import *
```
#### Functions
``` python
@patch
def p(
self:TailwindBuilder,
value: Union[SpacingValue, str], # Spacing value or arbitrary value string
side: Optional[Literal["t", "r", "b", "l", "x", "y"]] = None # Optional side specification
) -> Union[str, Self]: # Padding utility class string or self for chaining
"Generate padding utility class with arbitrary value support and validation."
```
``` python
@patch
def m(
self:TailwindBuilder,
value: Union[SpacingValue, str], # Spacing value or arbitrary value string
side: Optional[Literal["t", "r", "b", "l", "x", "y"]] = None, # Optional side specification
negative: bool = False # Whether to apply negative value
) -> Union[str, Self]: # Margin utility class string or self for chaining
"""
Generate margin utility class with arbitrary value support, validation, and negative values.
Args:
value: Spacing value or arbitrary value string
side: Optional side specification ('t', 'r', 'b', 'l', 'x', 'y')
negative: Whether to apply negative margin (default: False)
Returns:
Margin utility class string or self for chaining
Examples:
tw.m(4) # 'm-4'
tw.m(4, negative=True) # '-m-4'
tw.m(4, 'x', negative=True) # '-mx-4'
"""
```
``` python
@patch
def gap(
self:TailwindBuilder,
value: Union[SpacingValue, str], # Spacing value or arbitrary value string
axis: Optional[Literal["x", "y"]] = None # Optional axis specification
) -> Union[str, Self]: # Gap utility class string or self for chaining
"Generate gap utility class with arbitrary value support."
```
``` python
@patch
def space(
self:TailwindBuilder,
value: Union[SpacingValue, str], # Spacing value or arbitrary value string
axis: Literal["x", "y"] # Axis for spacing
) -> Union[str, Self]: # Space utility class string or self for chaining
"Generate space between utility class with arbitrary value support."
```
``` python
@patch
def w(
self:TailwindBuilder,
value: Union[SizeValue, str], # Size value or arbitrary value string
important: bool = False # Whether to add !important modifier
) -> Union[str, Self]: # Width utility class string or self for chaining
"Generate width utility class with arbitrary value support."
```
``` python
@patch
def h(
self:TailwindBuilder,
value: Union[SizeValue, str], # Size value or arbitrary value string
important: bool = False # Whether to add !important modifier
) -> Union[str, Self]: # Height utility class string or self for chaining
"Generate height utility class with arbitrary value support."
```
``` python
@patch
def size(
self:TailwindBuilder,
value: Union[SizeValue, str] # Size value or arbitrary value string
) -> Union[str, Self]: # Size utility class string or self for chaining
"Generate size utility class (sets both width and height) with arbitrary value support."
```
``` python
@patch
def min_w(
self:TailwindBuilder,
value: Union[SizeValue, str] # Size value or arbitrary value string
) -> Union[str, Self]: # Min-width utility class string or self for chaining
"Generate min-width utility class with arbitrary value support."
```
``` python
@patch
def max_w(
self:TailwindBuilder,
value: Union[SizeValue, str, Literal["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl", "prose"]] # Size value, arbitrary value, or named size
) -> Union[str, Self]: # Max-width utility class string or self for chaining
"Generate max-width utility class with arbitrary value support."
```
``` python
@patch
def min_h(
self:TailwindBuilder,
value: Union[SizeValue, str] # Size value or arbitrary value string
) -> Union[str, Self]: # Min-height utility class string or self for chaining
"Generate min-height utility class with arbitrary value support."
```
``` python
@patch
def max_h(
self:TailwindBuilder,
value: Union[SizeValue, str] # Size value or arbitrary value string
) -> Union[str, Self]: # Max-height utility class string or self for chaining
"Generate max-height utility class with arbitrary value support."
```
``` python
@patch
def position(
self:TailwindBuilder,
value: Literal["static", "fixed", "absolute", "relative", "sticky"] # Position type
) -> Union[str, Self]: # Position utility class string or self for chaining
"Generate position utility class."
```
``` python
@patch
def inset(
self:TailwindBuilder,
value: Union[SpacingValue, str], # Inset value or arbitrary value string
side: Optional[Literal["top", "right", "bottom", "left", "x", "y"]] = None, # Optional side specification
negative: bool = False # Whether to apply negative value
) -> Union[str, Self]: # Inset utility class string or self for chaining
"""
Generate inset (top/right/bottom/left) utility class with arbitrary value support and negative values.
Args:
value: Inset value or arbitrary value string
side: Optional side specification ('top', 'right', 'bottom', 'left', 'x', 'y')
negative: Whether to apply negative inset (default: False)
Returns:
Inset utility class string or self for chaining
Examples:
tw.inset(4) # 'inset-4'
tw.inset(4, 'top') # 'top-4'
tw.inset(4, 'x', negative=True) # '-inset-x-4'
"""
```
``` python
@patch
def z(
self:TailwindBuilder,
value: Union[ZIndexValue, int, str] # Z-index value, integer, or arbitrary value string
) -> Union[str, Self]: # Z-index utility class string or self for chaining
"Generate z-index utility class with arbitrary value support."
```
``` python
@patch
def display(
self:TailwindBuilder,
value: Literal["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"] # Display type
) -> Union[str, Self]: # Display utility class string or self for chaining
"Generate display utility class."
```
``` python
@patch
def flex(self:TailwindBuilder,
direction: Optional[Literal["row", "row-reverse", "col", "col-reverse"]] = None,
wrap: Optional[Literal["wrap", "wrap-reverse", "nowrap"]] = None,
grow: Optional[Literal[0, 1]] = None,
shrink: Optional[Literal[0, 1]] = None,
basis: Optional[Union[SizeValue, str]] = None) -> Union[str, Self]
"Generate flex utility classes with arbitrary value support."
```
``` python
@patch
def items(
self:TailwindBuilder,
value: Literal["start", "end", "center", "baseline", "stretch"] # Alignment value for flex/grid items
) -> Union[str, Self]: # Align-items utility class string or self for chaining
"Generate align-items utility class."
```
``` python
@patch
def justify(
self:TailwindBuilder,
value: Literal["normal", "start", "end", "center", "between", "around", "evenly", "stretch"] # Justify-content value
) -> Union[str, Self]: # Justify-content utility class string or self for chaining
"Generate justify-content utility class."
```
``` python
@patch
def align(
self:TailwindBuilder,
value: Literal["auto", "start", "end", "center", "stretch", "baseline"] # Align-self value
) -> Union[str, Self]: # Align-self utility class string or self for chaining
"Generate align-self utility class."
```
``` python
@patch
def grid(self:TailwindBuilder,
cols: Optional[Union[int, Literal["none"], str]] = None,
rows: Optional[Union[int, Literal["none"], str]] = None,
flow: Optional[Literal["row", "col", "dense", "row-dense", "col-dense"]] = None) -> Union[str, Self]
"Generate grid utility classes with arbitrary value support."
```
``` python
@patch
def col(
self:TailwindBuilder,
span: Union[int, Literal["auto", "full"]], # Number of columns to span or keyword
start: Optional[int] = None # Starting column number
) -> Union[str, Self]: # Grid column utility class string or self for chaining
"Generate grid column utility classes."
```
``` python
@patch
def row(
self:TailwindBuilder,
span: Union[int, Literal["auto", "full"]], # Number of rows to span or keyword
start: Optional[int] = None # Starting row number
) -> Union[str, Self]: # Grid row utility class string or self for chaining
"Generate grid row utility classes."
```
### Modern (`modern.ipynb`)
> Tailwind v4+ features including container queries, `:has()`
> pseudo-class, and `@supports`. Optional module for cutting-edge CSS
> features.
#### Import
``` python
from cjm_tailwind_utils.modern import *
```
#### Functions
``` python
@patch
def container_query(
self:TailwindBuilder,
name: Optional[str] = None # Optional container name
) -> Union[str, Self]: # Container query class string or self for chaining
"""
Add container query support for container queries.
Examples:
tw.container_query() # @container
tw.container_query('sidebar') # @container/sidebar
"""
```
``` python
@patch
def cq(
self:TailwindBuilder,
size: Union[str, int], # Container size (e.g., 'sm', 'md', '300px', 20)
*classes: str # Classes to apply at container size
) -> Union[str, Self]: # Container query classes string or self for chaining
"""
Add container query size variant to classes.
Examples:
tw.cq('md', 'flex', 'gap-4') # @md:flex @md:gap-4
tw.cq('300px', 'grid-cols-2') # @[300px]:grid-cols-2
tw.cq(20, 'text-lg') # @[20rem]:text-lg (numeric values treated as rem)
"""
```
``` python
@patch
def has(
self:TailwindBuilder,
selector: str, # Selector to check for (e.g., 'hover', '[disabled]')
*classes: str # Classes to apply when selector matches
) -> Union[str, Self]: # Has pseudo-class classes string or self for chaining
"""
Add :has() pseudo-class support.
Examples:
tw.has('[disabled]', 'opacity-50') # has-[[disabled]]:opacity-50
tw.has('hover', 'shadow-lg') # has-[hover]:shadow-lg
"""
```
``` python
@patch
def supports(
self:TailwindBuilder,
feature: str, # CSS feature to check support for
*classes: str # Classes to apply when feature is supported
) -> Union[str, Self]: # Feature query classes string or self for chaining
"""
Add @supports feature query support.
Examples:
tw.supports('grid', 'grid', 'grid-cols-3') # supports-[grid]:grid supports-[grid]:grid-cols-3
tw.supports('backdrop-filter', 'backdrop-blur-sm')
"""
```
``` python
@patch
def data(
self:TailwindBuilder,
attribute: str, # Data attribute to check (without data- prefix)
value: Optional[str] = None, # Optional value to match
*classes: str # Classes to apply when data attribute matches
) -> Union[str, Self]: # Data attribute classes string or self for chaining
"""
Add data attribute selector support.
Examples:
tw.data('open', None, 'block') # data-[open]:block
tw.data('state', 'active', 'bg-blue-500') # data-[state=active]:bg-blue-500
"""
```
### Style (`style.ipynb`)
> Visual styling utilities for typography, backgrounds, borders,
> shadows, and effects. Depends on colors module for color validation.
#### Import
``` python
from cjm_tailwind_utils.style import *
```
#### Functions
``` python
@patch
def text(self:TailwindBuilder,
size: Optional[Union[Literal["xs", "sm", "base", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl", "8xl", "9xl"], str]] = None,
align: Optional[Literal["left", "center", "right", "justify", "start", "end"]] = None,
weight: Optional[Literal["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black"]] = None,
color: Optional[Union[ColorValue, str]] = None) -> Union[str, Self]
"Generate text utility classes with color validation and arbitrary value support."
```
``` python
@patch
def font(
self:TailwindBuilder,
family: Union[Literal["sans", "serif", "mono"], str] # Font family type or arbitrary value
) -> Union[str, Self]: # Font family utility class string or self for chaining
"Generate font family utility class with arbitrary value support."
```
``` python
@patch
def leading(
self:TailwindBuilder,
value: Union[Literal["none", "tight", "snug", "normal", "relaxed", "loose"], int, str] # Line height value or arbitrary value
) -> Union[str, Self]: # Line-height utility class string or self for chaining
"Generate line-height utility class with arbitrary value support."
```
``` python
@patch
def tracking(
self:TailwindBuilder,
value: Union[Literal["tighter", "tight", "normal", "wide", "wider", "widest"], str] # Letter spacing value or arbitrary value
) -> Union[str, Self]: # Letter-spacing utility class string or self for chaining
"Generate letter-spacing utility class with arbitrary value support."
```
``` python
@patch
def bg(
self:TailwindBuilder,
color: Union[ColorValue, str], # Background color value or arbitrary value
opacity: Optional[OpacityValue] = None # Optional opacity value (0-100)
) -> Union[str, Self]: # Background color utility class string or self for chaining
"Generate background color utility class with validation and arbitrary value support."
```
``` python
@patch
def border(self:TailwindBuilder,
width: Optional[Union[Literal[0, 2, 4, 8], Literal[""], str]] = "",
side: Optional[Literal["t", "r", "b", "l", "x", "y"]] = None,
color: Optional[Union[ColorValue, str]] = None, # Border color value or arbitrary value
style: Optional[Literal["solid", "dashed", "dotted", "double", "hidden", "none"]] = None) -> Union[str, Self]
"Generate border utility classes with color validation and arbitrary value support."
```
``` python
@patch
def rounded(self:TailwindBuilder,
size: Optional[Union[Literal["none", "sm", "", "md", "lg", "xl", "2xl", "3xl", "full"], str]] = "",
side: Optional[Literal["t", "r", "b", "l", "tl", "tr", "br", "bl"]] = None) -> Union[str, Self]
"Generate border-radius utility class with arbitrary value support."
```
``` python
@patch
def shadow(
self:TailwindBuilder,
size: Optional[Union[Literal["sm", "", "md", "lg", "xl", "2xl", "inner", "none"], str]] = "" # Shadow size or arbitrary value
) -> Union[str, Self]: # Box-shadow utility class string or self for chaining
"Generate box-shadow utility class with arbitrary value support."
```
``` python
@patch
def opacity(
self:TailwindBuilder,
value: Union[OpacityValue, int, float, str] # Opacity value or arbitrary value
) -> Union[str, Self]: # Opacity utility class string or self for chaining
"Generate opacity utility class with arbitrary value support."
```
``` python
@patch
def overflow(self:TailwindBuilder,
value: Literal["auto", "hidden", "clip", "visible", "scroll"],
axis: Optional[Literal["x", "y"]] = None) -> Union[str, Self]
"Generate overflow utility class."
```
``` python
@patch
def object(self:TailwindBuilder,
fit: Optional[Literal["contain", "cover", "fill", "none", "scale-down"]] = None,
position: Optional[Union[Literal["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], str]] = None) -> Union[str, Self]
"Generate object-fit and object-position utility classes with arbitrary value support."
```
``` python
@patch
def cursor(
self:TailwindBuilder,
value: Union[Literal["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out"], str] # Cursor type or arbitrary value
) -> Union[str, Self]: # Cursor utility class string or self for chaining
"Generate cursor utility class with arbitrary value support."
```
``` python
@patch
def transition(self:TailwindBuilder,
property: Optional[Literal["none", "all", "", "colors", "opacity", "shadow", "transform"]] = "",
duration: Optional[Union[Literal[75, 100, 150, 200, 300, 500, 700, 1000], int, str]] = None,
timing: Optional[Union[Literal["linear", "in", "out", "in-out"], str]] = None,
delay: Optional[Union[int, str]] = None) -> Union[str, Self]
"Generate transition utility classes with arbitrary value support."
```
``` python
@patch
def animate(
self:TailwindBuilder,
value: Union[Literal["none", "spin", "ping", "pulse", "bounce"], str] # Animation type or arbitrary value
) -> Union[str, Self]: # Animation utility class string or self for chaining
"Generate animation utility class with arbitrary value support."
```
``` python
@patch
def transform(self:TailwindBuilder,
scale: Optional[Union[Literal[0, 50, 75, 90, 95, 100, 105, 110, 125, 150], Tuple[Literal["x", "y"], Union[Literal[0, 50, 75, 90, 95, 100, 105, 110, 125, 150], str]], str]] = None,
rotate: Optional[Union[Literal[0, 1, 2, 3, 6, 12, 45, 90, 180], Literal["-1", "-2", "-3", "-6", "-12", "-45", "-90", "-180"], str]] = None,
translate: Optional[Union[Tuple[Literal["x", "y"], Union[SpacingValue, str, Tuple[Union[SpacingValue, str], bool]]], str]] = None) -> Union[str, Self]
"Generate transform utility classes with arbitrary value support and negative translate."
```
``` python
@patch
def container(
self:TailwindBuilder,
center: bool = True, # Whether to center the container with mx-auto
padding: Optional[SpacingValue] = None # Optional padding to add
) -> Union[str, Self]: # Container utility classes string or self for chaining
"Generate container utility classes."
```
``` python
@patch
def stack(
self:TailwindBuilder,
gap: SpacingValue = 4 # Gap between stacked items
) -> Union[str, Self]: # Flex stack utility classes string or self for chaining
"Generate flex stack utility classes."
```
``` python
@patch
def center(
self:TailwindBuilder,
method: Literal["flex", "grid", "absolute"] = "flex" # Centering method to use
) -> Union[str, Self]: # Centering utility classes string or self for chaining
"Generate centering utility classes."
```
``` python
@patch
def prose(
self:TailwindBuilder,
size: Optional[Literal["sm", "", "lg", "xl", "2xl"]] = "" # Prose size variant
) -> Union[str, Self]: # Prose utility classes string or self for chaining
"Generate prose (typography) utility classes."
```
``` python
@patch
def sr_only(
self:TailwindBuilder
) -> Union[str, Self]: # Screen reader only class string or self for chaining
"Generate screen reader only utility class."
```
``` python
@patch
def not_sr_only(
self:TailwindBuilder
) -> Union[str, Self]: # Not screen reader only class string or self for chaining
"Generate not screen reader only utility class."
```
### Type Definitions (`types.ipynb`)
> Type definitions for Tailwind values (spacing, colors, sizes, etc.).
> Import only when you need type hints for better IDE support and type
> checking.
#### Import
``` python
from cjm_tailwind_utils.types import (
SpacingValue,
FractionValue,
SizeValue,
OpacityValue,
ZIndexValue,
BaseColor,
ColorShade,
SpecialColor,
ColorValue
)
```
#### Variables
``` python
SpacingValue # Extended spacing scale with new values from Tailwind v4
FractionValue # Fraction values
SizeValue # Common size values
OpacityValue # Color opacity values
ZIndexValue # Z-index values
BaseColor # Base color names from Tailwind CSS color palette
ColorShade # Standard color shade values
SpecialColor # Special color keywords
ColorValue # Complete color value type
```
### Validation (`validation.ipynb`)
> Validation functions and error handling for Tailwind utilities.
> Internal module - typically not imported directly unless creating
> custom utilities.
#### Import
``` python
from cjm_tailwind_utils.validation import (
VALID_SPACING_VALUES,
VALID_SPACING_STRINGS,
CONFLICTING_GROUPS,
TailwindBuilderError,
InvalidValueError,
InvalidColorError,
ChainModeError,
validate_spacing_value,
validate_opacity_value,
extract_modifiers,
extract_class_prefix,
get_conflicting_group,
should_replace_class
)
```
#### Functions
``` python
def validate_spacing_value(
value: Any, # The value to validate
allow_negative: bool = False # Whether to allow negative values
) -> None: # TODO: Add return description
"Validate a spacing value."
```
``` python
def validate_opacity_value(
value: Any # The opacity value to validate
) -> None: # TODO: Add return description
"Validate an opacity value."
```
``` python
def extract_modifiers(
class_str: str # TODO: Add description
) -> Tuple[str, str]: # Tuple of (modifiers, base_class) where modifiers is like 'hover:dark:' or ''
"Extract modifiers and base class from a utility class."
```
``` python
def extract_class_prefix(
class_str: str # TODO: Add description
) -> str: # TODO: Add return description
"""
Extract the prefix from a utility class.
Examples:
'p-4' -> 'p'
'hover:bg-blue-500' -> 'bg'
'sm:p-4' -> 'p'
'dark:hover:text-white' -> 'text'
'px-6' -> 'px'
'flex' -> 'flex'
'flex-wrap' -> 'flex-wrap'
"""
```
``` python
def get_conflicting_group(
prefix: str # TODO: Add description
) -> Optional[str]: # TODO: Add return description
"""
Get the conflicting group for a given prefix.
Returns the group name if the prefix belongs to a conflicting group,
None otherwise.
"""
```
``` python
def should_replace_class(
existing_class: str, # TODO: Add description
new_class: str # TODO: Add description
) -> bool: # TODO: Add return description
"""
Determine if new_class should replace existing_class.
Returns True if they belong to the same conflicting group and should be replaced.
"""
```
#### Classes
``` python
class TailwindBuilderError(Exception):
"Base exception for TailwindBuilder errors."
```
``` python
class InvalidValueError(TailwindBuilderError):
"Raised when an invalid value is provided to a utility method."
```
``` python
class InvalidColorError(TailwindBuilderError):
"Raised when an invalid color value is provided."
```
``` python
class ChainModeError(TailwindBuilderError):
"Raised when chain-mode specific methods are called in direct mode."
```
#### Variables
``` python
VALID_SPACING_VALUES # Valid spacing values including decimals
VALID_SPACING_STRINGS # Valid spacing strings
CONFLICTING_GROUPS: Dict[str, Tuple[str, ...]]
```
### Variants (`variants.ipynb`)
> State variants (hover, focus), responsive breakpoints (sm, md, lg),
> dark mode, and modifier utilities. Add interactivity and
> responsiveness to components.
#### Import
``` python
from cjm_tailwind_utils.variants import *
```
#### Functions
``` python
@patch
def hover(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Hover state classes string or self for chaining
"Add hover state variant to classes."
```
``` python
@patch
def focus(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Focus state classes string or self for chaining
"Add focus state variant to classes."
```
``` python
@patch
def active(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Active state classes string or self for chaining
"Add active state variant to classes."
```
``` python
@patch
def disabled(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Disabled state classes string or self for chaining
"Add disabled state variant to classes."
```
``` python
@patch
def sm(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Small screen responsive classes string or self for chaining
"Add small screen variant to classes."
```
``` python
@patch
def md(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Medium screen responsive classes string or self for chaining
"Add medium screen variant to classes."
```
``` python
@patch
def lg(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Large screen responsive classes string or self for chaining
"Add large screen variant to classes."
```
``` python
@patch
def xl(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Extra large screen responsive classes string or self for chaining
"Add extra large screen variant to classes."
```
``` python
@patch
def xxl(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # 2XL screen responsive classes string or self for chaining
"Add 2xl screen variant to classes."
```
``` python
@patch
def dark(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Dark mode classes string or self for chaining
"Add dark mode variant to classes."
```
``` python
@patch
def group_hover(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Group hover classes string or self for chaining
"Add group-hover variant to classes."
```
``` python
@patch
def peer_hover(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Peer hover classes string or self for chaining
"Add peer-hover variant to classes."
```
``` python
@patch
def modifiers(
self:TailwindBuilder,
*modifiers: str,
classes: Union[str, List[str]]
) -> Union[str, Self]: # Modified classes string or self for chaining
"""
Apply multiple modifiers to classes with support for stacking.
Examples:
tw.modifiers('dark', 'hover', classes='bg-blue-500') # dark:hover:bg-blue-500
tw.modifiers('sm', 'dark', classes=['bg-white', 'text-black'])
tw.modifiers('group-hover', 'lg', classes=tw.bg('blue-500'))
"""
```
``` python
@patch
def first(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # First child classes string or self for chaining
"Add first-child variant to classes."
```
``` python
@patch
def last(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Last child classes string or self for chaining
"Add last-child variant to classes."
```
``` python
@patch
def even(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Even child classes string or self for chaining
"Add even-child variant to classes."
```
``` python
@patch
def odd(
self:TailwindBuilder,
*classes: str
) -> Union[str, Self]: # Odd child classes string or self for chaining
"Add odd-child variant to classes."
```
``` python
@patch
def group(
self:TailwindBuilder
) -> Union[str, Self]: # Group class string or self for chaining
"Add group class for group-hover and similar variants."
```
``` python
@patch
def peer(
self:TailwindBuilder
) -> Union[str, Self]: # Peer class string or self for chaining
"Add peer class for peer-hover and similar variants."
```
Raw data
{
"_id": null,
"home_page": "https://github.com/cj-mills/cjm-tailwind-utils",
"name": "cjm-tailwind-utils",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "nbdev jupyter notebook python",
"author": "Christian J. Mills",
"author_email": "9126128+cj-mills@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/d0/69/dc365a9cea839d41966a7d438924603efab3fb949898fa225011b908479c/cjm_tailwind_utils-0.0.4.tar.gz",
"platform": null,
"description": "# cjm-tailwind-utils\n\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n### Installation\n\n``` sh\n$ pip install cjm_tailwind_utils\n```\n\n## Project Structure\n\n nbs/\n \u251c\u2500\u2500 all.ipynb # Convenience module that imports all TailwindBuilder methods and the global tw instance.\n \u251c\u2500\u2500 colors.ipynb # Color system with validation for Tailwind colors, hex, RGB, HSL, and CSS variables. Provides color validation and normalization for style utilities.\n \u251c\u2500\u2500 core.ipynb # Core TailwindBuilder class with chainable API, deduplication, and utility methods. This is the foundation - always import this module first.\n \u251c\u2500\u2500 layout.ipynb # Layout utilities for spacing (padding, margin), sizing (width, height), positioning, flexbox, and grid. Essential for component structure and spacing.\n \u251c\u2500\u2500 modern.ipynb # Tailwind v4+ features including container queries, `:has()` pseudo-class, and `@supports`. Optional module for cutting-edge CSS features.\n \u251c\u2500\u2500 style.ipynb # Visual styling utilities for typography, backgrounds, borders, shadows, and effects. Depends on colors module for color validation.\n \u251c\u2500\u2500 types.ipynb # Type definitions for Tailwind values (spacing, colors, sizes, etc.). Import only when you need type hints for better IDE support and type checking.\n \u251c\u2500\u2500 validation.ipynb # Validation functions and error handling for Tailwind utilities. Internal module - typically not imported directly unless creating custom utilities.\n \u2514\u2500\u2500 variants.ipynb # State variants (hover, focus), responsive breakpoints (sm, md, lg), dark mode, and modifier utilities. Add interactivity and responsiveness to components.\n\nTotal: 10 notebooks\n\n## Module Dependencies\n\n``` mermaid\ngraph LR\n all[all<br/>All]\n colors[colors<br/>Colors]\n core[core<br/>Core]\n layout[layout<br/>Layout]\n modern[modern<br/>Modern]\n style_mod[style<br/>Style]\n types[types<br/>Type Definitions]\n validation[validation<br/>Validation]\n variants[variants<br/>Variants]\n\n all --> modern\n all --> style_mod\n all --> layout\n all --> core\n all --> variants\n colors --> types\n colors --> validation\n core --> types\n core --> validation\n layout --> types\n layout --> core\n layout --> validation\n modern --> core\n style_mod --> types\n style_mod --> core\n style_mod --> colors\n style_mod --> validation\n variants --> core\n\n classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px\n```\n\n*18 cross-module dependencies detected*\n\n## CLI Reference\n\nNo CLI commands found in this project.\n\n## Module Overview\n\nDetailed documentation for each module in the project:\n\n### Colors (`colors.ipynb`)\n\n> Color system with validation for Tailwind colors, hex, RGB, HSL, and\n> CSS variables. Provides color validation and normalization for style\n> utilities.\n\n#### Import\n\n``` python\nfrom cjm_tailwind_utils.colors import (\n TAILWIND_COLORS,\n SPECIAL_COLORS,\n HEX_PATTERN,\n RGB_PATTERN,\n HSL_PATTERN,\n VAR_PATTERN,\n is_valid_color,\n normalize_color,\n validate_color_value,\n color_with_opacity,\n make_color\n)\n```\n\n#### Functions\n\n``` python\ndef is_valid_color(\n color: str # Color string to validate\n) -> bool: # True if valid color, False otherwise\n \"Validate if a string is a valid color value. Valid colors include: - Tailwind color names (with or without shade) - Special color keywords - Hex colors (#RGB, #RRGGBB, #RRGGBBAA) - RGB/RGBA functions - HSL/HSLA functions - CSS variables\"\n```\n\n``` python\ndef normalize_color(\n color: str # Color string to normalize\n) -> str: # Normalized color string\n \"Normalize color value for use in Tailwind classes. This function handles: - Standard Tailwind colors (returns as-is) - CSS color functions (ensures proper formatting) - CSS variables (ensures proper formatting)\"\n```\n\n``` python\ndef validate_color_value(\n color: str, # The color value to validate\n allow_opacity_suffix: bool = False # Whether to allow opacity suffix like 'white/80'\n) -> None: # TODO: Add return description\n \"Validate a color value using the is_valid_color function.\"\n```\n\n``` python\ndef color_with_opacity(\n color: str, # Base color value\n opacity: Optional[OpacityValue] = None # Optional opacity value (0-100)\n) -> str: # Color string with opacity modifier if provided\n \"Generate color string with optional opacity modifier.\"\n```\n\n``` python\ndef make_color(\n base: BaseColor, # Base color name\n shade: ColorShade # Color shade value\n) -> str: # Complete color string (e.g., \"blue-500\")\n \"Create a color string from base color and shade.\"\n```\n\n#### Variables\n\n``` python\nTAILWIND_COLORS = {22 items} # Predefined Tailwind color palette\nSPECIAL_COLORS # Special colors that don't have shades\nHEX_PATTERN # ([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$') # CSS Hex color format patterns\nRGB_PATTERN # CSS RGB color format patterns\nHSL_PATTERN # CSS HSL color format patterns\nVAR_PATTERN # CSS VAR color format patterns\n```\n\n### Core (`core.ipynb`)\n\n> Core TailwindBuilder class with chainable API, deduplication, and\n> utility methods. This is the foundation - always import this module\n> first.\n\n#### Import\n\n``` python\nfrom cjm_tailwind_utils.core import (\n tw,\n TailwindBuilder\n)\n```\n\n#### Functions\n\n``` python\n@patch\ndef arbitrary(\n self:TailwindBuilder,\n prefix: str, # CSS utility prefix (e.g., 'p', 'w', 'text')\n value: str, # Arbitrary value (e.g., '23px', '#1da1f2', 'calc(100%-1rem)')\n suffix: Optional[str] = None # Optional suffix (e.g., for p-[20px]/50)\n) -> Union[str, Self]: # Arbitrary value utility class string or self for chaining\n \"\"\"\n Generate arbitrary value utility class.\n \n Examples:\n tw.arbitrary('w', '23px') # Returns 'w-[23px]'\n tw.arbitrary('bg', '#1da1f2') # Returns 'bg-[#1da1f2]'\n tw.arbitrary('p', '20px', '50') # Returns 'p-[20px]/50'\n \"\"\"\n```\n\n``` python\n@patch\ndef util(\n self:TailwindBuilder,\n *classes: str # Raw Tailwind utility classes to add\n) -> Union[str, Self]: # Utility classes string or self for chaining\n \"\"\"\n Add raw Tailwind utility classes without validation.\n \n This method allows adding any Tailwind utility classes directly,\n useful for custom utilities, newer Tailwind features, or third-party plugins.\n \n Args:\n *classes: One or more Tailwind utility class strings\n \n Returns:\n Combined utility classes string or self for chaining\n \n Examples:\n tw.util('backdrop-blur-sm') # Returns 'backdrop-blur-sm'\n tw.util('animate-fade-in', 'will-change-transform') # Returns 'animate-fade-in will-change-transform'\n tw.chain().util('custom-utility').p(4) # Chainable\n \"\"\"\n```\n\n``` python\n@patch\ndef add_class(\n self:TailwindBuilder,\n class_str: str # TODO: Add description\n) -> Self: # TODO: Add return description\n \"Add arbitrary class string (only available in chain mode).\"\n```\n\n``` python\n@patch\ndef build(\n self:TailwindBuilder\n) -> str: # TODO: Add return description\n \"Build and return the final class string (only available in chain mode).\"\n```\n\n``` python\n@patch\ndef __str__(\n self:TailwindBuilder\n) -> str: # TODO: Add return description\n \"String representation.\"\n```\n\n``` python\n@patch\ndef __repr__(\n self:TailwindBuilder\n) -> str: # TODO: Add return description\n \"Representation.\"\n```\n\n``` python\n@patch\ndef merge(\n self:TailwindBuilder,\n *class_strings: str,\n dedupe: bool = True # Whether to deduplicate conflicting classes (default: True)\n) -> str: # Merged class string\n \"Merge multiple class strings into one, with optional deduplication. This is a utility method that doesn't require chain mode.\"\n```\n\n``` python\n@patch\ndef chain(self:TailwindBuilder, *classes: str, dedupe: bool = True) -> Self: # Chainable TailwindBuilder instance\n \"\"\"Create a chainable builder instance with optional starting classes.\n \n Args:\n *classes: Optional initial classes to add\n dedupe: Whether to deduplicate conflicting classes (default: True)\n \n Returns:\n A new chainable TailwindBuilder instance\n \"\"\"\n builder = TailwindBuilder(_chain_mode=True, dedupe=dedupe)\n if classes\n \"\"\"\n Create a chainable builder instance with optional starting classes.\n \n Args:\n *classes: Optional initial classes to add\n dedupe: Whether to deduplicate conflicting classes (default: True)\n \n Returns:\n A new chainable TailwindBuilder instance\n \"\"\"\n```\n\n``` python\n@patch\ndef _spacing_class(\n self:TailwindBuilder,\n prefix: str, # CSS class prefix (e.g., 'p', 'mx', 'gap')\n value: Union[SpacingValue, str] # Spacing value to format\n) -> str: # Complete CSS class string\n \"Build spacing utility class.\"\n```\n\n``` python\n@patch\ndef _size_class(\n self:TailwindBuilder,\n prefix: str, # CSS class prefix (e.g., 'w', 'h', 'max-w')\n value: Union[SizeValue, str] # Size value to format\n) -> str: # Complete CSS class string\n \"Build size utility class.\"\n```\n\n``` python\ndef _format_spacing_value(\n value: SpacingValue # Spacing value to format (numeric or string)\n) -> str: # Formatted string for CSS class name\n \"Format spacing value for class name.\"\n```\n\n#### Classes\n\n``` python\nclass TailwindBuilder:\n def __init__(\n self,\n _chain_mode: bool = False, # TODO: Add description\n dedupe: bool = True # TODO: Add description\n )\n \"\"\"\n Dynamic Tailwind CSS utility class builder with full type safety and chainable API.\n \n This builder provides methods for generating Tailwind utility classes with proper type hints\n and validation. It supports both direct string returns and chainable fluent API.\n \n Usage:\n tw.p(4) # Returns \"p-4\" \n tw.chain().p(4).bg(\"blue-500\") # Returns chainable builder\n \"\"\"\n \n def __init__(\n self,\n _chain_mode: bool = False, # TODO: Add description\n dedupe: bool = True # TODO: Add description\n )\n \"Initialize builder.\n\nArgs:\n _chain_mode: Internal flag for chainable mode\n dedupe: Whether to deduplicate conflicting classes (default: True)\"\n```\n\n#### Variables\n\n``` python\ntw # Global instance of TailwindBuilder for convenience\n```\n\n### Layout (`layout.ipynb`)\n\n> Layout utilities for spacing (padding, margin), sizing (width,\n> height), positioning, flexbox, and grid. Essential for component\n> structure and spacing.\n\n#### Import\n\n``` python\nfrom cjm_tailwind_utils.layout import *\n```\n\n#### Functions\n\n``` python\n@patch\ndef p(\n self:TailwindBuilder,\n value: Union[SpacingValue, str], # Spacing value or arbitrary value string\n side: Optional[Literal[\"t\", \"r\", \"b\", \"l\", \"x\", \"y\"]] = None # Optional side specification\n) -> Union[str, Self]: # Padding utility class string or self for chaining\n \"Generate padding utility class with arbitrary value support and validation.\"\n```\n\n``` python\n@patch\ndef m(\n self:TailwindBuilder,\n value: Union[SpacingValue, str], # Spacing value or arbitrary value string\n side: Optional[Literal[\"t\", \"r\", \"b\", \"l\", \"x\", \"y\"]] = None, # Optional side specification\n negative: bool = False # Whether to apply negative value\n) -> Union[str, Self]: # Margin utility class string or self for chaining\n \"\"\"\n Generate margin utility class with arbitrary value support, validation, and negative values.\n \n Args:\n value: Spacing value or arbitrary value string\n side: Optional side specification ('t', 'r', 'b', 'l', 'x', 'y')\n negative: Whether to apply negative margin (default: False)\n \n Returns:\n Margin utility class string or self for chaining\n \n Examples:\n tw.m(4) # 'm-4'\n tw.m(4, negative=True) # '-m-4'\n tw.m(4, 'x', negative=True) # '-mx-4'\n \"\"\"\n```\n\n``` python\n@patch\ndef gap(\n self:TailwindBuilder,\n value: Union[SpacingValue, str], # Spacing value or arbitrary value string\n axis: Optional[Literal[\"x\", \"y\"]] = None # Optional axis specification\n) -> Union[str, Self]: # Gap utility class string or self for chaining\n \"Generate gap utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef space(\n self:TailwindBuilder,\n value: Union[SpacingValue, str], # Spacing value or arbitrary value string\n axis: Literal[\"x\", \"y\"] # Axis for spacing\n) -> Union[str, Self]: # Space utility class string or self for chaining\n \"Generate space between utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef w(\n self:TailwindBuilder,\n value: Union[SizeValue, str], # Size value or arbitrary value string\n important: bool = False # Whether to add !important modifier\n) -> Union[str, Self]: # Width utility class string or self for chaining\n \"Generate width utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef h(\n self:TailwindBuilder,\n value: Union[SizeValue, str], # Size value or arbitrary value string\n important: bool = False # Whether to add !important modifier\n) -> Union[str, Self]: # Height utility class string or self for chaining\n \"Generate height utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef size(\n self:TailwindBuilder,\n value: Union[SizeValue, str] # Size value or arbitrary value string\n) -> Union[str, Self]: # Size utility class string or self for chaining\n \"Generate size utility class (sets both width and height) with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef min_w(\n self:TailwindBuilder,\n value: Union[SizeValue, str] # Size value or arbitrary value string\n) -> Union[str, Self]: # Min-width utility class string or self for chaining\n \"Generate min-width utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef max_w(\n self:TailwindBuilder,\n value: Union[SizeValue, str, Literal[\"xs\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\", \"3xl\", \"4xl\", \"5xl\", \"6xl\", \"7xl\", \"prose\"]] # Size value, arbitrary value, or named size\n) -> Union[str, Self]: # Max-width utility class string or self for chaining\n \"Generate max-width utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef min_h(\n self:TailwindBuilder,\n value: Union[SizeValue, str] # Size value or arbitrary value string\n) -> Union[str, Self]: # Min-height utility class string or self for chaining\n \"Generate min-height utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef max_h(\n self:TailwindBuilder,\n value: Union[SizeValue, str] # Size value or arbitrary value string\n) -> Union[str, Self]: # Max-height utility class string or self for chaining\n \"Generate max-height utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef position(\n self:TailwindBuilder,\n value: Literal[\"static\", \"fixed\", \"absolute\", \"relative\", \"sticky\"] # Position type\n) -> Union[str, Self]: # Position utility class string or self for chaining\n \"Generate position utility class.\"\n```\n\n``` python\n@patch\ndef inset(\n self:TailwindBuilder,\n value: Union[SpacingValue, str], # Inset value or arbitrary value string\n side: Optional[Literal[\"top\", \"right\", \"bottom\", \"left\", \"x\", \"y\"]] = None, # Optional side specification\n negative: bool = False # Whether to apply negative value\n) -> Union[str, Self]: # Inset utility class string or self for chaining\n \"\"\"\n Generate inset (top/right/bottom/left) utility class with arbitrary value support and negative values.\n \n Args:\n value: Inset value or arbitrary value string\n side: Optional side specification ('top', 'right', 'bottom', 'left', 'x', 'y')\n negative: Whether to apply negative inset (default: False)\n \n Returns:\n Inset utility class string or self for chaining\n \n Examples:\n tw.inset(4) # 'inset-4'\n tw.inset(4, 'top') # 'top-4'\n tw.inset(4, 'x', negative=True) # '-inset-x-4'\n \"\"\"\n```\n\n``` python\n@patch\ndef z(\n self:TailwindBuilder,\n value: Union[ZIndexValue, int, str] # Z-index value, integer, or arbitrary value string\n) -> Union[str, Self]: # Z-index utility class string or self for chaining\n \"Generate z-index utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef display(\n self:TailwindBuilder,\n value: Literal[\"block\", \"inline-block\", \"inline\", \"flex\", \"inline-flex\", \"table\", \"inline-table\", \"table-caption\", \"table-cell\", \"table-column\", \"table-column-group\", \"table-footer-group\", \"table-header-group\", \"table-row-group\", \"table-row\", \"flow-root\", \"grid\", \"inline-grid\", \"contents\", \"list-item\", \"hidden\"] # Display type\n) -> Union[str, Self]: # Display utility class string or self for chaining\n \"Generate display utility class.\"\n```\n\n``` python\n@patch\ndef flex(self:TailwindBuilder, \n direction: Optional[Literal[\"row\", \"row-reverse\", \"col\", \"col-reverse\"]] = None,\n wrap: Optional[Literal[\"wrap\", \"wrap-reverse\", \"nowrap\"]] = None,\n grow: Optional[Literal[0, 1]] = None,\n shrink: Optional[Literal[0, 1]] = None,\n basis: Optional[Union[SizeValue, str]] = None) -> Union[str, Self]\n \"Generate flex utility classes with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef items(\n self:TailwindBuilder,\n value: Literal[\"start\", \"end\", \"center\", \"baseline\", \"stretch\"] # Alignment value for flex/grid items\n) -> Union[str, Self]: # Align-items utility class string or self for chaining\n \"Generate align-items utility class.\"\n```\n\n``` python\n@patch\ndef justify(\n self:TailwindBuilder,\n value: Literal[\"normal\", \"start\", \"end\", \"center\", \"between\", \"around\", \"evenly\", \"stretch\"] # Justify-content value\n) -> Union[str, Self]: # Justify-content utility class string or self for chaining\n \"Generate justify-content utility class.\"\n```\n\n``` python\n@patch\ndef align(\n self:TailwindBuilder,\n value: Literal[\"auto\", \"start\", \"end\", \"center\", \"stretch\", \"baseline\"] # Align-self value\n) -> Union[str, Self]: # Align-self utility class string or self for chaining\n \"Generate align-self utility class.\"\n```\n\n``` python\n@patch\ndef grid(self:TailwindBuilder, \n cols: Optional[Union[int, Literal[\"none\"], str]] = None,\n rows: Optional[Union[int, Literal[\"none\"], str]] = None,\n flow: Optional[Literal[\"row\", \"col\", \"dense\", \"row-dense\", \"col-dense\"]] = None) -> Union[str, Self]\n \"Generate grid utility classes with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef col(\n self:TailwindBuilder,\n span: Union[int, Literal[\"auto\", \"full\"]], # Number of columns to span or keyword\n start: Optional[int] = None # Starting column number\n) -> Union[str, Self]: # Grid column utility class string or self for chaining\n \"Generate grid column utility classes.\"\n```\n\n``` python\n@patch\ndef row(\n self:TailwindBuilder,\n span: Union[int, Literal[\"auto\", \"full\"]], # Number of rows to span or keyword\n start: Optional[int] = None # Starting row number\n) -> Union[str, Self]: # Grid row utility class string or self for chaining\n \"Generate grid row utility classes.\"\n```\n\n### Modern (`modern.ipynb`)\n\n> Tailwind v4+ features including container queries, `:has()`\n> pseudo-class, and `@supports`. Optional module for cutting-edge CSS\n> features.\n\n#### Import\n\n``` python\nfrom cjm_tailwind_utils.modern import *\n```\n\n#### Functions\n\n``` python\n@patch\ndef container_query(\n self:TailwindBuilder,\n name: Optional[str] = None # Optional container name\n) -> Union[str, Self]: # Container query class string or self for chaining\n \"\"\"\n Add container query support for container queries.\n \n Examples:\n tw.container_query() # @container\n tw.container_query('sidebar') # @container/sidebar\n \"\"\"\n```\n\n``` python\n@patch\ndef cq(\n self:TailwindBuilder,\n size: Union[str, int], # Container size (e.g., 'sm', 'md', '300px', 20)\n *classes: str # Classes to apply at container size\n) -> Union[str, Self]: # Container query classes string or self for chaining\n \"\"\"\n Add container query size variant to classes.\n \n Examples:\n tw.cq('md', 'flex', 'gap-4') # @md:flex @md:gap-4\n tw.cq('300px', 'grid-cols-2') # @[300px]:grid-cols-2\n tw.cq(20, 'text-lg') # @[20rem]:text-lg (numeric values treated as rem)\n \"\"\"\n```\n\n``` python\n@patch\ndef has(\n self:TailwindBuilder,\n selector: str, # Selector to check for (e.g., 'hover', '[disabled]')\n *classes: str # Classes to apply when selector matches\n) -> Union[str, Self]: # Has pseudo-class classes string or self for chaining\n \"\"\"\n Add :has() pseudo-class support.\n \n Examples:\n tw.has('[disabled]', 'opacity-50') # has-[[disabled]]:opacity-50\n tw.has('hover', 'shadow-lg') # has-[hover]:shadow-lg\n \"\"\"\n```\n\n``` python\n@patch\ndef supports(\n self:TailwindBuilder,\n feature: str, # CSS feature to check support for\n *classes: str # Classes to apply when feature is supported\n) -> Union[str, Self]: # Feature query classes string or self for chaining\n \"\"\"\n Add @supports feature query support.\n \n Examples:\n tw.supports('grid', 'grid', 'grid-cols-3') # supports-[grid]:grid supports-[grid]:grid-cols-3\n tw.supports('backdrop-filter', 'backdrop-blur-sm')\n \"\"\"\n```\n\n``` python\n@patch\ndef data(\n self:TailwindBuilder,\n attribute: str, # Data attribute to check (without data- prefix)\n value: Optional[str] = None, # Optional value to match\n *classes: str # Classes to apply when data attribute matches\n) -> Union[str, Self]: # Data attribute classes string or self for chaining\n \"\"\"\n Add data attribute selector support.\n \n Examples:\n tw.data('open', None, 'block') # data-[open]:block\n tw.data('state', 'active', 'bg-blue-500') # data-[state=active]:bg-blue-500\n \"\"\"\n```\n\n### Style (`style.ipynb`)\n\n> Visual styling utilities for typography, backgrounds, borders,\n> shadows, and effects. Depends on colors module for color validation.\n\n#### Import\n\n``` python\nfrom cjm_tailwind_utils.style import *\n```\n\n#### Functions\n\n``` python\n@patch\ndef text(self:TailwindBuilder, \n size: Optional[Union[Literal[\"xs\", \"sm\", \"base\", \"lg\", \"xl\", \"2xl\", \"3xl\", \"4xl\", \"5xl\", \"6xl\", \"7xl\", \"8xl\", \"9xl\"], str]] = None,\n align: Optional[Literal[\"left\", \"center\", \"right\", \"justify\", \"start\", \"end\"]] = None,\n weight: Optional[Literal[\"thin\", \"extralight\", \"light\", \"normal\", \"medium\", \"semibold\", \"bold\", \"extrabold\", \"black\"]] = None,\n color: Optional[Union[ColorValue, str]] = None) -> Union[str, Self]\n \"Generate text utility classes with color validation and arbitrary value support.\"\n```\n\n``` python\n@patch\ndef font(\n self:TailwindBuilder,\n family: Union[Literal[\"sans\", \"serif\", \"mono\"], str] # Font family type or arbitrary value\n) -> Union[str, Self]: # Font family utility class string or self for chaining\n \"Generate font family utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef leading(\n self:TailwindBuilder,\n value: Union[Literal[\"none\", \"tight\", \"snug\", \"normal\", \"relaxed\", \"loose\"], int, str] # Line height value or arbitrary value\n) -> Union[str, Self]: # Line-height utility class string or self for chaining\n \"Generate line-height utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef tracking(\n self:TailwindBuilder,\n value: Union[Literal[\"tighter\", \"tight\", \"normal\", \"wide\", \"wider\", \"widest\"], str] # Letter spacing value or arbitrary value\n) -> Union[str, Self]: # Letter-spacing utility class string or self for chaining\n \"Generate letter-spacing utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef bg(\n self:TailwindBuilder,\n color: Union[ColorValue, str], # Background color value or arbitrary value\n opacity: Optional[OpacityValue] = None # Optional opacity value (0-100)\n) -> Union[str, Self]: # Background color utility class string or self for chaining\n \"Generate background color utility class with validation and arbitrary value support.\"\n```\n\n``` python\n@patch\ndef border(self:TailwindBuilder, \n width: Optional[Union[Literal[0, 2, 4, 8], Literal[\"\"], str]] = \"\",\n side: Optional[Literal[\"t\", \"r\", \"b\", \"l\", \"x\", \"y\"]] = None,\n color: Optional[Union[ColorValue, str]] = None, # Border color value or arbitrary value\n style: Optional[Literal[\"solid\", \"dashed\", \"dotted\", \"double\", \"hidden\", \"none\"]] = None) -> Union[str, Self]\n \"Generate border utility classes with color validation and arbitrary value support.\"\n```\n\n``` python\n@patch\ndef rounded(self:TailwindBuilder, \n size: Optional[Union[Literal[\"none\", \"sm\", \"\", \"md\", \"lg\", \"xl\", \"2xl\", \"3xl\", \"full\"], str]] = \"\",\n side: Optional[Literal[\"t\", \"r\", \"b\", \"l\", \"tl\", \"tr\", \"br\", \"bl\"]] = None) -> Union[str, Self]\n \"Generate border-radius utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef shadow(\n self:TailwindBuilder,\n size: Optional[Union[Literal[\"sm\", \"\", \"md\", \"lg\", \"xl\", \"2xl\", \"inner\", \"none\"], str]] = \"\" # Shadow size or arbitrary value\n) -> Union[str, Self]: # Box-shadow utility class string or self for chaining\n \"Generate box-shadow utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef opacity(\n self:TailwindBuilder,\n value: Union[OpacityValue, int, float, str] # Opacity value or arbitrary value\n) -> Union[str, Self]: # Opacity utility class string or self for chaining\n \"Generate opacity utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef overflow(self:TailwindBuilder, \n value: Literal[\"auto\", \"hidden\", \"clip\", \"visible\", \"scroll\"],\n axis: Optional[Literal[\"x\", \"y\"]] = None) -> Union[str, Self]\n \"Generate overflow utility class.\"\n```\n\n``` python\n@patch\ndef object(self:TailwindBuilder, \n fit: Optional[Literal[\"contain\", \"cover\", \"fill\", \"none\", \"scale-down\"]] = None,\n position: Optional[Union[Literal[\"bottom\", \"center\", \"left\", \"left-bottom\", \"left-top\", \"right\", \"right-bottom\", \"right-top\", \"top\"], str]] = None) -> Union[str, Self]\n \"Generate object-fit and object-position utility classes with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef cursor(\n self:TailwindBuilder,\n value: Union[Literal[\"auto\", \"default\", \"pointer\", \"wait\", \"text\", \"move\", \"help\", \"not-allowed\", \"none\", \"context-menu\", \"progress\", \"cell\", \"crosshair\", \"vertical-text\", \"alias\", \"copy\", \"no-drop\", \"grab\", \"grabbing\", \"all-scroll\", \"col-resize\", \"row-resize\", \"n-resize\", \"e-resize\", \"s-resize\", \"w-resize\", \"ne-resize\", \"nw-resize\", \"se-resize\", \"sw-resize\", \"ew-resize\", \"ns-resize\", \"nesw-resize\", \"nwse-resize\", \"zoom-in\", \"zoom-out\"], str] # Cursor type or arbitrary value\n) -> Union[str, Self]: # Cursor utility class string or self for chaining\n \"Generate cursor utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef transition(self:TailwindBuilder, \n property: Optional[Literal[\"none\", \"all\", \"\", \"colors\", \"opacity\", \"shadow\", \"transform\"]] = \"\",\n duration: Optional[Union[Literal[75, 100, 150, 200, 300, 500, 700, 1000], int, str]] = None,\n timing: Optional[Union[Literal[\"linear\", \"in\", \"out\", \"in-out\"], str]] = None,\n delay: Optional[Union[int, str]] = None) -> Union[str, Self]\n \"Generate transition utility classes with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef animate(\n self:TailwindBuilder,\n value: Union[Literal[\"none\", \"spin\", \"ping\", \"pulse\", \"bounce\"], str] # Animation type or arbitrary value\n) -> Union[str, Self]: # Animation utility class string or self for chaining\n \"Generate animation utility class with arbitrary value support.\"\n```\n\n``` python\n@patch\ndef transform(self:TailwindBuilder, \n scale: Optional[Union[Literal[0, 50, 75, 90, 95, 100, 105, 110, 125, 150], Tuple[Literal[\"x\", \"y\"], Union[Literal[0, 50, 75, 90, 95, 100, 105, 110, 125, 150], str]], str]] = None,\n rotate: Optional[Union[Literal[0, 1, 2, 3, 6, 12, 45, 90, 180], Literal[\"-1\", \"-2\", \"-3\", \"-6\", \"-12\", \"-45\", \"-90\", \"-180\"], str]] = None,\n translate: Optional[Union[Tuple[Literal[\"x\", \"y\"], Union[SpacingValue, str, Tuple[Union[SpacingValue, str], bool]]], str]] = None) -> Union[str, Self]\n \"Generate transform utility classes with arbitrary value support and negative translate.\"\n```\n\n``` python\n@patch\ndef container(\n self:TailwindBuilder,\n center: bool = True, # Whether to center the container with mx-auto\n padding: Optional[SpacingValue] = None # Optional padding to add\n) -> Union[str, Self]: # Container utility classes string or self for chaining\n \"Generate container utility classes.\"\n```\n\n``` python\n@patch\ndef stack(\n self:TailwindBuilder,\n gap: SpacingValue = 4 # Gap between stacked items\n) -> Union[str, Self]: # Flex stack utility classes string or self for chaining\n \"Generate flex stack utility classes.\"\n```\n\n``` python\n@patch\ndef center(\n self:TailwindBuilder,\n method: Literal[\"flex\", \"grid\", \"absolute\"] = \"flex\" # Centering method to use\n) -> Union[str, Self]: # Centering utility classes string or self for chaining\n \"Generate centering utility classes.\"\n```\n\n``` python\n@patch\ndef prose(\n self:TailwindBuilder,\n size: Optional[Literal[\"sm\", \"\", \"lg\", \"xl\", \"2xl\"]] = \"\" # Prose size variant\n) -> Union[str, Self]: # Prose utility classes string or self for chaining\n \"Generate prose (typography) utility classes.\"\n```\n\n``` python\n@patch\ndef sr_only(\n self:TailwindBuilder\n) -> Union[str, Self]: # Screen reader only class string or self for chaining\n \"Generate screen reader only utility class.\"\n```\n\n``` python\n@patch\ndef not_sr_only(\n self:TailwindBuilder\n) -> Union[str, Self]: # Not screen reader only class string or self for chaining\n \"Generate not screen reader only utility class.\"\n```\n\n### Type Definitions (`types.ipynb`)\n\n> Type definitions for Tailwind values (spacing, colors, sizes, etc.).\n> Import only when you need type hints for better IDE support and type\n> checking.\n\n#### Import\n\n``` python\nfrom cjm_tailwind_utils.types import (\n SpacingValue,\n FractionValue,\n SizeValue,\n OpacityValue,\n ZIndexValue,\n BaseColor,\n ColorShade,\n SpecialColor,\n ColorValue\n)\n```\n\n#### Variables\n\n``` python\nSpacingValue # Extended spacing scale with new values from Tailwind v4\nFractionValue # Fraction values\nSizeValue # Common size values\nOpacityValue # Color opacity values\nZIndexValue # Z-index values\nBaseColor # Base color names from Tailwind CSS color palette\nColorShade # Standard color shade values\nSpecialColor # Special color keywords\nColorValue # Complete color value type\n```\n\n### Validation (`validation.ipynb`)\n\n> Validation functions and error handling for Tailwind utilities.\n> Internal module - typically not imported directly unless creating\n> custom utilities.\n\n#### Import\n\n``` python\nfrom cjm_tailwind_utils.validation import (\n VALID_SPACING_VALUES,\n VALID_SPACING_STRINGS,\n CONFLICTING_GROUPS,\n TailwindBuilderError,\n InvalidValueError,\n InvalidColorError,\n ChainModeError,\n validate_spacing_value,\n validate_opacity_value,\n extract_modifiers,\n extract_class_prefix,\n get_conflicting_group,\n should_replace_class\n)\n```\n\n#### Functions\n\n``` python\ndef validate_spacing_value(\n value: Any, # The value to validate\n allow_negative: bool = False # Whether to allow negative values\n) -> None: # TODO: Add return description\n \"Validate a spacing value.\"\n```\n\n``` python\ndef validate_opacity_value(\n value: Any # The opacity value to validate\n) -> None: # TODO: Add return description\n \"Validate an opacity value.\"\n```\n\n``` python\ndef extract_modifiers(\n class_str: str # TODO: Add description\n) -> Tuple[str, str]: # Tuple of (modifiers, base_class) where modifiers is like 'hover:dark:' or ''\n \"Extract modifiers and base class from a utility class.\"\n```\n\n``` python\ndef extract_class_prefix(\n class_str: str # TODO: Add description\n) -> str: # TODO: Add return description\n \"\"\"\n Extract the prefix from a utility class.\n \n Examples:\n 'p-4' -> 'p'\n 'hover:bg-blue-500' -> 'bg'\n 'sm:p-4' -> 'p'\n 'dark:hover:text-white' -> 'text'\n 'px-6' -> 'px'\n 'flex' -> 'flex'\n 'flex-wrap' -> 'flex-wrap'\n \"\"\"\n```\n\n``` python\ndef get_conflicting_group(\n prefix: str # TODO: Add description\n) -> Optional[str]: # TODO: Add return description\n \"\"\"\n Get the conflicting group for a given prefix.\n \n Returns the group name if the prefix belongs to a conflicting group,\n None otherwise.\n \"\"\"\n```\n\n``` python\ndef should_replace_class(\n existing_class: str, # TODO: Add description\n new_class: str # TODO: Add description\n) -> bool: # TODO: Add return description\n \"\"\"\n Determine if new_class should replace existing_class.\n \n Returns True if they belong to the same conflicting group and should be replaced.\n \"\"\"\n```\n\n#### Classes\n\n``` python\nclass TailwindBuilderError(Exception):\n \"Base exception for TailwindBuilder errors.\"\n```\n\n``` python\nclass InvalidValueError(TailwindBuilderError):\n \"Raised when an invalid value is provided to a utility method.\"\n```\n\n``` python\nclass InvalidColorError(TailwindBuilderError):\n \"Raised when an invalid color value is provided.\"\n```\n\n``` python\nclass ChainModeError(TailwindBuilderError):\n \"Raised when chain-mode specific methods are called in direct mode.\"\n```\n\n#### Variables\n\n``` python\nVALID_SPACING_VALUES # Valid spacing values including decimals\nVALID_SPACING_STRINGS # Valid spacing strings\nCONFLICTING_GROUPS: Dict[str, Tuple[str, ...]]\n```\n\n### Variants (`variants.ipynb`)\n\n> State variants (hover, focus), responsive breakpoints (sm, md, lg),\n> dark mode, and modifier utilities. Add interactivity and\n> responsiveness to components.\n\n#### Import\n\n``` python\nfrom cjm_tailwind_utils.variants import *\n```\n\n#### Functions\n\n``` python\n@patch\ndef hover(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Hover state classes string or self for chaining\n \"Add hover state variant to classes.\"\n```\n\n``` python\n@patch\ndef focus(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Focus state classes string or self for chaining\n \"Add focus state variant to classes.\"\n```\n\n``` python\n@patch\ndef active(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Active state classes string or self for chaining\n \"Add active state variant to classes.\"\n```\n\n``` python\n@patch\ndef disabled(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Disabled state classes string or self for chaining\n \"Add disabled state variant to classes.\"\n```\n\n``` python\n@patch\ndef sm(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Small screen responsive classes string or self for chaining\n \"Add small screen variant to classes.\"\n```\n\n``` python\n@patch\ndef md(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Medium screen responsive classes string or self for chaining\n \"Add medium screen variant to classes.\"\n```\n\n``` python\n@patch\ndef lg(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Large screen responsive classes string or self for chaining\n \"Add large screen variant to classes.\"\n```\n\n``` python\n@patch\ndef xl(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Extra large screen responsive classes string or self for chaining\n \"Add extra large screen variant to classes.\"\n```\n\n``` python\n@patch\ndef xxl(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # 2XL screen responsive classes string or self for chaining\n \"Add 2xl screen variant to classes.\"\n```\n\n``` python\n@patch\ndef dark(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Dark mode classes string or self for chaining\n \"Add dark mode variant to classes.\"\n```\n\n``` python\n@patch\ndef group_hover(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Group hover classes string or self for chaining\n \"Add group-hover variant to classes.\"\n```\n\n``` python\n@patch\ndef peer_hover(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Peer hover classes string or self for chaining\n \"Add peer-hover variant to classes.\"\n```\n\n``` python\n@patch\ndef modifiers(\n self:TailwindBuilder,\n *modifiers: str,\n classes: Union[str, List[str]]\n) -> Union[str, Self]: # Modified classes string or self for chaining\n \"\"\"\n Apply multiple modifiers to classes with support for stacking.\n \n Examples:\n tw.modifiers('dark', 'hover', classes='bg-blue-500') # dark:hover:bg-blue-500\n tw.modifiers('sm', 'dark', classes=['bg-white', 'text-black'])\n tw.modifiers('group-hover', 'lg', classes=tw.bg('blue-500'))\n \"\"\"\n```\n\n``` python\n@patch\ndef first(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # First child classes string or self for chaining\n \"Add first-child variant to classes.\"\n```\n\n``` python\n@patch\ndef last(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Last child classes string or self for chaining\n \"Add last-child variant to classes.\"\n```\n\n``` python\n@patch\ndef even(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Even child classes string or self for chaining\n \"Add even-child variant to classes.\"\n```\n\n``` python\n@patch\ndef odd(\n self:TailwindBuilder,\n *classes: str\n) -> Union[str, Self]: # Odd child classes string or self for chaining\n \"Add odd-child variant to classes.\"\n```\n\n``` python\n@patch\ndef group(\n self:TailwindBuilder\n) -> Union[str, Self]: # Group class string or self for chaining\n \"Add group class for group-hover and similar variants.\"\n```\n\n``` python\n@patch\ndef peer(\n self:TailwindBuilder\n) -> Union[str, Self]: # Peer class string or self for chaining\n \"Add peer class for peer-hover and similar variants.\"\n```\n",
"bugtrack_url": null,
"license": "Apache Software License 2.0",
"summary": "Type-safe, chainable Tailwind CSS class builder with validation, deduplication, and modern CSS support.",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/cj-mills/cjm-tailwind-utils"
},
"split_keywords": [
"nbdev",
"jupyter",
"notebook",
"python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "f5a06fda99e224082fd0086c94adcf1f82f98a7cb870e64a70ae9fc6a4f43911",
"md5": "a081c4e38c74e830cb65ee650a4c470f",
"sha256": "e1572b9ce12221be0ebeed1fce1b6225f9f11cfc6dcd108d91e29b2e2bd54135"
},
"downloads": -1,
"filename": "cjm_tailwind_utils-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a081c4e38c74e830cb65ee650a4c470f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 35622,
"upload_time": "2025-07-15T17:20:15",
"upload_time_iso_8601": "2025-07-15T17:20:15.820005Z",
"url": "https://files.pythonhosted.org/packages/f5/a0/6fda99e224082fd0086c94adcf1f82f98a7cb870e64a70ae9fc6a4f43911/cjm_tailwind_utils-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d069dc365a9cea839d41966a7d438924603efab3fb949898fa225011b908479c",
"md5": "98602b5e9a5b0127c886666a0c690e12",
"sha256": "2cd7135bf53914312aa136d871d640d714338c46991ca278e3eab3fd60ffa14a"
},
"downloads": -1,
"filename": "cjm_tailwind_utils-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "98602b5e9a5b0127c886666a0c690e12",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 46992,
"upload_time": "2025-07-15T17:20:17",
"upload_time_iso_8601": "2025-07-15T17:20:17.247815Z",
"url": "https://files.pythonhosted.org/packages/d0/69/dc365a9cea839d41966a7d438924603efab3fb949898fa225011b908479c/cjm_tailwind_utils-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-15 17:20:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cj-mills",
"github_project": "cjm-tailwind-utils",
"github_not_found": true,
"lcname": "cjm-tailwind-utils"
}