table.go 8.8 KB

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