cssselector

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cssselector parses selectors for the purpose of purging unused CSS. It discards various bits of information not used by the purging process, and isn't generically useful.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain []Selector

func Parse

func Parse(selector io.Reader) (Chain, error)

type Selector

type Selector struct {
	Tag           string
	ID            string
	Class         map[string]struct{}
	Attr          map[string]struct{}
	PsuedoClass   []string
	PsuedoElement []string
	Function      []string
}

Selector is a single parsed selector, a number of which form a chain together.

func (*Selector) IsZero

func (s *Selector) IsZero() bool

IsZero returns true of this selector is a zero value. This is also true for '*', the universal selector.

func (*Selector) Matches

func (s *Selector) Matches(node *Selector) bool

Matches returns true of this selector matches the given node.

Jump to

Keyboard shortcuts

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