Twm.Validators (Twm v0.1.0)
View SourceProvides functions for validating Tailwind CSS class values.
Port of the TypeScript validators in tailwind-merge.
Summary
Functions
Always returns true. Used for validators that accept any value.
Returns true if the value is not an arbitrary value or variable.
Returns true if the value is an arbitrary image (e.g., "[url:var(--my-url)]").
Returns true if the value is an arbitrary length (e.g., "[10px]").
Returns true if the value is an arbitrary number (e.g., "[10]").
Returns true if the value is an arbitrary position (e.g., "[position:center]").
Returns true if the value is an arbitrary shadow (e.g., "[035px_60px-15px_rgba(0,0,0,0.3)]").
Returns true if the value is an arbitrary size (e.g., "[size:10px]").
Returns true if the value is an arbitrary value (e.g., "[value]").
Returns true if the value is an arbitrary variable (e.g., "(variable)").
Returns true if the value is an arbitrary variable family name (e.g., "(family-name:var(--font))").
Returns true if the value is an arbitrary variable image (e.g., "(image:var(--img))").
Returns true if the value is an arbitrary variable length (e.g., "(length:var(--size))").
Returns true if the value is an arbitrary variable position (e.g., "(position:var(--pos))").
Returns true if the value is an arbitrary variable shadow (e.g., "(shadow:var(--shadow))").
Returns true if the value is an arbitrary variable size (e.g., "(size:var(--size))").
Returns true if the value is a fraction (e.g., "1/2").
Returns true if the value is an integer.
Returns true if the value is a number.
Returns true if the value is a t-shirt size (e.g., "xs", "sm", "md", "lg", "xl", "2xl").
Returns true if the value is a percentage.
Functions
@spec any?() :: boolean()
Always returns true. Used for validators that accept any value.
Returns true if the value is not an arbitrary value or variable.
Returns true if the value is an arbitrary image (e.g., "[url:var(--my-url)]").
Returns true if the value is an arbitrary length (e.g., "[10px]").
Returns true if the value is an arbitrary number (e.g., "[10]").
Returns true if the value is an arbitrary position (e.g., "[position:center]").
Returns true if the value is an arbitrary shadow (e.g., "[035px_60px-15px_rgba(0,0,0,0.3)]").
Returns true if the value is an arbitrary size (e.g., "[size:10px]").
Returns true if the value is an arbitrary value (e.g., "[value]").
Returns true if the value is an arbitrary variable (e.g., "(variable)").
Returns true if the value is an arbitrary variable family name (e.g., "(family-name:var(--font))").
Returns true if the value is an arbitrary variable image (e.g., "(image:var(--img))").
Returns true if the value is an arbitrary variable length (e.g., "(length:var(--size))").
Returns true if the value is an arbitrary variable position (e.g., "(position:var(--pos))").
Returns true if the value is an arbitrary variable shadow (e.g., "(shadow:var(--shadow))").
Returns true if the value is an arbitrary variable size (e.g., "(size:var(--size))").
Returns true if the value is a fraction (e.g., "1/2").
Returns true if the value is an integer.
Returns true if the value is a number.
Returns true if the value is a t-shirt size (e.g., "xs", "sm", "md", "lg", "xl", "2xl").
Returns true if the value is a percentage.