ClassBuilder

Struct ClassBuilder 

Source
pub struct ClassBuilder { /* private fields */ }
Expand description

Builder for creating class sets

Implementations§

Source§

impl ClassBuilder

Source

pub fn new() -> Self

Create a new class builder

Source

pub fn class(self, class: impl Into<String>) -> Self

Add a base class

Source

pub fn classes(self, classes: impl IntoIterator<Item = String>) -> Self

Add multiple base classes

Source

pub fn responsive( self, breakpoint: Breakpoint, class: impl Into<String>, ) -> Self

Add a responsive class

Source

pub fn conditional( self, condition: impl Into<String>, class: impl Into<String>, ) -> Self

Add a conditional class

Source

pub fn custom( self, property: impl Into<String>, value: impl Into<String>, ) -> Self

Add a custom CSS property

Source

pub fn custom_variant( self, variant: impl Into<String>, class: impl Into<String>, ) -> Self

Add a custom variant class (Tailwind v4.1.13 @custom-variant support)

Source

pub fn aria( self, aria_attr: impl Into<String>, class: impl Into<String>, ) -> Self

Add an ARIA variant class

Source

pub fn data( self, data_attr: impl Into<String>, value: Option<String>, class: impl Into<String>, ) -> Self

Add a data variant class

Source

pub fn supports( self, feature: impl Into<String>, class: impl Into<String>, ) -> Self

Add a supports variant class

Source

pub fn build(self) -> ClassSet

Build the class set

Source

pub fn build_string(self) -> String

Build the class set and convert to CSS string

Trait Implementations§

Source§

impl AlignContentUtilities for ClassBuilder

Source§

fn align_content(self, align: AlignContent) -> Self

Source§

impl AlignItemsUtilities for ClassBuilder

Source§

fn align_items(self, align: AlignItems) -> Self

Source§

impl AlignSelfUtilities for ClassBuilder

Source§

fn align_self(self, align: AlignSelf) -> Self

Source§

impl BackgroundAttachmentUtilities for ClassBuilder

Source§

impl BackgroundBlendModeUtilities for ClassBuilder

Source§

impl BackgroundClipUtilities for ClassBuilder

Source§

fn background_clip(self, clip: BackgroundClip) -> Self

Source§

impl BackgroundColorUtilities for ClassBuilder

Source§

fn background_color(self, color: Color) -> Self

Source§

fn background_transparent(self) -> Self

Source§

fn background_current(self) -> Self

Source§

fn background_black(self) -> Self

Source§

fn background_white(self) -> Self

Source§

impl BackgroundImageUtilities for ClassBuilder

Source§

fn background_image(self, image: BackgroundImage) -> Self

Source§

impl BackgroundOriginUtilities for ClassBuilder

Source§

impl BackgroundPositionUtilities for ClassBuilder

Source§

impl BackgroundRepeatUtilities for ClassBuilder

Source§

impl BackgroundSizeUtilities for ClassBuilder

Source§

fn background_size(self, size: BackgroundSize) -> Self

Source§

impl BlurUtilities for ClassBuilder

Source§

fn blur(self, blur: Blur) -> Self

Source§

impl BorderColorUtilities for ClassBuilder

Source§

fn border_color(self, color: Color) -> Self

Source§

fn border_transparent(self) -> Self

Source§

fn border_current(self) -> Self

Source§

fn border_black(self) -> Self

Source§

fn border_white(self) -> Self

Source§

impl BorderRadiusUtilities for ClassBuilder

Source§

fn border_radius(self, radius: BorderRadius) -> Self

Source§

fn border_radius_t(self, radius: BorderRadius) -> Self

Source§

fn border_radius_r(self, radius: BorderRadius) -> Self

Source§

fn border_radius_b(self, radius: BorderRadius) -> Self

Source§

fn border_radius_l(self, radius: BorderRadius) -> Self

Source§

fn border_radius_tl(self, radius: BorderRadius) -> Self

Source§

fn border_radius_tr(self, radius: BorderRadius) -> Self

Source§

fn border_radius_br(self, radius: BorderRadius) -> Self

Source§

fn border_radius_bl(self, radius: BorderRadius) -> Self

Source§

impl BorderStyleUtilities for ClassBuilder

Source§

fn border_style(self, style: BorderStyle) -> Self

Source§

impl BorderWidthUtilities for ClassBuilder

Source§

fn border_width(self, width: BorderWidth) -> Self

Source§

fn border_width_x(self, width: BorderWidth) -> Self

Source§

fn border_width_y(self, width: BorderWidth) -> Self

Source§

fn border_width_t(self, width: BorderWidth) -> Self

Source§

fn border_width_r(self, width: BorderWidth) -> Self

Source§

fn border_width_b(self, width: BorderWidth) -> Self

Source§

fn border_width_l(self, width: BorderWidth) -> Self

Source§

impl BoxShadowUtilities for ClassBuilder

Source§

fn box_shadow(self, shadow: BoxShadow) -> Self

Source§

impl BrightnessUtilities for ClassBuilder

Source§

fn brightness(self, brightness: Brightness) -> Self

Source§

impl ClearUtilities for ClassBuilder

Source§

fn clear(self, clear: Clear) -> Self

Source§

impl Clone for ClassBuilder

Source§

fn clone(&self) -> ClassBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ContrastUtilities for ClassBuilder

Source§

fn contrast(self, contrast: Contrast) -> Self

Source§

impl CursorUtilities for ClassBuilder

Source§

fn cursor(self, cursor: Cursor) -> Self

Source§

impl Debug for ClassBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ClassBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl DisplayUtilities for ClassBuilder

Source§

fn display(self, display: Display) -> Self

Source§

impl DivideUtilities for ClassBuilder

Source§

fn divide_width(self, width: DivideWidth) -> Self

Source§

fn divide_width_x(self, width: DivideWidth) -> Self

Source§

fn divide_width_y(self, width: DivideWidth) -> Self

Source§

fn divide_style(self, style: DivideStyle) -> Self

Source§

impl DropShadowUtilities for ClassBuilder

Source§

fn drop_shadow(self, shadow: DropShadow) -> Self

Source§

impl FlexBasisUtilities for ClassBuilder

Source§

fn flex_basis(self, basis: FlexBasis) -> Self

Source§

impl FlexDirectionUtilities for ClassBuilder

Source§

fn flex_direction(self, direction: FlexDirection) -> Self

Source§

impl FlexGrowUtilities for ClassBuilder

Source§

fn flex_grow(self, grow: FlexGrow) -> Self

Source§

impl FlexShrinkUtilities for ClassBuilder

Source§

fn flex_shrink(self, shrink: FlexShrink) -> Self

Source§

impl FlexWrapUtilities for ClassBuilder

Source§

fn flex_wrap(self, wrap: FlexWrap) -> Self

Source§

impl FloatUtilities for ClassBuilder

Source§

fn float(self, float: Float) -> Self

Source§

impl FontFamilyUtilities for ClassBuilder

Source§

fn font_family(self, family: FontFamily) -> Self

Set font family
Source§

impl FontSizeUtilities for ClassBuilder

Source§

fn font_size(self, size: FontSize) -> Self

Set font size
Source§

impl FontWeightUtilities for ClassBuilder

Source§

fn font_weight(self, weight: FontWeight) -> Self

Set font weight
Source§

impl GapUtilities for ClassBuilder

Source§

fn gap(self, value: SpacingValue) -> Self

Add gap between grid/flex items
Source§

fn gap_x(self, value: SpacingValue) -> Self

Add horizontal gap between grid/flex items
Source§

fn gap_y(self, value: SpacingValue) -> Self

Add vertical gap between grid/flex items
Source§

impl GradientDirectionUtilities for ClassBuilder

Source§

fn gradient_direction(self, direction: GradientDirection) -> Self

Source§

impl GradientStopUtilities for ClassBuilder

Source§

fn gradient_from(self, color: Color) -> Self

Source§

fn gradient_via(self, color: Color) -> Self

Source§

fn gradient_to(self, color: Color) -> Self

Source§

impl GrayscaleUtilities for ClassBuilder

Source§

fn grayscale(self, grayscale: Grayscale) -> Self

Source§

impl GridAutoColumnsUtilities for ClassBuilder

Source§

fn grid_auto_columns(self, columns: GridAutoColumns) -> Self

Source§

impl GridAutoFlowUtilities for ClassBuilder

Source§

fn grid_auto_flow(self, flow: GridAutoFlow) -> Self

Source§

impl GridAutoRowsUtilities for ClassBuilder

Source§

fn grid_auto_rows(self, rows: GridAutoRows) -> Self

Source§

impl GridColumnEndUtilities for ClassBuilder

Source§

fn grid_column_end(self, end: GridColumnEnd) -> Self

Source§

impl GridColumnSpanUtilities for ClassBuilder

Source§

impl GridColumnStartUtilities for ClassBuilder

Source§

impl GridRowEndUtilities for ClassBuilder

Source§

fn grid_row_end(self, end: GridRowEnd) -> Self

Source§

impl GridRowSpanUtilities for ClassBuilder

Source§

fn grid_row_span(self, span: GridRowSpan) -> Self

Source§

impl GridRowStartUtilities for ClassBuilder

Source§

fn grid_row_start(self, start: GridRowStart) -> Self

Source§

impl GridTemplateColumnsUtilities for ClassBuilder

Source§

impl GridTemplateRowsUtilities for ClassBuilder

Source§

impl HeightUtilities for ClassBuilder

Source§

fn height(self, value: SizingValue) -> Self

Set height
Source§

fn min_height(self, value: SizingValue) -> Self

Set min-height
Source§

fn max_height(self, value: SizingValue) -> Self

Set max-height
Source§

impl HueRotateUtilities for ClassBuilder

Source§

fn hue_rotate(self, hue_rotate: HueRotate) -> Self

Source§

impl InvertUtilities for ClassBuilder

Source§

fn invert(self, invert: Invert) -> Self

Source§

impl IsolationUtilities for ClassBuilder

Source§

fn isolation(self, isolation: Isolation) -> Self

Source§

impl JustifyContentUtilities for ClassBuilder

Source§

fn justify_content(self, justify: JustifyContent) -> Self

Source§

impl LetterSpacingUtilities for ClassBuilder

Source§

fn letter_spacing(self, spacing: LetterSpacing) -> Self

Set letter spacing
Source§

impl LineHeightUtilities for ClassBuilder

Source§

fn line_height(self, height: LineHeight) -> Self

Set line height
Source§

impl MarginUtilities for ClassBuilder

Source§

fn margin(self, value: SpacingValue) -> Self

Add margin to all sides
Source§

fn margin_x(self, value: SpacingValue) -> Self

Add horizontal margin (left and right)
Source§

fn margin_y(self, value: SpacingValue) -> Self

Add vertical margin (top and bottom)
Source§

fn margin_top(self, value: SpacingValue) -> Self

Add top margin
Source§

fn margin_right(self, value: SpacingValue) -> Self

Add right margin
Source§

fn margin_bottom(self, value: SpacingValue) -> Self

Add bottom margin
Source§

fn margin_left(self, value: SpacingValue) -> Self

Add left margin
Source§

fn margin_start(self, value: SpacingValue) -> Self

Add margin to start (left in LTR, right in RTL)
Source§

fn margin_end(self, value: SpacingValue) -> Self

Add margin to end (right in LTR, left in RTL)
Source§

fn margin_negative(self, value: SpacingValue) -> Self

Add negative margin to all sides
Source§

fn margin_x_negative(self, value: SpacingValue) -> Self

Add negative horizontal margin
Source§

fn margin_y_negative(self, value: SpacingValue) -> Self

Add negative vertical margin
Source§

fn margin_top_negative(self, value: SpacingValue) -> Self

Add negative top margin
Source§

fn margin_right_negative(self, value: SpacingValue) -> Self

Add negative right margin
Source§

fn margin_bottom_negative(self, value: SpacingValue) -> Self

Add negative bottom margin
Source§

fn margin_left_negative(self, value: SpacingValue) -> Self

Add negative left margin
Source§

impl MixBlendModeUtilities for ClassBuilder

Source§

fn mix_blend_mode(self, mode: MixBlendMode) -> Self

Source§

impl ObjectFitUtilities for ClassBuilder

Source§

fn object_fit(self, object_fit: ObjectFit) -> Self

Source§

impl ObjectPositionUtilities for ClassBuilder

Source§

fn object_position(self, object_position: ObjectPosition) -> Self

Source§

impl OpacityUtilities for ClassBuilder

Source§

fn opacity(self, opacity: Opacity) -> Self

Source§

impl OrderUtilities for ClassBuilder

Source§

fn order(self, order: Order) -> Self

Source§

impl OutlineUtilities for ClassBuilder

Source§

fn outline_width(self, width: OutlineWidth) -> Self

Source§

fn outline_style(self, style: OutlineStyle) -> Self

Source§

fn outline_offset(self, offset: OutlineOffset) -> Self

Source§

impl OverflowUtilities for ClassBuilder

Source§

fn overflow(self, overflow: Overflow) -> Self

Source§

fn overflow_x(self, overflow: Overflow) -> Self

Source§

fn overflow_y(self, overflow: Overflow) -> Self

Source§

impl OverscrollBehaviorUtilities for ClassBuilder

Source§

impl PaddingUtilities for ClassBuilder

Source§

fn padding(self, value: SpacingValue) -> Self

Add padding to all sides
Source§

fn padding_x(self, value: SpacingValue) -> Self

Add horizontal padding (left and right)
Source§

fn padding_y(self, value: SpacingValue) -> Self

Add vertical padding (top and bottom)
Source§

fn padding_top(self, value: SpacingValue) -> Self

Add top padding
Source§

fn padding_right(self, value: SpacingValue) -> Self

Add right padding
Source§

fn padding_bottom(self, value: SpacingValue) -> Self

Add bottom padding
Source§

fn padding_left(self, value: SpacingValue) -> Self

Add left padding
Source§

fn padding_start(self, value: SpacingValue) -> Self

Add padding to start (left in LTR, right in RTL)
Source§

fn padding_end(self, value: SpacingValue) -> Self

Add padding to end (right in LTR, left in RTL)
Source§

impl PointerEventsUtilities for ClassBuilder

Source§

fn pointer_events(self, events: PointerEvents) -> Self

Source§

impl PositionUtilities for ClassBuilder

Source§

fn position(self, position: Position) -> Self

Source§

impl ResizeUtilities for ClassBuilder

Source§

fn resize(self, resize: Resize) -> Self

Source§

impl RingColorUtilities for ClassBuilder

Source§

fn ring_color(self, color: Color) -> Self

Source§

fn ring_transparent(self) -> Self

Source§

fn ring_current(self) -> Self

Source§

fn ring_black(self) -> Self

Source§

fn ring_white(self) -> Self

Source§

impl RingUtilities for ClassBuilder

Source§

fn ring_width(self, width: RingWidth) -> Self

Source§

fn ring_offset_width(self, width: RingOffsetWidth) -> Self

Source§

impl RotateUtilities for ClassBuilder

Source§

fn rotate(self, rotate: Rotate) -> Self

Source§

impl SaturateUtilities for ClassBuilder

Source§

fn saturate(self, saturate: Saturate) -> Self

Source§

impl ScaleUtilities for ClassBuilder

Source§

fn scale(self, scale: Scale) -> Self

Source§

fn scale_x(self, scale: Scale) -> Self

Source§

fn scale_y(self, scale: Scale) -> Self

Source§

impl ScrollBehaviorUtilities for ClassBuilder

Source§

fn scroll_behavior(self, behavior: ScrollBehavior) -> Self

Source§

impl ScrollSnapAlignUtilities for ClassBuilder

Source§

impl ScrollSnapTypeUtilities for ClassBuilder

Source§

fn scroll_snap_type(self, snap_type: ScrollSnapType) -> Self

Source§

impl SepiaUtilities for ClassBuilder

Source§

fn sepia(self, sepia: Sepia) -> Self

Source§

impl SkewUtilities for ClassBuilder

Source§

fn skew_x(self, skew: Skew) -> Self

Source§

fn skew_y(self, skew: Skew) -> Self

Source§

impl TextAlignUtilities for ClassBuilder

Source§

fn text_align(self, align: TextAlign) -> Self

Set text alignment
Source§

impl TextColorUtilities for ClassBuilder

Source§

fn text_color(self, color: Color) -> Self

Source§

fn text_transparent(self) -> Self

Source§

fn text_current(self) -> Self

Source§

fn text_black(self) -> Self

Source§

fn text_white(self) -> Self

Source§

impl TextDecorationUtilities for ClassBuilder

Source§

fn text_decoration(self, decoration: TextDecoration) -> Self

Set text decoration
Source§

impl TextOverflowUtilities for ClassBuilder

Source§

fn text_overflow(self, overflow: TextOverflow) -> Self

Set text overflow
Source§

impl TextTransformUtilities for ClassBuilder

Source§

fn text_transform(self, transform: TextTransform) -> Self

Set text transform
Source§

impl TouchActionUtilities for ClassBuilder

Source§

fn touch_action(self, action: TouchAction) -> Self

Source§

impl TransformOriginUtilities for ClassBuilder

Source§

fn transform_origin(self, origin: TransformOrigin) -> Self

Source§

impl TransitionDelayUtilities for ClassBuilder

Source§

fn transition_delay(self, delay: TransitionDelay) -> Self

Source§

impl TransitionDurationUtilities for ClassBuilder

Source§

impl TransitionPropertyUtilities for ClassBuilder

Source§

impl TransitionTimingFunctionUtilities for ClassBuilder

Source§

impl TranslateUtilities for ClassBuilder

Source§

fn translate_x(self, translate: Translate) -> Self

Source§

fn translate_y(self, translate: Translate) -> Self

Source§

impl UserSelectUtilities for ClassBuilder

Source§

fn user_select(self, select: UserSelect) -> Self

Source§

impl VisibilityUtilities for ClassBuilder

Source§

fn visibility(self, visibility: Visibility) -> Self

Source§

impl WhiteSpaceUtilities for ClassBuilder

Source§

fn white_space(self, space: WhiteSpace) -> Self

Set white space
Source§

impl WidthUtilities for ClassBuilder

Source§

fn width(self, value: SizingValue) -> Self

Set width
Source§

fn min_width(self, value: SizingValue) -> Self

Set min-width
Source§

fn max_width(self, value: SizingValue) -> Self

Set max-width
Source§

impl WillChangeUtilities for ClassBuilder

Source§

fn will_change(self, change: WillChange) -> Self

Source§

impl WordBreakUtilities for ClassBuilder

Source§

fn word_break(self, break_type: WordBreak) -> Self

Set word break
Source§

impl ZIndexUtilities for ClassBuilder

Source§

fn z_index(self, z_index: ZIndex) -> Self

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.