cssg

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decl

type Decl [2]string

Decl represents a CSS declaration containing a property and value.

func (Decl) CSSString

func (d Decl) CSSString() string

CSSString generates a valid CSS string representation of the declaration.

type DeclarationGroup

type DeclarationGroup []Decl

DeclarationGroup groups multiple declarations together.

func (DeclarationGroup) CSSString

func (dg DeclarationGroup) CSSString() string

type Rule

type Rule struct {
	// contains filtered or unexported fields
}

Rule represents a CSS rule (linking declarations to selectors).

func NewRule

func NewRule(selectors ...string) *Rule

NewRule allocates a new CSS rule with the given selectors.

func (*Rule) CSSString

func (r *Rule) CSSString() string

CSSString generates a valid CSS string representation of the rule.

func (*Rule) Select

func (r *Rule) Select(selectors ...string) *Rule

Select appends the given selectors to the rules' list of selectors.

func (*Rule) With

func (r *Rule) With(declarations DeclarationGroup) *Rule

With appends the given declarations to the rules' list of declarations.

type RuleGroup

type RuleGroup []*Rule

RuleGroup represent a list of CSS rules.

func (RuleGroup) CSSString

func (rs RuleGroup) CSSString() string

CSSString generates a valid CSS string representation of the rules.

type Stringer

type Stringer interface{ CSSString() string }

Stringer can generate a valid CSS string.

Jump to

Keyboard shortcuts

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