css

package
v2.20.5 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 12 Imported by: 215

Documentation

Overview

Package css minifies CSS3 following the specifications at http://www.w3.org/TR/css-syntax-3/.

Index

Examples

Constants

This section is empty.

Variables

View Source
var PropertyOverrides = map[Hash][]Hash{
	Background:      {Background, Background_Image, Background_Position, Background_Size, Background_Repeat, Background_Origin, Background_Clip, Background_Attachment, Background_Color},
	Font:            {Font, Font_Style, Font_Variant, Font_Weight, Font_Stretch, Font_Size, Font_Family, Line_Height},
	Border:          {Border, Border_Width, Border_Top_Width, Border_Right_Width, Border_Bottom_Width, Border_Left_Width, Border_Style, Border_Top_Style, Border_Right_Style, Border_Bottom_Style, Border_Left_Style, Border_Color, Border_Top_Color, Border_Right_Color, Border_Bottom_Color, Border_Left_Color},
	Border_Width:    {Border_Width, Border_Top_Width, Border_Right_Width, Border_Bottom_Width, Border_Left_Width},
	Border_Style:    {Border_Style, Border_Top_Style, Border_Right_Style, Border_Bottom_Style, Border_Left_Style},
	Border_Color:    {Border_Color, Border_Top_Color, Border_Right_Color, Border_Bottom_Color, Border_Left_Color},
	Border_Top:      {Border_Top, Border_Top_Width, Border_Top_Style, Border_Top_Color},
	Border_Right:    {Border_Right, Border_Right_Width, Border_Right_Style, Border_Right_Color},
	Border_Bottom:   {Border_Bottom, Border_Bottom_Width, Border_Bottom_Style, Border_Bottom_Color},
	Border_Left:     {Border_Left, Border_Left_Width, Border_Left_Style, Border_Left_Color},
	Margin:          {Margin, Margin_Top, Margin_Right, Margin_Bottom, Margin_Left},
	Padding:         {Padding, Padding_Top, Padding_Right, Padding_Bottom, Padding_Left},
	Column_Rule:     {Column_Rule, Column_Rule_Width, Column_Rule_Style, Column_Rule_Color},
	Animation:       {Animation, Animation_Name, Animation_Duration, Animation_Timing_Function, Animation_Delay, Animation_Iteration_Count, Animation_Direction, Animation_Fill_Mode, Animation_Play_State},
	Columns:         {Columns, Column_Width, Column_Count},
	Flex:            {Flex, Flex_Basis, Flex_Grow, Flex_Shrink},
	Flex_Flow:       {Flex_Flow, Flex_Direction, Flex_Wrap},
	Grid:            {Grid, Grid_Template_Rows, Grid_Template_Columns, Grid_Template_Areas, Grid_Auto_Rows, Grid_Auto_Columns, Grid_Auto_Flow, Grid_Column_Gap, Grid_Row_Gap, Column_Gap, Row_Gap},
	Grid_Area:       {Grid_Area, Grid_Row_Start, Grid_Column_Start, Grid_Row_End, Grid_Column_End},
	Grid_Row:        {Grid_Row, Grid_Row_Start, Grid_Row_End},
	Grid_Column:     {Grid_Column, Grid_Column_Start, Grid_Column_End},
	Grid_Template:   {Grid_Template, Grid_Template_Rows, Grid_Template_Columns, Grid_Template_Areas},
	List_Style:      {List_Style, List_Style_Image, List_Style_Position, List_Style_Type},
	Offset:          {Offset, Offset_Position, Offset_Path, Offset_Distance, Offset_Anchor, Offset_Rotate},
	Outline:         {Outline, Outline_Width, Outline_Style, Outline_Color},
	Overflow:        {Overflow, Overflow_X, Overflow_Y},
	Place_Content:   {Place_Content, Align_Content, Justify_Content},
	Place_Items:     {Place_Items, Align_Items, Justify_Items},
	Place_Self:      {Place_Self, Align_Self, Justify_Self},
	Text_Decoration: {Text_Decoration, Text_Decoration_Color, Text_Decoration_Color, Text_Decoration_Line, Text_Decoration_Thickness},
	Transition:      {Transition, Transition_Property, Transition_Duration, Transition_Timing_Function, Transition_Delay},
}

PropertyOverrides is a map of which properties are overridden by the given property.

View Source
var ShortenColorHex = map[string][]byte{
	"#000080": []byte("navy"),
	"#008000": []byte("green"),
	"#008080": []byte("teal"),
	"#4b0082": []byte("indigo"),
	"#800000": []byte("maroon"),
	"#800080": []byte("purple"),
	"#808000": []byte("olive"),
	"#808080": []byte("gray"),
	"#a0522d": []byte("sienna"),
	"#a52a2a": []byte("brown"),
	"#c0c0c0": []byte("silver"),
	"#cd853f": []byte("peru"),
	"#d2b48c": []byte("tan"),
	"#da70d6": []byte("orchid"),
	"#dda0dd": []byte("plum"),
	"#ee82ee": []byte("violet"),
	"#f0e68c": []byte("khaki"),
	"#f0ffff": []byte("azure"),
	"#f5deb3": []byte("wheat"),
	"#f5f5dc": []byte("beige"),
	"#fa8072": []byte("salmon"),
	"#faf0e6": []byte("linen"),
	"#ff6347": []byte("tomato"),
	"#ff7f50": []byte("coral"),
	"#ffa500": []byte("orange"),
	"#ffc0cb": []byte("pink"),
	"#ffd700": []byte("gold"),
	"#ffe4c4": []byte("bisque"),
	"#fffafa": []byte("snow"),
	"#fffff0": []byte("ivory"),
	"#ff0000": []byte("red"),
	"#f00":    []byte("red"),
}

ShortenColorHex maps a color hexcode to its shorter name

View Source
var ShortenColorName = map[Hash][]byte{
	Black:                []byte("#000"),
	Darkblue:             []byte("#00008b"),
	Mediumblue:           []byte("#0000cd"),
	Darkgreen:            []byte("#006400"),
	Darkcyan:             []byte("#008b8b"),
	Deepskyblue:          []byte("#00bfff"),
	Darkturquoise:        []byte("#00ced1"),
	Mediumspringgreen:    []byte("#00fa9a"),
	Springgreen:          []byte("#00ff7f"),
	Midnightblue:         []byte("#191970"),
	Dodgerblue:           []byte("#1e90ff"),
	Lightseagreen:        []byte("#20b2aa"),
	Forestgreen:          []byte("#228b22"),
	Seagreen:             []byte("#2e8b57"),
	Darkslategray:        []byte("#2f4f4f"),
	Limegreen:            []byte("#32cd32"),
	Mediumseagreen:       []byte("#3cb371"),
	Turquoise:            []byte("#40e0d0"),
	Royalblue:            []byte("#4169e1"),
	Steelblue:            []byte("#4682b4"),
	Darkslateblue:        []byte("#483d8b"),
	Mediumturquoise:      []byte("#48d1cc"),
	Darkolivegreen:       []byte("#556b2f"),
	Cadetblue:            []byte("#5f9ea0"),
	Cornflowerblue:       []byte("#6495ed"),
	Mediumaquamarine:     []byte("#66cdaa"),
	Slateblue:            []byte("#6a5acd"),
	Olivedrab:            []byte("#6b8e23"),
	Slategray:            []byte("#708090"),
	Lightslateblue:       []byte("#789"),
	Mediumslateblue:      []byte("#7b68ee"),
	Lawngreen:            []byte("#7cfc00"),
	Chartreuse:           []byte("#7fff00"),
	Aquamarine:           []byte("#7fffd4"),
	Lightskyblue:         []byte("#87cefa"),
	Blueviolet:           []byte("#8a2be2"),
	Darkmagenta:          []byte("#8b008b"),
	Saddlebrown:          []byte("#8b4513"),
	Darkseagreen:         []byte("#8fbc8f"),
	Lightgreen:           []byte("#90ee90"),
	Mediumpurple:         []byte("#9370db"),
	Darkviolet:           []byte("#9400d3"),
	Palegreen:            []byte("#98fb98"),
	Darkorchid:           []byte("#9932cc"),
	Yellowgreen:          []byte("#9acd32"),
	Darkgray:             []byte("#a9a9a9"),
	Lightblue:            []byte("#add8e6"),
	Greenyellow:          []byte("#adff2f"),
	Paleturquoise:        []byte("#afeeee"),
	Lightsteelblue:       []byte("#b0c4de"),
	Powderblue:           []byte("#b0e0e6"),
	Firebrick:            []byte("#b22222"),
	Darkgoldenrod:        []byte("#b8860b"),
	Mediumorchid:         []byte("#ba55d3"),
	Rosybrown:            []byte("#bc8f8f"),
	Darkkhaki:            []byte("#bdb76b"),
	Mediumvioletred:      []byte("#c71585"),
	Indianred:            []byte("#cd5c5c"),
	Chocolate:            []byte("#d2691e"),
	Lightgray:            []byte("#d3d3d3"),
	Goldenrod:            []byte("#daa520"),
	Palevioletred:        []byte("#db7093"),
	Gainsboro:            []byte("#dcdcdc"),
	Burlywood:            []byte("#deb887"),
	Lightcyan:            []byte("#e0ffff"),
	Lavender:             []byte("#e6e6fa"),
	Darksalmon:           []byte("#e9967a"),
	Palegoldenrod:        []byte("#eee8aa"),
	Lightcoral:           []byte("#f08080"),
	Aliceblue:            []byte("#f0f8ff"),
	Honeydew:             []byte("#f0fff0"),
	Sandybrown:           []byte("#f4a460"),
	Whitesmoke:           []byte("#f5f5f5"),
	Mintcream:            []byte("#f5fffa"),
	Ghostwhite:           []byte("#f8f8ff"),
	Antiquewhite:         []byte("#faebd7"),
	Lightgoldenrodyellow: []byte("#fafad2"),
	Fuchsia:              []byte("#f0f"),
	Magenta:              []byte("#f0f"),
	Deeppink:             []byte("#ff1493"),
	Orangered:            []byte("#ff4500"),
	Darkorange:           []byte("#ff8c00"),
	Lightsalmon:          []byte("#ffa07a"),
	Lightpink:            []byte("#ffb6c1"),
	Peachpuff:            []byte("#ffdab9"),
	Navajowhite:          []byte("#ffdead"),
	Moccasin:             []byte("#ffe4b5"),
	Mistyrose:            []byte("#ffe4e1"),
	Blanchedalmond:       []byte("#ffebcd"),
	Papayawhip:           []byte("#ffefd5"),
	Lavenderblush:        []byte("#fff0f5"),
	Seashell:             []byte("#fff5ee"),
	Cornsilk:             []byte("#fff8dc"),
	Lemonchiffon:         []byte("#fffacd"),
	Floralwhite:          []byte("#fffaf0"),
	Yellow:               []byte("#ff0"),
	Lightyellow:          []byte("#ffffe0"),
	White:                []byte("#fff"),
}

ShortenColorName maps a color name to its shorter hexcode

Functions

func Minify

func Minify(m *minify.M, w io.Writer, r io.Reader, params map[string]string) error

Minify minifies CSS data, it reads from r and writes to w.

Example
m := minify.New()
m.AddFunc("text/css", Minify)

if err := m.Minify("text/css", os.Stdout, os.Stdin); err != nil {
	panic(err)
}
Output:

Types

type Hash added in v2.7.0

type Hash uint32

Hash defines perfect hashes for a predefined list of strings

const (
	Ms_Filter                   Hash = 0xa     // -ms-filter
	Accelerator                 Hash = 0x3760b // accelerator
	Aliceblue                   Hash = 0x7a209 // aliceblue
	Align_Content               Hash = 0xd980d // align-content
	Align_Items                 Hash = 0x7ef0b // align-items
	Align_Self                  Hash = 0x8cb0a // align-self
	All                         Hash = 0x69103 // all
	Alpha                       Hash = 0x37205 // alpha
	Animation                   Hash = 0xca09  // animation
	Animation_Delay             Hash = 0x2050f // animation-delay
	Animation_Direction         Hash = 0x8e913 // animation-direction
	Animation_Duration          Hash = 0x35d12 // animation-duration
	Animation_Fill_Mode         Hash = 0x66c13 // animation-fill-mode
	Animation_Iteration_Count   Hash = 0xd4919 // animation-iteration-count
	Animation_Name              Hash = 0xca0e  // animation-name
	Animation_Play_State        Hash = 0xfc14  // animation-play-state
	Animation_Timing_Function   Hash = 0x14119 // animation-timing-function
	Antiquewhite                Hash = 0x6490c // antiquewhite
	Aquamarine                  Hash = 0x9ec0a // aquamarine
	Attr                        Hash = 0x59804 // attr
	Auto                        Hash = 0x44504 // auto
	Azimuth                     Hash = 0x15a07 // azimuth
	Background                  Hash = 0x2b0a  // background
	Background_Attachment       Hash = 0x2b15  // background-attachment
	Background_Clip             Hash = 0xb6e0f // background-clip
	Background_Color            Hash = 0x21710 // background-color
	Background_Image            Hash = 0x5ad10 // background-image
	Background_Origin           Hash = 0x17111 // background-origin
	Background_Position         Hash = 0x18e13 // background-position
	Background_Position_X       Hash = 0x18e15 // background-position-x
	Background_Position_Y       Hash = 0x1a315 // background-position-y
	Background_Repeat           Hash = 0x1b811 // background-repeat
	Background_Size             Hash = 0x1cb0f // background-size
	Behavior                    Hash = 0x1da08 // behavior
	Black                       Hash = 0x1e205 // black
	Blanchedalmond              Hash = 0x1e70e // blanchedalmond
	Blueviolet                  Hash = 0x7a70a // blueviolet
	Bold                        Hash = 0x1fc04 // bold
	Border                      Hash = 0x22706 // border
	Border_Bottom               Hash = 0x2270d // border-bottom
	Border_Bottom_Color         Hash = 0x22713 // border-bottom-color
	Border_Bottom_Style         Hash = 0x23a13 // border-bottom-style
	Border_Bottom_Width         Hash = 0x25d13 // border-bottom-width
	Border_Box                  Hash = 0x27e0a // border-box
	Border_Collapse             Hash = 0x2b60f // border-collapse
	Border_Color                Hash = 0x2d30c // border-color
	Border_Left                 Hash = 0x2df0b // border-left
	Border_Left_Color           Hash = 0x2df11 // border-left-color
	Border_Left_Style           Hash = 0x2f011 // border-left-style
	Border_Left_Width           Hash = 0x30111 // border-left-width
	Border_Right                Hash = 0x3120c // border-right
	Border_Right_Color          Hash = 0x31212 // border-right-color
	Border_Right_Style          Hash = 0x32412 // border-right-style
	Border_Right_Width          Hash = 0x33612 // border-right-width
	Border_Spacing              Hash = 0x3480e // border-spacing
	Border_Style                Hash = 0x3ab0c // border-style
	Border_Top                  Hash = 0x3b70a // border-top
	Border_Top_Color            Hash = 0x3b710 // border-top-color
	Border_Top_Style            Hash = 0x3c710 // border-top-style
	Border_Top_Width            Hash = 0x3d710 // border-top-width
	Border_Width                Hash = 0x3e70c // border-width
	Bottom                      Hash = 0x22e06 // bottom
	Box_Shadow                  Hash = 0x2850a // box-shadow
	Burlywood                   Hash = 0x3f309 // burlywood
	Cadetblue                   Hash = 0x9c609 // cadetblue
	Calc                        Hash = 0x9c304 // calc
	Caption_Side                Hash = 0x40f0c // caption-side
	Caret_Color                 Hash = 0x4240b // caret-color
	Center                      Hash = 0xdb06  // center
	Charset                     Hash = 0x62f07 // charset
	Chartreuse                  Hash = 0x42f0a // chartreuse
	Chocolate                   Hash = 0x43909 // chocolate
	Clamp                       Hash = 0x44e05 // clamp
	Clear                       Hash = 0x45d05 // clear
	Clip                        Hash = 0xb7904 // clip
	Cm                          Hash = 0x53802 // cm
	Color                       Hash = 0x2505  // color
	Column_Count                Hash = 0x4620c // column-count
	Column_Gap                  Hash = 0x6a30a // column-gap
	Column_Rule                 Hash = 0x4880b // column-rule
	Column_Rule_Color           Hash = 0x48811 // column-rule-color
	Column_Rule_Style           Hash = 0x49911 // column-rule-style
	Column_Rule_Width           Hash = 0x4aa11 // column-rule-width
	Column_Width                Hash = 0x4bb0c // column-width
	Columns                     Hash = 0x74607 // columns
	Content                     Hash = 0x5607  // content
	Cornflowerblue              Hash = 0x4c70e // cornflowerblue
	Cornsilk                    Hash = 0x4d508 // cornsilk
	Counter_Increment           Hash = 0xd5d11 // counter-increment
	Counter_Reset               Hash = 0x4690d // counter-reset
	Cue                         Hash = 0x4dd03 // cue
	Cue_After                   Hash = 0x4dd09 // cue-after
	Cue_Before                  Hash = 0x4e60a // cue-before
	Currentcolor                Hash = 0x5010c // currentcolor
	Cursive                     Hash = 0x50d07 // cursive
	Cursor                      Hash = 0x51406 // cursor
	Darkblue                    Hash = 0x1f408 // darkblue
	Darkcyan                    Hash = 0x1ff08 // darkcyan
	Darkgoldenrod               Hash = 0x3fb0d // darkgoldenrod
	Darkgray                    Hash = 0x40708 // darkgray
	Darkgreen                   Hash = 0x75c09 // darkgreen
	Darkkhaki                   Hash = 0xa1409 // darkkhaki
	Darkmagenta                 Hash = 0xce90b // darkmagenta
	Darkolivegreen              Hash = 0x6d90e // darkolivegreen
	Darkorange                  Hash = 0x7500a // darkorange
	Darkorchid                  Hash = 0xa0b0a // darkorchid
	Darksalmon                  Hash = 0xa990a // darksalmon
	Darkseagreen                Hash = 0xb110c // darkseagreen
	Darkslateblue               Hash = 0xc1c0d // darkslateblue
	Darkslategray               Hash = 0xbfa0d // darkslategray
	Darkturquoise               Hash = 0xcaa0d // darkturquoise
	Darkviolet                  Hash = 0x51a0a // darkviolet
	Deeppink                    Hash = 0x67d08 // deeppink
	Deepskyblue                 Hash = 0x4190b // deepskyblue
	Default                     Hash = 0xa2207 // default
	Deg                         Hash = 0x70103 // deg
	Direction                   Hash = 0x8d909 // direction
	Display                     Hash = 0xcce07 // display
	Document                    Hash = 0x52408 // document
	Dodgerblue                  Hash = 0x52c0a // dodgerblue
	Dpcm                        Hash = 0x53604 // dpcm
	Dpi                         Hash = 0x54f03 // dpi
	Dppx                        Hash = 0x55b04 // dppx
	Elevation                   Hash = 0x6d09  // elevation
	Empty_Cells                 Hash = 0x3910b // empty-cells
	Env                         Hash = 0x4f503 // env
	Fantasy                     Hash = 0x3a407 // fantasy
	Fill                        Hash = 0x67604 // fill
	Filter                      Hash = 0x406   // filter
	Firebrick                   Hash = 0x83509 // firebrick
	Flex                        Hash = 0x55f04 // flex
	Flex_Basis                  Hash = 0x89d0a // flex-basis
	Flex_Direction              Hash = 0x8d40e // flex-direction
	Flex_Flow                   Hash = 0xc8709 // flex-flow
	Flex_Grow                   Hash = 0x55f09 // flex-grow
	Flex_Shrink                 Hash = 0x5680b // flex-shrink
	Flex_Wrap                   Hash = 0x57309 // flex-wrap
	Float                       Hash = 0x59505 // float
	Floralwhite                 Hash = 0x5bd0b // floralwhite
	Font                        Hash = 0x25404 // font
	Font_Face                   Hash = 0x25409 // font-face
	Font_Family                 Hash = 0x5ee0b // font-family
	Font_Size                   Hash = 0x5f909 // font-size
	Font_Size_Adjust            Hash = 0x5f910 // font-size-adjust
	Font_Stretch                Hash = 0x6250c // font-stretch
	Font_Style                  Hash = 0x6360a // font-style
	Font_Variant                Hash = 0x6400c // font-variant
	Font_Weight                 Hash = 0x65b0b // font-weight
	Forestgreen                 Hash = 0x4ec0b // forestgreen
	Fuchsia                     Hash = 0x66607 // fuchsia
	Function                    Hash = 0x15208 // function
	Gainsboro                   Hash = 0xec09  // gainsboro
	Ghostwhite                  Hash = 0x2990a // ghostwhite
	Goldenrod                   Hash = 0x3ff09 // goldenrod
	Grad                        Hash = 0x1004  // grad
	Greenyellow                 Hash = 0x7600b // greenyellow
	Grid                        Hash = 0x35504 // grid
	Grid_Area                   Hash = 0x35509 // grid-area
	Grid_Auto_Columns           Hash = 0x7bb11 // grid-auto-columns
	Grid_Auto_Flow              Hash = 0x81c0e // grid-auto-flow
	Grid_Auto_Rows              Hash = 0x8640e // grid-auto-rows
	Grid_Column                 Hash = 0x69e0b // grid-column
	Grid_Column_End             Hash = 0xcdb0f // grid-column-end
	Grid_Column_Gap             Hash = 0x69e0f // grid-column-gap
	Grid_Column_Start           Hash = 0x6bd11 // grid-column-start
	Grid_Row                    Hash = 0x6ce08 // grid-row
	Grid_Row_End                Hash = 0x6ce0c // grid-row-end
	Grid_Row_Gap                Hash = 0x6e70c // grid-row-gap
	Grid_Row_Start              Hash = 0x7030e // grid-row-start
	Grid_Template               Hash = 0x7110d // grid-template
	Grid_Template_Areas         Hash = 0x71113 // grid-template-areas
	Grid_Template_Columns       Hash = 0x73815 // grid-template-columns
	Grid_Template_Rows          Hash = 0x77012 // grid-template-rows
	Height                      Hash = 0x9306  // height
	Honeydew                    Hash = 0x16008 // honeydew
	Hsl                         Hash = 0x26f03 // hsl
	Hsla                        Hash = 0x26f04 // hsla
	Hz                          Hash = 0x68502 // hz
	Ime_Mode                    Hash = 0xa1c08 // ime-mode
	Import                      Hash = 0x78d06 // import
	Important                   Hash = 0x78d09 // important
	In                          Hash = 0x4402  // in
	Include_Source              Hash = 0x1800e // include-source
	Indianred                   Hash = 0xb0909 // indianred
	Inherit                     Hash = 0x79607 // inherit
	Initial                     Hash = 0x79d07 // initial
	Invert                      Hash = 0x7e406 // invert
	Justify_Content             Hash = 0x4e0f  // justify-content
	Justify_Items               Hash = 0x6050d // justify-items
	Justify_Self                Hash = 0x82a0c // justify-self
	Keyframes                   Hash = 0x5cb09 // keyframes
	Khz                         Hash = 0x68403 // khz
	Large                       Hash = 0xa905  // large
	Larger                      Hash = 0xa906  // larger
	Lavender                    Hash = 0x27108 // lavender
	Lavenderblush               Hash = 0x2710d // lavenderblush
	Lawngreen                   Hash = 0x2ca09 // lawngreen
	Layer_Background_Color      Hash = 0x21116 // layer-background-color
	Layer_Background_Image      Hash = 0x5a716 // layer-background-image
	Layout_Flow                 Hash = 0xcf80b // layout-flow
	Layout_Grid                 Hash = 0x8050b // layout-grid
	Layout_Grid_Char            Hash = 0x80510 // layout-grid-char
	Layout_Grid_Char_Spacing    Hash = 0x80518 // layout-grid-char-spacing
	Layout_Grid_Line            Hash = 0x83e10 // layout-grid-line
	Layout_Grid_Mode            Hash = 0x85410 // layout-grid-mode
	Layout_Grid_Type            Hash = 0x88710 // layout-grid-type
	Left                        Hash = 0x2e604 // left
	Lemonchiffon                Hash = 0x24b0c // lemonchiffon
	Letter_Spacing              Hash = 0x7ae0e // letter-spacing
	Lightblue                   Hash = 0x8ba09 // lightblue
	Lightcoral                  Hash = 0x8c30a // lightcoral
	Lightcyan                   Hash = 0x8e209 // lightcyan
	Lightgoldenrodyellow        Hash = 0x8fc14 // lightgoldenrodyellow
	Lightgray                   Hash = 0x91009 // lightgray
	Lightgreen                  Hash = 0x9190a // lightgreen
	Lightpink                   Hash = 0x92309 // lightpink
	Lightsalmon                 Hash = 0x92c0b // lightsalmon
	Lightseagreen               Hash = 0x9370d // lightseagreen
	Lightskyblue                Hash = 0x9440c // lightskyblue
	Lightslateblue              Hash = 0x9500e // lightslateblue
	Lightsteelblue              Hash = 0x95e0e // lightsteelblue
	Lightyellow                 Hash = 0x96c0b // lightyellow
	Limegreen                   Hash = 0x97709 // limegreen
	Line_Break                  Hash = 0x84a0a // line-break
	Line_Height                 Hash = 0x8e0b  // line-height
	Linear_Gradient             Hash = 0x9800f // linear-gradient
	List_Style                  Hash = 0x98f0a // list-style
	List_Style_Image            Hash = 0x98f10 // list-style-image
	List_Style_Position         Hash = 0x99f13 // list-style-position
	List_Style_Type             Hash = 0x9b20f // list-style-type
	Local                       Hash = 0x9c105 // local
	Magenta                     Hash = 0xced07 // magenta
	Margin                      Hash = 0x53906 // margin
	Margin_Bottom               Hash = 0xdb10d // margin-bottom
	Margin_Left                 Hash = 0xdbd0b // margin-left
	Margin_Right                Hash = 0xb890c // margin-right
	Margin_Top                  Hash = 0x5390a // margin-top
	Marker_Offset               Hash = 0xad00d // marker-offset
	Marks                       Hash = 0xaee05 // marks
	Mask                        Hash = 0x9cf04 // mask
	Max                         Hash = 0x9d303 // max
	Max_Height                  Hash = 0x9d30a // max-height
	Max_Width                   Hash = 0x9dd09 // max-width
	Media                       Hash = 0xd4505 // media
	Medium                      Hash = 0x9e606 // medium
	Mediumaquamarine            Hash = 0x9e610 // mediumaquamarine
	Mediumblue                  Hash = 0x9f60a // mediumblue
	Mediumorchid                Hash = 0xa000c // mediumorchid
	Mediumpurple                Hash = 0xa420c // mediumpurple
	Mediumseagreen              Hash = 0xa4e0e // mediumseagreen
	Mediumslateblue             Hash = 0xa5c0f // mediumslateblue
	Mediumspringgreen           Hash = 0xa6b11 // mediumspringgreen
	Mediumturquoise             Hash = 0xa7c0f // mediumturquoise
	Mediumvioletred             Hash = 0xa8b0f // mediumvioletred
	Midnightblue                Hash = 0xaa90c // midnightblue
	Min                         Hash = 0x14d03 // min
	Min_Height                  Hash = 0xab50a // min-height
	Min_Width                   Hash = 0xabf09 // min-width
	Mintcream                   Hash = 0xac809 // mintcream
	Mistyrose                   Hash = 0xae409 // mistyrose
	Mm                          Hash = 0xaed02 // mm
	Moccasin                    Hash = 0xb0308 // moccasin
	Monospace                   Hash = 0xaa009 // monospace
	Ms                          Hash = 0x102   // ms
	Namespace                   Hash = 0xd409  // namespace
	Navajowhite                 Hash = 0x750b  // navajowhite
	No_Repeat                   Hash = 0xbf09  // no-repeat
	None                        Hash = 0x38e04 // none
	Normal                      Hash = 0x36e06 // normal
	Offset                      Hash = 0xad706 // offset
	Offset_Anchor               Hash = 0xad70d // offset-anchor
	Offset_Distance             Hash = 0xb1d0f // offset-distance
	Offset_Path                 Hash = 0xb2c0b // offset-path
	Offset_Position             Hash = 0xb370f // offset-position
	Offset_Rotate               Hash = 0xb460d // offset-rotate
	Olivedrab                   Hash = 0xb6609 // olivedrab
	Orangered                   Hash = 0x75409 // orangered
	Order                       Hash = 0x22805 // order
	Orphans                     Hash = 0x37f07 // orphans
	Outline                     Hash = 0xba707 // outline
	Outline_Color               Hash = 0xba70d // outline-color
	Outline_Style               Hash = 0xbb40d // outline-style
	Outline_Width               Hash = 0xbc10d // outline-width
	Overflow                    Hash = 0x9d08  // overflow
	Overflow_X                  Hash = 0x9d0a  // overflow-x
	Overflow_Y                  Hash = 0xbce0a // overflow-y
	Padding                     Hash = 0x45207 // padding
	Padding_Bottom              Hash = 0xb7c0e // padding-bottom
	Padding_Box                 Hash = 0x4520b // padding-box
	Padding_Left                Hash = 0xd0a0c // padding-left
	Padding_Right               Hash = 0x5420d // padding-right
	Padding_Top                 Hash = 0x57b0b // padding-top
	Page                        Hash = 0x58504 // page
	Page_Break_After            Hash = 0x58510 // page-break-after
	Page_Break_Before           Hash = 0x6ac11 // page-break-before
	Page_Break_Inside           Hash = 0x6f211 // page-break-inside
	Palegoldenrod               Hash = 0xc100d // palegoldenrod
	Palegreen                   Hash = 0xbd809 // palegreen
	Paleturquoise               Hash = 0xbe10d // paleturquoise
	Palevioletred               Hash = 0xbee0d // palevioletred
	Papayawhip                  Hash = 0xc070a // papayawhip
	Pause                       Hash = 0xc2905 // pause
	Pause_After                 Hash = 0xc290b // pause-after
	Pause_Before                Hash = 0xc340c // pause-before
	Pc                          Hash = 0x53702 // pc
	Peachpuff                   Hash = 0x89509 // peachpuff
	Pitch                       Hash = 0x55005 // pitch
	Pitch_Range                 Hash = 0x5500b // pitch-range
	Place_Content               Hash = 0xc400d // place-content
	Place_Items                 Hash = 0xc4d0b // place-items
	Place_Self                  Hash = 0xc7e0a // place-self
	Play_During                 Hash = 0xcd10b // play-during
	Position                    Hash = 0x13908 // position
	Powderblue                  Hash = 0xc9b0a // powderblue
	Progid                      Hash = 0xca506 // progid
	Pt                          Hash = 0x39302 // pt
	Px                          Hash = 0x55d02 // px
	Q                           Hash = 0x64d01 // q
	Quotes                      Hash = 0xcb706 // quotes
	Rad                         Hash = 0x903   // rad
	Radial_Gradient             Hash = 0x90f   // radial-gradient
	Repeat                      Hash = 0xc206  // repeat
	Repeat_X                    Hash = 0x1c308 // repeat-x
	Repeat_Y                    Hash = 0xc208  // repeat-y
	Rgb                         Hash = 0x2903  // rgb
	Rgba                        Hash = 0x2904  // rgba
	Richness                    Hash = 0xae08  // richness
	Right                       Hash = 0x31905 // right
	Rosybrown                   Hash = 0xf309  // rosybrown
	Round                       Hash = 0x3005  // round
	Row_Gap                     Hash = 0x6ec07 // row-gap
	Royalblue                   Hash = 0x69509 // royalblue
	Ruby_Align                  Hash = 0xd930a // ruby-align
	Ruby_Overhang               Hash = 0xe00d  // ruby-overhang
	Ruby_Position               Hash = 0x1340d // ruby-position
	S                           Hash = 0x201   // s
	Saddlebrown                 Hash = 0xb50b  // saddlebrown
	Sandybrown                  Hash = 0x3850a // sandybrown
	Sans_Serif                  Hash = 0x39b0a // sans-serif
	Scroll                      Hash = 0x12006 // scroll
	Scrollbar_3d_Light_Color    Hash = 0xd7c18 // scrollbar-3d-light-color
	Scrollbar_Arrow_Color       Hash = 0x12015 // scrollbar-arrow-color
	Scrollbar_Base_Color        Hash = 0x8a614 // scrollbar-base-color
	Scrollbar_Dark_Shadow_Color Hash = 0x5d31b // scrollbar-dark-shadow-color
	Scrollbar_Face_Color        Hash = 0x61114 // scrollbar-face-color
	Scrollbar_Highlight_Color   Hash = 0x7cb19 // scrollbar-highlight-color
	Scrollbar_Shadow_Color      Hash = 0x87116 // scrollbar-shadow-color
	Scrollbar_Track_Color       Hash = 0x72315 // scrollbar-track-color
	Seagreen                    Hash = 0x93c08 // seagreen
	Seashell                    Hash = 0x2c308 // seashell
	Serif                       Hash = 0x3a005 // serif
	Size                        Hash = 0x1d604 // size
	Slateblue                   Hash = 0x95509 // slateblue
	Slategray                   Hash = 0xbfe09 // slategray
	Small                       Hash = 0x68f05 // small
	Smaller                     Hash = 0x68f07 // smaller
	Solid                       Hash = 0x74c05 // solid
	Space                       Hash = 0x6905  // space
	Speak                       Hash = 0x78105 // speak
	Speak_Header                Hash = 0x7810c // speak-header
	Speak_Numeral               Hash = 0x7f90d // speak-numeral
	Speak_Punctuation           Hash = 0xaf211 // speak-punctuation
	Speech_Rate                 Hash = 0xc570b // speech-rate
	Springgreen                 Hash = 0xa710b // springgreen
	Steelblue                   Hash = 0x96309 // steelblue
	Stress                      Hash = 0x11b06 // stress
	Stroke                      Hash = 0xc7806 // stroke
	Supports                    Hash = 0xcbc08 // supports
	Table_Layout                Hash = 0xcf20c // table-layout
	Text_Align                  Hash = 0x10e0a // text-align
	Text_Align_Last             Hash = 0x10e0f // text-align-last
	Text_Autospace              Hash = 0x4400e // text-autospace
	Text_Decoration             Hash = 0x7e0f  // text-decoration
	Text_Decoration_Color       Hash = 0x2a115 // text-decoration-color
	Text_Decoration_Line        Hash = 0x7e14  // text-decoration-line
	Text_Decoration_Style       Hash = 0xb5115 // text-decoration-style
	Text_Decoration_Thickness   Hash = 0xc6019 // text-decoration-thickness
	Text_Emphasis               Hash = 0x170d  // text-emphasis
	Text_Emphasis_Color         Hash = 0x1713  // text-emphasis-color
	Text_Indent                 Hash = 0x3f0b  // text-indent
	Text_Justify                Hash = 0x490c  // text-justify
	Text_Kashida_Space          Hash = 0x5c12  // text-kashida-space
	Text_Overflow               Hash = 0x980d  // text-overflow
	Text_Shadow                 Hash = 0xd6d0b // text-shadow
	Text_Transform              Hash = 0xda40e // text-transform
	Text_Underline_Position     Hash = 0xdc717 // text-underline-position
	Top                         Hash = 0x3be03 // top
	Transition                  Hash = 0x4750a // transition
	Transition_Delay            Hash = 0x59a10 // transition-delay
	Transition_Duration         Hash = 0xb9413 // transition-duration
	Transition_Property         Hash = 0x47513 // transition-property
	Transition_Timing_Function  Hash = 0xa281a // transition-timing-function
	Transparent                 Hash = 0xd150b // transparent
	Turn                        Hash = 0xd1f04 // turn
	Turquoise                   Hash = 0xa8209 // turquoise
	Unicode_Bidi                Hash = 0xcc40c // unicode-bidi
	Unicode_Range               Hash = 0xd230d // unicode-range
	Unset                       Hash = 0xd3005 // unset
	Url                         Hash = 0x3f403 // url
	Var                         Hash = 0x64503 // var
	Vertical_Align              Hash = 0x7e60e // vertical-align
	Visibility                  Hash = 0x4f70a // visibility
	Voice_Family                Hash = 0xd350c // voice-family
	Volume                      Hash = 0xd4106 // volume
	White                       Hash = 0x7b05  // white
	White_Space                 Hash = 0x6500b // white-space
	Whitesmoke                  Hash = 0x5c30a // whitesmoke
	Widows                      Hash = 0xd7706 // widows
	Width                       Hash = 0x26b05 // width
	Word_Break                  Hash = 0x1670a // word-break
	Word_Spacing                Hash = 0x28e0c // word-spacing
	Word_Wrap                   Hash = 0xd0209 // word-wrap
	Writing_Mode                Hash = 0xc8f0c // writing-mode
	X_Large                     Hash = 0xa707  // x-large
	X_Small                     Hash = 0x68d07 // x-small
	Xx_Large                    Hash = 0xa608  // xx-large
	Xx_Small                    Hash = 0x68c08 // xx-small
	Yellow                      Hash = 0x76506 // yellow
	Yellowgreen                 Hash = 0x7650b // yellowgreen
	Z_Index                     Hash = 0x68607 // z-index
)

Identifiers for the hashes associated with the text in the comments.

func ToHash added in v2.7.0

func ToHash(s []byte) Hash

ToHash returns a hash Hash for a given []byte. Hash is a uint32 that is associated with the text in []byte. It returns zero if no match found.

func (Hash) Bytes added in v2.9.10

func (i Hash) Bytes() []byte

Bytes returns the text associated with the hash.

func (Hash) String added in v2.7.0

func (i Hash) String() string

String returns the text associated with the hash.

type Minifier

type Minifier struct {
	KeepCSS2  bool
	Precision int // number of significant digits
	// contains filtered or unexported fields
}

Minifier is a CSS minifier.

func (*Minifier) Minify

func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, params map[string]string) error

Minify minifies CSS data, it reads from r and writes to w.

type Token

type Token struct {
	css.TokenType
	Data       []byte
	Args       []Token // only filled for functions
	Fun, Ident Hash    // only filled for functions and identifiers respectively
}

Token is a parsed token with extra information for functions.

func (Token) Equal

func (t Token) Equal(t2 Token) bool

Equal returns true if both tokens are equal.

func (Token) IsLength added in v2.7.0

func (t Token) IsLength() bool

IsLength returns true if the token is a length.

func (Token) IsLengthPercentage added in v2.7.0

func (t Token) IsLengthPercentage() bool

IsLengthPercentage returns true if the token is a length or percentage token.

func (Token) IsZero added in v2.7.0

func (t Token) IsZero() bool

IsZero return true if a dimension, percentage, or number token is zero.

func (Token) String

func (t Token) String() string

Jump to

Keyboard shortcuts

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