fa

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Border    = Class("fa-border")
	PullLeft  = Class("fa-pull-left")
	PullRight = Class("fa-pull-right")
)
View Source
const (
	Brand        = Style("fa-brands")
	Duotone      = Style("fa-duotone")
	Light        = Style("fa-light")
	SharpLight   = Style("fa-sharp fa-light")
	Regular      = Style("fa-regular")
	SharpRegular = Style("fa-sharp fa-regular")
	Solid        = Style("fa-solid")
	SharpSolid   = Style("fa-sharp fa-solid")
	Thin         = Style("fa-thin")
	SharpThin    = Style("fa-sharp fa-thin")
)

Styles

View Source
const (
	Rotate90       = rotateOrFlip("fa-rotate-90")
	Rotate180      = rotateOrFlip("fa-rotate-180")
	Rotate270      = rotateOrFlip("fa-rotate-270")
	FlipHorizontal = rotateOrFlip("fa-flip-horizontal")
	FlipVertical   = rotateOrFlip("fa-flip-vertical")
	FlipBoth       = rotateOrFlip("fa-flip-both")
)

Rotation (see https://fontawesome.com/docs/web/style/rotate)

View Source
const (
	Stack1x = Class("fa-stack-1x")
	Stack2x = Class("fa-stack-2x")
	Inverse = Class("fa-inverse")
)
View Source
const (
	FixedWidth = Class("fa-fw")
)

Variations

View Source
const (
	SwapOpacity = Class("fa-swap-opacity")
)

Variables

View Source
var (
	Size2Xs = Class("fa-2xs")
	SizeXs  = Class("fa-xs")
	SizeSm  = Class("fa-sm")
	SizeLg  = Class("fa-lg")
	SizeXl  = Class("fa-xl")
	Size2Xl = Class("fa-2xl")
)

Font Awesome icons sizes

View Source
var Assets embed.FS
View Source
var CSSHandler = http.FileServer(http.FS(Assets))

CSSHandler is a http handler function for Font Awesome assets.

Functions

func Angle added in v0.5.0

func Angle(angle float64) func(any)

func Beat

func Beat(options ...func(any)) e.ParentModifier

func BeatFade

func BeatFade(options ...func(any)) e.ParentModifier

func BorderColor added in v0.5.0

func BorderColor(value string) e.Styles

func BorderPadding added in v0.5.0

func BorderPadding(value string) e.Styles

func BorderRadius added in v0.5.0

func BorderRadius(value string) e.Styles

func BorderStyle added in v0.5.0

func BorderStyle(value string) e.Styles

func BorderWidth added in v0.5.0

func BorderWidth(value string) e.Styles

func Bounce

func Bounce(options ...func(any)) e.ParentModifier

func CSSHead added in v0.1.1

func CSSHead(basePath string) any

CSSHead returns head section elements for the Font Awesome CSS at the provided base path, for inclusion as a child of b.HTML.

func Delay added in v0.5.0

func Delay(d time.Duration) func(a any)

func DirectionAlternate added in v0.5.0

func DirectionAlternate(a any)

func DirectionAlternateReverse added in v0.5.0

func DirectionAlternateReverse(a any)

func DirectionNormal added in v0.5.0

func DirectionNormal(a any)

func DirectionReverse added in v0.5.0

func DirectionReverse(a any)

func DuoColors added in v0.11.0

func DuoColors(primary, secondary string) e.Styles

func DuoOpacities added in v0.11.0

func DuoOpacities(primary, secondary float64) e.Styles

func Duration added in v0.5.0

func Duration(d time.Duration) func(a any)

func FA

func FA(style Style, name string, children ...any) e.Element

FA returns a Font Awesome icon, in an i element, with the provided style and name (without the "fa-" prefix).

// https://willoma.github.io/bulma-gomponents/icon.html#font-awesome

func Fade

func Fade(options ...func(any)) e.ParentModifier

func Flip

func Flip(options ...func(any)) e.ParentModifier

func Height added in v0.5.0

func Height(height float64) func(any)

func Icon

func Icon(style Style, name string, children ...any) e.Element

Icon returns a Font Awesome icon, in an i element within a b.Icon element, with the provided style and name (without the "fa-" prefix).

// https://willoma.github.io/bulma-gomponents/icon.html#font-awesome

func InverseColor added in v0.5.0

func InverseColor(value string) e.Styles

InverseColor sets the color of an inversed stacked icon.

func IterationCount added in v0.5.0

func IterationCount(c float64) func(a any)

func JumpScaleX added in v0.5.0

func JumpScaleX(scale float64) func(any)

func JumpScaleY added in v0.5.0

func JumpScaleY(scale float64) func(any)

func LandScaleX added in v0.5.0

func LandScaleX(scale float64) func(any)

func LandScaleY added in v0.5.0

func LandScaleY(scale float64) func(any)

func Li

func Li(style Style, name string, children ...any) e.Element

Li returns a list element with custom bullet in a UList or a OList, with the provided style and name (without the "fa-" prefix).

  • when a child is a Class, it is added to the icon
  • when a child is a color, its text variant is applied to the icon (in order ti apply the color to the entire line, you must use the Text* variant)
  • when a child is a rotation or animation, it is applied to the icon
  • all other children types are added to the li

func MaxScale added in v0.5.0

func MaxScale(scale float64) func(any)

func MinOpacity added in v0.5.0

func MinOpacity(opacity float64) func(any)

func OList

func OList(children ...any) e.Element

OList replaces numbers with icons in ol lists.

func OnFA added in v0.5.0

func OnFA(children ...any) onFA

func OnIcon added in v0.5.0

func OnIcon(children ...any) onIcon

func PrimaryColor added in v0.5.0

func PrimaryColor(value string) e.Styles

func PrimaryOpacity added in v0.5.0

func PrimaryOpacity(value float64) e.Styles

func PullMargin added in v0.5.0

func PullMargin(value string) e.Styles

func Pulse

func Pulse(a any)

func Rebound added in v0.5.0

func Rebound(rebound float64) func(any)

func Reverse added in v0.5.0

func Reverse(a any)

func SecondaryColor added in v0.5.0

func SecondaryColor(value string) e.Styles

func SecondaryOpacity added in v0.5.0

func SecondaryOpacity(value float64) e.Styles

func Shake

func Shake(options ...func(any)) e.ParentModifier

func Spin

func Spin(options ...func(any)) e.ParentModifier

func Stack

func Stack(children ...any) e.Element

Stack stacks Font Awesome children icons.

func StartScaleX added in v0.5.0

func StartScaleX(scale float64) func(any)

func StartScaleY added in v0.5.0

func StartScaleY(scale float64) func(any)

func TimingEase added in v0.5.0

func TimingEase(a any)

func TimingEaseIn added in v0.5.0

func TimingEaseIn(a any)

func TimingEaseInOut added in v0.5.0

func TimingEaseInOut(a any)

func TimingEaseOut added in v0.5.0

func TimingEaseOut(a any)

func TimingLinear added in v0.5.0

func TimingLinear(a any)

func TimingStepEnd added in v0.5.0

func TimingStepEnd(a any)

func TimingStepStart added in v0.5.0

func TimingStepStart(a any)

func UList

func UList(children ...any) e.Element

UList replaces bullets with icons in ul lists.

func X added in v0.5.0

func X(x float64) func(any)

func Y added in v0.5.0

func Y(y float64) func(any)

func Z added in v0.5.0

func Z(z float64) func(any)

func ZIndex added in v0.5.0

func ZIndex(value int) e.Styles

ZIndex sets the z-index of a stacked icon.

Types

type Animation

type Animation interface {
	ModifyParent(p e.Element)
	If(bool) Animation
	// contains filtered or unexported methods
}

type Class added in v0.2.0

type Class string

func Size added in v0.11.0

func Size(size int) Class

Font Awesome icons sizes as multipliers (works with 1 to 10).

func (Class) Class added in v0.5.0

func (c Class) Class() e.Class

func (Class) If added in v0.9.0

func (c Class) If(cond bool) Class

type Rotate

type Rotate float64

func (Rotate) If added in v0.9.0

func (r Rotate) If(cond bool) Rotate

func (Rotate) ModifyParent added in v0.5.0

func (r Rotate) ModifyParent(parent e.Element)

type Style added in v0.2.0

type Style string

Jump to

Keyboard shortcuts

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