style

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Remover added in v0.0.9

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

func (*Remover) Remove added in v0.0.9

func (r *Remover) Remove(script *ast.Script) error

Remove the script with the scoped styles

func (*Remover) VisitBoolValue added in v0.0.9

func (r *Remover) VisitBoolValue(b *ast.BoolValue)

func (*Remover) VisitComment added in v0.0.9

func (r *Remover) VisitComment(n *ast.Comment)

func (*Remover) VisitElement added in v0.0.9

func (r *Remover) VisitElement(e *ast.Element)

func (*Remover) VisitExpr added in v0.0.9

func (r *Remover) VisitExpr(e *ast.Expr)

func (*Remover) VisitField added in v0.0.9

func (r *Remover) VisitField(f *ast.Field)

func (*Remover) VisitScript added in v0.0.9

func (r *Remover) VisitScript(s *ast.Script)

func (*Remover) VisitStringValue added in v0.0.9

func (r *Remover) VisitStringValue(s *ast.StringValue)

func (*Remover) VisitText added in v0.0.9

func (r *Remover) VisitText(t *ast.Text)

type Visitor

type Visitor struct {
	Path       string           // the path to the file
	Prefix     string           // the prefix for the scoped styles (e.g. jsx-)
	Attr       string           // the attribute to prepend the class to (e.g. class)
	ImportName string           // the name of the import (e.g. Style)
	Minify     bool             // whether to minify the css
	Engines    []esbuild.Engine // the browser engines we're targeting
	// contains filtered or unexported fields
}

func (*Visitor) Rewrite

func (v *Visitor) Rewrite(script *ast.Script) error

Rewrite the script with the scoped styles

func (*Visitor) VisitBoolValue

func (v *Visitor) VisitBoolValue(b *ast.BoolValue)

func (*Visitor) VisitComment

func (v *Visitor) VisitComment(n *ast.Comment)

func (*Visitor) VisitElement

func (v *Visitor) VisitElement(e *ast.Element)

func (*Visitor) VisitExpr

func (v *Visitor) VisitExpr(e *ast.Expr)

func (*Visitor) VisitField

func (v *Visitor) VisitField(f *ast.Field)

func (*Visitor) VisitScript

func (v *Visitor) VisitScript(s *ast.Script)

func (*Visitor) VisitStringValue

func (v *Visitor) VisitStringValue(s *ast.StringValue)

func (*Visitor) VisitText

func (v *Visitor) VisitText(t *ast.Text)

Jump to

Keyboard shortcuts

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