1package css
  2
  3var optionalZeroDimension = map[string]bool{
  4	"px":   true,
  5	"mm":   true,
  6	"q":    true,
  7	"cm":   true,
  8	"in":   true,
  9	"pt":   true,
 10	"pc":   true,
 11	"ch":   true,
 12	"em":   true,
 13	"ex":   true,
 14	"rem":  true,
 15	"vh":   true,
 16	"vw":   true,
 17	"vmin": true,
 18	"vmax": true,
 19	"deg":  true,
 20	"grad": true,
 21	"rad":  true,
 22	"turn": true,
 23}
 24
 25// Uses http://www.w3.org/TR/2010/PR-css3-color-20101028/ for colors
 26
 27// ShortenColorHex maps a color hexcode to its shorter name
 28var ShortenColorHex = map[string][]byte{
 29	"#000080": []byte("navy"),
 30	"#008000": []byte("green"),
 31	"#008080": []byte("teal"),
 32	"#4b0082": []byte("indigo"),
 33	"#800000": []byte("maroon"),
 34	"#800080": []byte("purple"),
 35	"#808000": []byte("olive"),
 36	"#808080": []byte("gray"),
 37	"#a0522d": []byte("sienna"),
 38	"#a52a2a": []byte("brown"),
 39	"#c0c0c0": []byte("silver"),
 40	"#cd853f": []byte("peru"),
 41	"#d2b48c": []byte("tan"),
 42	"#da70d6": []byte("orchid"),
 43	"#dda0dd": []byte("plum"),
 44	"#ee82ee": []byte("violet"),
 45	"#f0e68c": []byte("khaki"),
 46	"#f0ffff": []byte("azure"),
 47	"#f5deb3": []byte("wheat"),
 48	"#f5f5dc": []byte("beige"),
 49	"#fa8072": []byte("salmon"),
 50	"#faf0e6": []byte("linen"),
 51	"#ff6347": []byte("tomato"),
 52	"#ff7f50": []byte("coral"),
 53	"#ffa500": []byte("orange"),
 54	"#ffc0cb": []byte("pink"),
 55	"#ffd700": []byte("gold"),
 56	"#ffe4c4": []byte("bisque"),
 57	"#fffafa": []byte("snow"),
 58	"#fffff0": []byte("ivory"),
 59	"#ff0000": []byte("red"),
 60	"#f00":    []byte("red"),
 61}
 62
 63// ShortenColorName maps a color name to its shorter hexcode
 64var ShortenColorName = map[Hash][]byte{
 65	Black:                []byte("#000"),
 66	Darkblue:             []byte("#00008b"),
 67	Mediumblue:           []byte("#0000cd"),
 68	Darkgreen:            []byte("#006400"),
 69	Darkcyan:             []byte("#008b8b"),
 70	Deepskyblue:          []byte("#00bfff"),
 71	Darkturquoise:        []byte("#00ced1"),
 72	Mediumspringgreen:    []byte("#00fa9a"),
 73	Springgreen:          []byte("#00ff7f"),
 74	Midnightblue:         []byte("#191970"),
 75	Dodgerblue:           []byte("#1e90ff"),
 76	Lightseagreen:        []byte("#20b2aa"),
 77	Forestgreen:          []byte("#228b22"),
 78	Seagreen:             []byte("#2e8b57"),
 79	Darkslategray:        []byte("#2f4f4f"),
 80	Limegreen:            []byte("#32cd32"),
 81	Mediumseagreen:       []byte("#3cb371"),
 82	Turquoise:            []byte("#40e0d0"),
 83	Royalblue:            []byte("#4169e1"),
 84	Steelblue:            []byte("#4682b4"),
 85	Darkslateblue:        []byte("#483d8b"),
 86	Mediumturquoise:      []byte("#48d1cc"),
 87	Darkolivegreen:       []byte("#556b2f"),
 88	Cadetblue:            []byte("#5f9ea0"),
 89	Cornflowerblue:       []byte("#6495ed"),
 90	Mediumaquamarine:     []byte("#66cdaa"),
 91	Slateblue:            []byte("#6a5acd"),
 92	Olivedrab:            []byte("#6b8e23"),
 93	Slategray:            []byte("#708090"),
 94	Lightslateblue:       []byte("#789"),
 95	Mediumslateblue:      []byte("#7b68ee"),
 96	Lawngreen:            []byte("#7cfc00"),
 97	Chartreuse:           []byte("#7fff00"),
 98	Aquamarine:           []byte("#7fffd4"),
 99	Lightskyblue:         []byte("#87cefa"),
100	Blueviolet:           []byte("#8a2be2"),
101	Darkmagenta:          []byte("#8b008b"),
102	Saddlebrown:          []byte("#8b4513"),
103	Darkseagreen:         []byte("#8fbc8f"),
104	Lightgreen:           []byte("#90ee90"),
105	Mediumpurple:         []byte("#9370db"),
106	Darkviolet:           []byte("#9400d3"),
107	Palegreen:            []byte("#98fb98"),
108	Darkorchid:           []byte("#9932cc"),
109	Yellowgreen:          []byte("#9acd32"),
110	Darkgray:             []byte("#a9a9a9"),
111	Lightblue:            []byte("#add8e6"),
112	Greenyellow:          []byte("#adff2f"),
113	Paleturquoise:        []byte("#afeeee"),
114	Lightsteelblue:       []byte("#b0c4de"),
115	Powderblue:           []byte("#b0e0e6"),
116	Firebrick:            []byte("#b22222"),
117	Darkgoldenrod:        []byte("#b8860b"),
118	Mediumorchid:         []byte("#ba55d3"),
119	Rosybrown:            []byte("#bc8f8f"),
120	Darkkhaki:            []byte("#bdb76b"),
121	Mediumvioletred:      []byte("#c71585"),
122	Indianred:            []byte("#cd5c5c"),
123	Chocolate:            []byte("#d2691e"),
124	Lightgray:            []byte("#d3d3d3"),
125	Goldenrod:            []byte("#daa520"),
126	Palevioletred:        []byte("#db7093"),
127	Gainsboro:            []byte("#dcdcdc"),
128	Burlywood:            []byte("#deb887"),
129	Lightcyan:            []byte("#e0ffff"),
130	Lavender:             []byte("#e6e6fa"),
131	Darksalmon:           []byte("#e9967a"),
132	Palegoldenrod:        []byte("#eee8aa"),
133	Lightcoral:           []byte("#f08080"),
134	Aliceblue:            []byte("#f0f8ff"),
135	Honeydew:             []byte("#f0fff0"),
136	Sandybrown:           []byte("#f4a460"),
137	Whitesmoke:           []byte("#f5f5f5"),
138	Mintcream:            []byte("#f5fffa"),
139	Ghostwhite:           []byte("#f8f8ff"),
140	Antiquewhite:         []byte("#faebd7"),
141	Lightgoldenrodyellow: []byte("#fafad2"),
142	Fuchsia:              []byte("#f0f"),
143	Magenta:              []byte("#f0f"),
144	Deeppink:             []byte("#ff1493"),
145	Orangered:            []byte("#ff4500"),
146	Darkorange:           []byte("#ff8c00"),
147	Lightsalmon:          []byte("#ffa07a"),
148	Lightpink:            []byte("#ffb6c1"),
149	Peachpuff:            []byte("#ffdab9"),
150	Navajowhite:          []byte("#ffdead"),
151	Moccasin:             []byte("#ffe4b5"),
152	Mistyrose:            []byte("#ffe4e1"),
153	Blanchedalmond:       []byte("#ffebcd"),
154	Papayawhip:           []byte("#ffefd5"),
155	Lavenderblush:        []byte("#fff0f5"),
156	Seashell:             []byte("#fff5ee"),
157	Cornsilk:             []byte("#fff8dc"),
158	Lemonchiffon:         []byte("#fffacd"),
159	Floralwhite:          []byte("#fffaf0"),
160	Yellow:               []byte("#ff0"),
161	Lightyellow:          []byte("#ffffe0"),
162	White:                []byte("#fff"),
163}
164
165// PropertyOverrides is a map of which properties are overridden by the given property.
166var PropertyOverrides = map[Hash][]Hash{
167	Background:      {Background, Background_Image, Background_Position, Background_Size, Background_Repeat, Background_Origin, Background_Clip, Background_Attachment, Background_Color},
168	Font:            {Font, Font_Style, Font_Variant, Font_Weight, Font_Stretch, Font_Size, Font_Family, Line_Height},
169	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},
170	Border_Width:    {Border_Width, Border_Top_Width, Border_Right_Width, Border_Bottom_Width, Border_Left_Width},
171	Border_Style:    {Border_Style, Border_Top_Style, Border_Right_Style, Border_Bottom_Style, Border_Left_Style},
172	Border_Color:    {Border_Color, Border_Top_Color, Border_Right_Color, Border_Bottom_Color, Border_Left_Color},
173	Border_Top:      {Border_Top, Border_Top_Width, Border_Top_Style, Border_Top_Color},
174	Border_Right:    {Border_Right, Border_Right_Width, Border_Right_Style, Border_Right_Color},
175	Border_Bottom:   {Border_Bottom, Border_Bottom_Width, Border_Bottom_Style, Border_Bottom_Color},
176	Border_Left:     {Border_Left, Border_Left_Width, Border_Left_Style, Border_Left_Color},
177	Margin:          {Margin, Margin_Top, Margin_Right, Margin_Bottom, Margin_Left},
178	Padding:         {Padding, Padding_Top, Padding_Right, Padding_Bottom, Padding_Left},
179	Column_Rule:     {Column_Rule, Column_Rule_Width, Column_Rule_Style, Column_Rule_Color},
180	Animation:       {Animation, Animation_Name, Animation_Duration, Animation_Timing_Function, Animation_Delay, Animation_Iteration_Count, Animation_Direction, Animation_Fill_Mode, Animation_Play_State},
181	Columns:         {Columns, Column_Width, Column_Count},
182	Flex:            {Flex, Flex_Basis, Flex_Grow, Flex_Shrink},
183	Flex_Flow:       {Flex_Flow, Flex_Direction, Flex_Wrap},
184	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},
185	Grid_Area:       {Grid_Area, Grid_Row_Start, Grid_Column_Start, Grid_Row_End, Grid_Column_End},
186	Grid_Row:        {Grid_Row, Grid_Row_Start, Grid_Row_End},
187	Grid_Column:     {Grid_Column, Grid_Column_Start, Grid_Column_End},
188	Grid_Template:   {Grid_Template, Grid_Template_Rows, Grid_Template_Columns, Grid_Template_Areas},
189	List_Style:      {List_Style, List_Style_Image, List_Style_Position, List_Style_Type},
190	Offset:          {Offset, Offset_Position, Offset_Path, Offset_Distance, Offset_Anchor, Offset_Rotate},
191	Outline:         {Outline, Outline_Width, Outline_Style, Outline_Color},
192	Overflow:        {Overflow, Overflow_X, Overflow_Y},
193	Place_Content:   {Place_Content, Align_Content, Justify_Content},
194	Place_Items:     {Place_Items, Align_Items, Justify_Items},
195	Place_Self:      {Place_Self, Align_Self, Justify_Self},
196	Text_Decoration: {Text_Decoration, Text_Decoration_Color, Text_Decoration_Color, Text_Decoration_Line, Text_Decoration_Thickness},
197	Transition:      {Transition, Transition_Property, Transition_Duration, Transition_Timing_Function, Transition_Delay},
198}