Skip to content

Version 0.26.0

Latest
Compare
Choose a tag to compare
@chasefleming chasefleming released this 09 Jun 20:20

馃殌 New Features

Seconds and Milliseconds Functions

Seconds(value float64) string

This function returns a string representation of the given time duration in seconds.

secondsValue := styles.Seconds(2.5) // Returns "2.5s"

Milliseconds(value int) string

This function returns a string representation of the given time duration in milliseconds.

millisecondsValue := styles.Milliseconds(500) // Returns "500ms"

HSL and HSLA Functions

HSL(h, s, l int) string

This function returns a string representation of the given HSL color.

hslColor := styles.HSL(120, 100, 50) // Returns "hsl(120, 100%, 50%)"

HSLA(h, s, l int, a float64) string

This function returns a string representation of the given HSLA color.

hslaColor := styles.HSLA(120, 100, 50, 0.5) // Returns "hsla(120, 100%, 50%, 0.5)"

Font Variant Constant

New constant, FontVariant for the font-variant CSS property:

textStyle := styles.Props{
   styles.FontVariant: "small-caps",
}

馃檹 Thanks to Contributors