css

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatFontFamilyValue

func FormatFontFamilyValue(value string) (string, error)

FormatFontFamilyValue formats a font family value for CSS. Returns the formatted value or an error if formatting fails.

func FormatTokenValueForCSS

func FormatTokenValueForCSS(token *tokens.Token) (string, error)

FormatTokenValueForCSS formats a token value for safe insertion into CSS. Returns the formatted value and an error if formatting/validation fails. Returns ("", error) for unsupported token types, invalid values or parse failures (caller should warn). Returns (value, nil) for successfully formatted values.

func IsCSSValueSemanticallyEquivalent

func IsCSSValueSemanticallyEquivalent(a, b string) bool

IsCSSValueSemanticallyEquivalent checks if two CSS values are semantically equivalent. It normalizes values by removing all whitespace and converting to lowercase before comparison.

This is useful for comparing CSS values that may have different formatting but represent the same value, such as:

  • "rgb(255, 0, 0)" vs "rgb(255,0,0)"
  • "#FF0000" vs "#ff0000"
  • "1.5rem" vs "1.5REM"

Returns true if the values are equivalent after normalization.

Types

This section is empty.

Jump to

Keyboard shortcuts

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