Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CSSCount ¶
type CSSCount struct {
// contains filtered or unexported fields
}
CSSCount is for keeping a running frequency of CSS identifiers
func (*CSSCount) Counts ¶
Counts returns a map of identifers and their frequency counts
NOTE: returns internal object, not a copy
type CSSFormat ¶
type CSSFormat struct { Indent int IndentTab bool AlwaysSemicolon bool RemoveAtRule []string // ignore things like "@media XXX" RemoveSourceMap bool // remove comment with source map Debug bool Matcher matcher }
CSSFormat contains formatting perferances for CSS
func NewCSSFormat ¶
NewCSSFormat creates an initialized CSSFormat object
type EmptyMatcher ¶ added in v0.2.0
type EmptyMatcher struct{}
EmptyMatcher this keeps all elements, or rather, doesn't remove anything
func (*EmptyMatcher) Remove ¶ added in v0.2.0
func (em *EmptyMatcher) Remove([]string) bool
Remove always returns false (i.e. keep everything)
type TagMatcher ¶ added in v0.2.0
type TagMatcher struct {
// contains filtered or unexported fields
}
TagMatcher determines if a given CSS identifier should be kept or removed doesn't need to be public
func NewTagMatcher ¶ added in v0.2.0
func NewTagMatcher(tags []string) *TagMatcher
NewTagMatcher creates an initialized TagMatch object
func (*TagMatcher) AddSelector ¶ added in v0.2.0
func (tm *TagMatcher) AddSelector(key string)
AddSelector adds a selector to save
func (*TagMatcher) Remove ¶ added in v0.2.0
func (tm *TagMatcher) Remove(selectors []string) bool
Remove returns true if tag is to be dropped
func (*TagMatcher) RemoveSelector ¶ added in v0.2.0
func (tm *TagMatcher) RemoveSelector(key string)
RemoveSelector deletes a selector to save