utils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderToString

func RenderToString(ctx context.Context, t templ.Component) (string, error)

RenderToString renders the given templ.Component to a string. It returns the rendered template as an HTML string.

Types

type Alignment

type Alignment string

Alignment represents the text alignment

const (
	AlignLeft   Alignment = "left"
	AlignCenter Alignment = "center"
	AlignRight  Alignment = "right"
)

Predefined alignments

func (Alignment) String

func (a Alignment) String() string

String returns the string representation of the alignment

type Color

type Color string

Color represents a color

const (
	Transparent Color = "transparent"
	Primary     Color = "#6366f1"
	Secondary   Color = "#6b7280"
	Danger      Color = "#ef4444"
	Success     Color = "#22c55e"
	Warning     Color = "#eab308"
	Info        Color = "#3b82f6"
)

Predefined colors

const (
	BgWhite   Color = "#ffffff"
	BgGray100 Color = "#f3f4f6"
	BgGray200 Color = "#e5e7eb"
)

Predefined background colors

const (
	TextHeader    Color = "#1f2937"
	TextPrimary   Color = "#1f2937"
	TextSecondary Color = "#4b5563"
	TextSuccess   Color = "#166534"
	TextDanger    Color = "#991b1b"
	TextWarning   Color = "#854d0e"
	TextInfo      Color = "#1e40af"
	TextLink      Color = "#0284c7"
)

Predefined text colors

func (Color) String

func (c Color) String() string

String returns the string representation of the color

Jump to

Keyboard shortcuts

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