utils

package
v0.0.0-...-3062178 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeAttributes

func MergeAttributes(attrs ...templ.Attributes) templ.Attributes

mergeAttributes merges multiple Attributes into one

func RandomID

func RandomID() string

RandomID returns a random ID string Example: "id-123456"

func TwIf

func TwIf(class string, condition bool) string

TwIf returns a class if a condition is true, otherwise an empty string Example: "bg-red-500", true → "bg-red-500", false → ""

func TwMerge

func TwMerge(classes ...string) string

TwMerge combines Tailwind classes and handles conflicts. Later classes override earlier ones with the same base. Example: "bg-red-500 hover:bg-blue-500", "bg-green-500" → "hover:bg-blue-500 bg-green-500"

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL