style

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSS

func CSS(css string) *element

CSS Creates a style element with CSS type explicitly set. Example: style.CSS("body { margin: 0; padding: 0; }") Renders: <style type="text/css">body { margin: 0; padding: 0; }</style>

func New

func New(nodes ...node.Node) *element

New Creates a new style element without any initial attributes. Example: style.New() Renders: <style></style>

func RawText

func RawText(content string) *element

RawText Creates a new style element with raw CSS content as unescaped HTML. Example: style.RawText("body { margin: 0; }") Renders: <style>body { margin: 0; }</style>

func RawTextf

func RawTextf(format string, args ...any) *element

RawTextf Creates a new style element with formatted raw text content as unescaped HTML using text.RawTextf. Example: style.RawTextf("%s { margin: %d; }", "body", 0) Renders: <style>body { margin: 0; }</style>

func Static

func Static(content string) *element

Static Creates a new style element with static text content. Example: style.Static("Hello World") Renders: <style>Hello World</style>

func Text

func Text(content string) *element

Text Creates a new style element with CSS text content. Example: style.Text("body { margin: 0; }") Renders: <style>body { margin: 0; }</style>

func Textf

func Textf(format string, args ...any) *element

Textf Creates a new style element with formatted text content using text.Textf. Example: style.Textf("%s { margin: %d; }", "body", 0) Renders: <style>body { margin: 0; }</style>

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

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