我将此代码放在一个文件中:
background: -moz-linear-gradient(red, orange, yellow, green, blue, indigo, violet);
Sublime Text 2似乎突出显示浅蓝色indigo
和violet
的背景:
我已经尝试了更多颜色,其中大部分颜色如chocolate
,aliceblue
,pink
等都会突出显示,但其他一些颜色如maroon
,{{ 1}},teal
等不会。
蓝色突出显示是什么意思?
答案 0 :(得分:1)
X11颜色[X11COLORS]支持受欢迎的浏览器添加 来自SVG 1.0的灰色/灰色变体。结果列表正是如此 与SVG 1.0 color keyword names相同。这个规范 将他们的定义扩展到SVG以外。
CSS.tmLanguage的相关部分:
...
<dict>
<key>color-values</key>
<dict>
<key>patterns</key>
<array>
...
<dict>
<key>comment</key>
<string>These colours are mostly recognised but will not validate. ref: http://www.w3schools.com/css/css_colornames.asp</string>
<key>match</key>
<string>\b(aliceblue|antiquewhite|aquamarine|azure|beige|bisque|blanchedalmond|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|gainsboro|ghostwhite|gold|goldenrod|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|limegreen|linen|magenta|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|oldlace|olivedrab|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|thistle|tomato|turquoise|violet|wheat|whitesmoke|yellowgreen)\b</string>
<key>name</key>
<string>invalid.deprecated.color.w3c-non-standard-color-name.css</string>
</dict>
...
</array>
</dict>
...
不同的外观是由范围界定引起的:
support.constant.color.w3c-standard-color-name.css (适用于标准颜色关键字)
invalid.deprecated.color.w3c-non-standard-color-name.css (适用于扩展颜色关键字)