Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDefaults ¶
func CopyDefaults(src, dst string)
func SetDefaults ¶
func SetDefaults(d Defaults)
Types ¶
type Custom ¶
Custom defines custom styles for a component.
func CustomAdd ¶
CustomAdd adds css classes as a CustomStyle for the current component. It is the equivalent of style.Custom{"component name":{style.Add(class)})
func CustomReplace ¶
CustomReplace replaces css classes as a CustomStyle for the current component. It is the equivalent of style.Custom{"component name":{style.Replace(old, new)})
func CustomReplaceVariants ¶
CustomReplaceVariants adds css classes as a CustomStyle for the current component. It is the equivalent of style.Custom{"component name":{style.ReplaceVariants(class)})
type Opt ¶
func ReplaceVariants ¶
ReplaceVariants replace a Tailwind class and its variants from the class attribute.
// replaces border-[...], [...]:border-[...] style.ReplaceVariants("border", "border-none")
type Style ¶
type Style int
Style defines a style. - 1 up to 1 << 5 are reserved for common styles - 1 << 6 up to 1 << 15 are reserved for component styles - 1 << 16 up to 1 << 29 are reserved for size styles
const ( // Default is the default style. Default Style = 0 // Disabled is automatically added when a component has a set Disabled attribute. Disabled Style = 1 // Valid is supported by input attributes. Text/background/border switch to green. Valid Style = 1 << 1 // Invalid is supported by input attributes. Text/background/border switch to red. Invalid Style = 1 << 2 SizeXS Style = 1 << 16 SizeS Style = 1 << 17 SizeNormal Style = 1 << 18 SizeL Style = 1 << 19 SizeXL Style = 1 << 20 SizeTwoXL Style = 1 << 21 SizeThreeXL Style = 1 << 22 SizeFourXL Style = 1 << 23 SizeFiveXL Style = 1 << 24 SizeSixXL Style = 1 << 25 SizeSevenXL Style = 1 << 26 SizeEightXL Style = 1 << 27 SizeNineXL Style = 1 << 28 SizeFull Style = 1 << 29 )