css.js 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817
  1. // CodeMirror, copyright (c) by Marijn Haverbeke and others
  2. // Distributed under an MIT license: https://codemirror.net/LICENSE
  3. ;(function (mod) {
  4. if (typeof exports == 'object' && typeof module == 'object')
  5. // CommonJS
  6. mod(require('../../lib/codemirror'))
  7. else if (typeof define == 'function' && define.amd)
  8. // AMD
  9. define(['../../lib/codemirror'], mod)
  10. // Plain browser env
  11. else mod(CodeMirror)
  12. })(function (CodeMirror) {
  13. 'use strict'
  14. CodeMirror.defineMode('css', function (config, parserConfig) {
  15. var inline = parserConfig.inline
  16. if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode('text/css')
  17. var indentUnit = config.indentUnit,
  18. tokenHooks = parserConfig.tokenHooks,
  19. documentTypes = parserConfig.documentTypes || {},
  20. mediaTypes = parserConfig.mediaTypes || {},
  21. mediaFeatures = parserConfig.mediaFeatures || {},
  22. mediaValueKeywords = parserConfig.mediaValueKeywords || {},
  23. propertyKeywords = parserConfig.propertyKeywords || {},
  24. nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
  25. fontProperties = parserConfig.fontProperties || {},
  26. counterDescriptors = parserConfig.counterDescriptors || {},
  27. colorKeywords = parserConfig.colorKeywords || {},
  28. valueKeywords = parserConfig.valueKeywords || {},
  29. allowNested = parserConfig.allowNested,
  30. lineComment = parserConfig.lineComment,
  31. supportsAtComponent = parserConfig.supportsAtComponent === true,
  32. highlightNonStandardPropertyKeywords = config.highlightNonStandardPropertyKeywords !== false
  33. var type, override
  34. function ret(style, tp) {
  35. type = tp
  36. return style
  37. }
  38. // Tokenizers
  39. function tokenBase(stream, state) {
  40. var ch = stream.next()
  41. if (tokenHooks[ch]) {
  42. var result = tokenHooks[ch](stream, state)
  43. if (result !== false) return result
  44. }
  45. if (ch == '@') {
  46. stream.eatWhile(/[\w\\\-]/)
  47. return ret('def', stream.current())
  48. } else if (ch == '=' || ((ch == '~' || ch == '|') && stream.eat('='))) {
  49. return ret(null, 'compare')
  50. } else if (ch == '"' || ch == "'") {
  51. state.tokenize = tokenString(ch)
  52. return state.tokenize(stream, state)
  53. } else if (ch == '#') {
  54. stream.eatWhile(/[\w\\\-]/)
  55. return ret('atom', 'hash')
  56. } else if (ch == '!') {
  57. stream.match(/^\s*\w*/)
  58. return ret('keyword', 'important')
  59. } else if (/\d/.test(ch) || (ch == '.' && stream.eat(/\d/))) {
  60. stream.eatWhile(/[\w.%]/)
  61. return ret('number', 'unit')
  62. } else if (ch === '-') {
  63. if (/[\d.]/.test(stream.peek())) {
  64. stream.eatWhile(/[\w.%]/)
  65. return ret('number', 'unit')
  66. } else if (stream.match(/^-[\w\\\-]*/)) {
  67. stream.eatWhile(/[\w\\\-]/)
  68. if (stream.match(/^\s*:/, false)) return ret('variable-2', 'variable-definition')
  69. return ret('variable-2', 'variable')
  70. } else if (stream.match(/^\w+-/)) {
  71. return ret('meta', 'meta')
  72. }
  73. } else if (/[,+>*\/]/.test(ch)) {
  74. return ret(null, 'select-op')
  75. } else if (ch == '.' && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
  76. return ret('qualifier', 'qualifier')
  77. } else if (/[:;{}\[\]\(\)]/.test(ch)) {
  78. return ret(null, ch)
  79. } else if (stream.match(/^[\w-.]+(?=\()/)) {
  80. if (/^(url(-prefix)?|domain|regexp)$/i.test(stream.current())) {
  81. state.tokenize = tokenParenthesized
  82. }
  83. return ret('variable callee', 'variable')
  84. } else if (/[\w\\\-]/.test(ch)) {
  85. stream.eatWhile(/[\w\\\-]/)
  86. return ret('property', 'word')
  87. } else {
  88. return ret(null, null)
  89. }
  90. }
  91. function tokenString(quote) {
  92. return function (stream, state) {
  93. var escaped = false,
  94. ch
  95. while ((ch = stream.next()) != null) {
  96. if (ch == quote && !escaped) {
  97. if (quote == ')') stream.backUp(1)
  98. break
  99. }
  100. escaped = !escaped && ch == '\\'
  101. }
  102. if (ch == quote || (!escaped && quote != ')')) state.tokenize = null
  103. return ret('string', 'string')
  104. }
  105. }
  106. function tokenParenthesized(stream, state) {
  107. stream.next() // Must be '('
  108. if (!stream.match(/^\s*[\"\')]/, false)) state.tokenize = tokenString(')')
  109. else state.tokenize = null
  110. return ret(null, '(')
  111. }
  112. // Context management
  113. function Context(type, indent, prev) {
  114. this.type = type
  115. this.indent = indent
  116. this.prev = prev
  117. }
  118. function pushContext(state, stream, type, indent) {
  119. state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context)
  120. return type
  121. }
  122. function popContext(state) {
  123. if (state.context.prev) state.context = state.context.prev
  124. return state.context.type
  125. }
  126. function pass(type, stream, state) {
  127. return states[state.context.type](type, stream, state)
  128. }
  129. function popAndPass(type, stream, state, n) {
  130. for (var i = n || 1; i > 0; i--) state.context = state.context.prev
  131. return pass(type, stream, state)
  132. }
  133. // Parser
  134. function wordAsValue(stream) {
  135. var word = stream.current().toLowerCase()
  136. if (valueKeywords.hasOwnProperty(word)) override = 'atom'
  137. else if (colorKeywords.hasOwnProperty(word)) override = 'keyword'
  138. else override = 'variable'
  139. }
  140. var states = {}
  141. states.top = function (type, stream, state) {
  142. if (type == '{') {
  143. return pushContext(state, stream, 'block')
  144. } else if (type == '}' && state.context.prev) {
  145. return popContext(state)
  146. } else if (supportsAtComponent && /@component/i.test(type)) {
  147. return pushContext(state, stream, 'atComponentBlock')
  148. } else if (/^@(-moz-)?document$/i.test(type)) {
  149. return pushContext(state, stream, 'documentTypes')
  150. } else if (/^@(media|supports|(-moz-)?document|import)$/i.test(type)) {
  151. return pushContext(state, stream, 'atBlock')
  152. } else if (/^@(font-face|counter-style)/i.test(type)) {
  153. state.stateArg = type
  154. return 'restricted_atBlock_before'
  155. } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type)) {
  156. return 'keyframes'
  157. } else if (type && type.charAt(0) == '@') {
  158. return pushContext(state, stream, 'at')
  159. } else if (type == 'hash') {
  160. override = 'builtin'
  161. } else if (type == 'word') {
  162. override = 'tag'
  163. } else if (type == 'variable-definition') {
  164. return 'maybeprop'
  165. } else if (type == 'interpolation') {
  166. return pushContext(state, stream, 'interpolation')
  167. } else if (type == ':') {
  168. return 'pseudo'
  169. } else if (allowNested && type == '(') {
  170. return pushContext(state, stream, 'parens')
  171. }
  172. return state.context.type
  173. }
  174. states.block = function (type, stream, state) {
  175. if (type == 'word') {
  176. var word = stream.current().toLowerCase()
  177. if (propertyKeywords.hasOwnProperty(word)) {
  178. override = 'property'
  179. return 'maybeprop'
  180. } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
  181. override = highlightNonStandardPropertyKeywords ? 'string-2' : 'property'
  182. return 'maybeprop'
  183. } else if (allowNested) {
  184. override = stream.match(/^\s*:(?:\s|$)/, false) ? 'property' : 'tag'
  185. return 'block'
  186. } else {
  187. override += ' error'
  188. return 'maybeprop'
  189. }
  190. } else if (type == 'meta') {
  191. return 'block'
  192. } else if (!allowNested && (type == 'hash' || type == 'qualifier')) {
  193. override = 'error'
  194. return 'block'
  195. } else {
  196. return states.top(type, stream, state)
  197. }
  198. }
  199. states.maybeprop = function (type, stream, state) {
  200. if (type == ':') return pushContext(state, stream, 'prop')
  201. return pass(type, stream, state)
  202. }
  203. states.prop = function (type, stream, state) {
  204. if (type == ';') return popContext(state)
  205. if (type == '{' && allowNested) return pushContext(state, stream, 'propBlock')
  206. if (type == '}' || type == '{') return popAndPass(type, stream, state)
  207. if (type == '(') return pushContext(state, stream, 'parens')
  208. if (type == 'hash' && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {
  209. override += ' error'
  210. } else if (type == 'word') {
  211. wordAsValue(stream)
  212. } else if (type == 'interpolation') {
  213. return pushContext(state, stream, 'interpolation')
  214. }
  215. return 'prop'
  216. }
  217. states.propBlock = function (type, _stream, state) {
  218. if (type == '}') return popContext(state)
  219. if (type == 'word') {
  220. override = 'property'
  221. return 'maybeprop'
  222. }
  223. return state.context.type
  224. }
  225. states.parens = function (type, stream, state) {
  226. if (type == '{' || type == '}') return popAndPass(type, stream, state)
  227. if (type == ')') return popContext(state)
  228. if (type == '(') return pushContext(state, stream, 'parens')
  229. if (type == 'interpolation') return pushContext(state, stream, 'interpolation')
  230. if (type == 'word') wordAsValue(stream)
  231. return 'parens'
  232. }
  233. states.pseudo = function (type, stream, state) {
  234. if (type == 'meta') return 'pseudo'
  235. if (type == 'word') {
  236. override = 'variable-3'
  237. return state.context.type
  238. }
  239. return pass(type, stream, state)
  240. }
  241. states.documentTypes = function (type, stream, state) {
  242. if (type == 'word' && documentTypes.hasOwnProperty(stream.current())) {
  243. override = 'tag'
  244. return state.context.type
  245. } else {
  246. return states.atBlock(type, stream, state)
  247. }
  248. }
  249. states.atBlock = function (type, stream, state) {
  250. if (type == '(') return pushContext(state, stream, 'atBlock_parens')
  251. if (type == '}' || type == ';') return popAndPass(type, stream, state)
  252. if (type == '{') return popContext(state) && pushContext(state, stream, allowNested ? 'block' : 'top')
  253. if (type == 'interpolation') return pushContext(state, stream, 'interpolation')
  254. if (type == 'word') {
  255. var word = stream.current().toLowerCase()
  256. if (word == 'only' || word == 'not' || word == 'and' || word == 'or') override = 'keyword'
  257. else if (mediaTypes.hasOwnProperty(word)) override = 'attribute'
  258. else if (mediaFeatures.hasOwnProperty(word)) override = 'property'
  259. else if (mediaValueKeywords.hasOwnProperty(word)) override = 'keyword'
  260. else if (propertyKeywords.hasOwnProperty(word)) override = 'property'
  261. else if (nonStandardPropertyKeywords.hasOwnProperty(word)) override = highlightNonStandardPropertyKeywords ? 'string-2' : 'property'
  262. else if (valueKeywords.hasOwnProperty(word)) override = 'atom'
  263. else if (colorKeywords.hasOwnProperty(word)) override = 'keyword'
  264. else override = 'error'
  265. }
  266. return state.context.type
  267. }
  268. states.atComponentBlock = function (type, stream, state) {
  269. if (type == '}') return popAndPass(type, stream, state)
  270. if (type == '{') return popContext(state) && pushContext(state, stream, allowNested ? 'block' : 'top', false)
  271. if (type == 'word') override = 'error'
  272. return state.context.type
  273. }
  274. states.atBlock_parens = function (type, stream, state) {
  275. if (type == ')') return popContext(state)
  276. if (type == '{' || type == '}') return popAndPass(type, stream, state, 2)
  277. return states.atBlock(type, stream, state)
  278. }
  279. states.restricted_atBlock_before = function (type, stream, state) {
  280. if (type == '{') return pushContext(state, stream, 'restricted_atBlock')
  281. if (type == 'word' && state.stateArg == '@counter-style') {
  282. override = 'variable'
  283. return 'restricted_atBlock_before'
  284. }
  285. return pass(type, stream, state)
  286. }
  287. states.restricted_atBlock = function (type, stream, state) {
  288. if (type == '}') {
  289. state.stateArg = null
  290. return popContext(state)
  291. }
  292. if (type == 'word') {
  293. if (
  294. (state.stateArg == '@font-face' && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||
  295. (state.stateArg == '@counter-style' && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase()))
  296. )
  297. override = 'error'
  298. else override = 'property'
  299. return 'maybeprop'
  300. }
  301. return 'restricted_atBlock'
  302. }
  303. states.keyframes = function (type, stream, state) {
  304. if (type == 'word') {
  305. override = 'variable'
  306. return 'keyframes'
  307. }
  308. if (type == '{') return pushContext(state, stream, 'top')
  309. return pass(type, stream, state)
  310. }
  311. states.at = function (type, stream, state) {
  312. if (type == ';') return popContext(state)
  313. if (type == '{' || type == '}') return popAndPass(type, stream, state)
  314. if (type == 'word') override = 'tag'
  315. else if (type == 'hash') override = 'builtin'
  316. return 'at'
  317. }
  318. states.interpolation = function (type, stream, state) {
  319. if (type == '}') return popContext(state)
  320. if (type == '{' || type == ';') return popAndPass(type, stream, state)
  321. if (type == 'word') override = 'variable'
  322. else if (type != 'variable' && type != '(' && type != ')') override = 'error'
  323. return 'interpolation'
  324. }
  325. return {
  326. startState: function (base) {
  327. return { tokenize: null, state: inline ? 'block' : 'top', stateArg: null, context: new Context(inline ? 'block' : 'top', base || 0, null) }
  328. },
  329. token: function (stream, state) {
  330. if (!state.tokenize && stream.eatSpace()) return null
  331. var style = (state.tokenize || tokenBase)(stream, state)
  332. if (style && typeof style == 'object') {
  333. type = style[1]
  334. style = style[0]
  335. }
  336. override = style
  337. if (type != 'comment') state.state = states[state.state](type, stream, state)
  338. return override
  339. },
  340. indent: function (state, textAfter) {
  341. var cx = state.context,
  342. ch = textAfter && textAfter.charAt(0)
  343. var indent = cx.indent
  344. if (cx.type == 'prop' && (ch == '}' || ch == ')')) cx = cx.prev
  345. if (cx.prev) {
  346. if (ch == '}' && (cx.type == 'block' || cx.type == 'top' || cx.type == 'interpolation' || cx.type == 'restricted_atBlock')) {
  347. // Resume indentation from parent context.
  348. cx = cx.prev
  349. indent = cx.indent
  350. } else if ((ch == ')' && (cx.type == 'parens' || cx.type == 'atBlock_parens')) || (ch == '{' && (cx.type == 'at' || cx.type == 'atBlock'))) {
  351. // Dedent relative to current context.
  352. indent = Math.max(0, cx.indent - indentUnit)
  353. }
  354. }
  355. return indent
  356. },
  357. electricChars: '}',
  358. blockCommentStart: '/*',
  359. blockCommentEnd: '*/',
  360. blockCommentContinue: ' * ',
  361. lineComment: lineComment,
  362. fold: 'brace',
  363. }
  364. })
  365. function keySet(array) {
  366. var keys = {}
  367. for (var i = 0; i < array.length; ++i) {
  368. keys[array[i].toLowerCase()] = true
  369. }
  370. return keys
  371. }
  372. var documentTypes_ = ['domain', 'regexp', 'url', 'url-prefix'],
  373. documentTypes = keySet(documentTypes_)
  374. var mediaTypes_ = ['all', 'aural', 'braille', 'handheld', 'print', 'projection', 'screen', 'tty', 'tv', 'embossed'],
  375. mediaTypes = keySet(mediaTypes_)
  376. var mediaFeatures_ = [
  377. 'width',
  378. 'min-width',
  379. 'max-width',
  380. 'height',
  381. 'min-height',
  382. 'max-height',
  383. 'device-width',
  384. 'min-device-width',
  385. 'max-device-width',
  386. 'device-height',
  387. 'min-device-height',
  388. 'max-device-height',
  389. 'aspect-ratio',
  390. 'min-aspect-ratio',
  391. 'max-aspect-ratio',
  392. 'device-aspect-ratio',
  393. 'min-device-aspect-ratio',
  394. 'max-device-aspect-ratio',
  395. 'color',
  396. 'min-color',
  397. 'max-color',
  398. 'color-index',
  399. 'min-color-index',
  400. 'max-color-index',
  401. 'monochrome',
  402. 'min-monochrome',
  403. 'max-monochrome',
  404. 'resolution',
  405. 'min-resolution',
  406. 'max-resolution',
  407. 'scan',
  408. 'grid',
  409. 'orientation',
  410. 'device-pixel-ratio',
  411. 'min-device-pixel-ratio',
  412. 'max-device-pixel-ratio',
  413. 'pointer',
  414. 'any-pointer',
  415. 'hover',
  416. 'any-hover',
  417. 'prefers-color-scheme',
  418. 'dynamic-range',
  419. 'video-dynamic-range',
  420. ],
  421. mediaFeatures = keySet(mediaFeatures_)
  422. var mediaValueKeywords_ = ['landscape', 'portrait', 'none', 'coarse', 'fine', 'on-demand', 'hover', 'interlace', 'progressive', 'dark', 'light', 'standard', 'high'],
  423. mediaValueKeywords = keySet(mediaValueKeywords_)
  424. var propertyKeywords_ = [
  425. 'align-content',
  426. 'align-items',
  427. 'align-self',
  428. 'alignment-adjust',
  429. 'alignment-baseline',
  430. 'all',
  431. 'anchor-point',
  432. 'animation',
  433. 'animation-delay',
  434. 'animation-direction',
  435. 'animation-duration',
  436. 'animation-fill-mode',
  437. 'animation-iteration-count',
  438. 'animation-name',
  439. 'animation-play-state',
  440. 'animation-timing-function',
  441. 'appearance',
  442. 'azimuth',
  443. 'backdrop-filter',
  444. 'backface-visibility',
  445. 'background',
  446. 'background-attachment',
  447. 'background-blend-mode',
  448. 'background-clip',
  449. 'background-color',
  450. 'background-image',
  451. 'background-origin',
  452. 'background-position',
  453. 'background-position-x',
  454. 'background-position-y',
  455. 'background-repeat',
  456. 'background-size',
  457. 'baseline-shift',
  458. 'binding',
  459. 'bleed',
  460. 'block-size',
  461. 'bookmark-label',
  462. 'bookmark-level',
  463. 'bookmark-state',
  464. 'bookmark-target',
  465. 'border',
  466. 'border-bottom',
  467. 'border-bottom-color',
  468. 'border-bottom-left-radius',
  469. 'border-bottom-right-radius',
  470. 'border-bottom-style',
  471. 'border-bottom-width',
  472. 'border-collapse',
  473. 'border-color',
  474. 'border-image',
  475. 'border-image-outset',
  476. 'border-image-repeat',
  477. 'border-image-slice',
  478. 'border-image-source',
  479. 'border-image-width',
  480. 'border-left',
  481. 'border-left-color',
  482. 'border-left-style',
  483. 'border-left-width',
  484. 'border-radius',
  485. 'border-right',
  486. 'border-right-color',
  487. 'border-right-style',
  488. 'border-right-width',
  489. 'border-spacing',
  490. 'border-style',
  491. 'border-top',
  492. 'border-top-color',
  493. 'border-top-left-radius',
  494. 'border-top-right-radius',
  495. 'border-top-style',
  496. 'border-top-width',
  497. 'border-width',
  498. 'bottom',
  499. 'box-decoration-break',
  500. 'box-shadow',
  501. 'box-sizing',
  502. 'break-after',
  503. 'break-before',
  504. 'break-inside',
  505. 'caption-side',
  506. 'caret-color',
  507. 'clear',
  508. 'clip',
  509. 'color',
  510. 'color-profile',
  511. 'column-count',
  512. 'column-fill',
  513. 'column-gap',
  514. 'column-rule',
  515. 'column-rule-color',
  516. 'column-rule-style',
  517. 'column-rule-width',
  518. 'column-span',
  519. 'column-width',
  520. 'columns',
  521. 'contain',
  522. 'content',
  523. 'counter-increment',
  524. 'counter-reset',
  525. 'crop',
  526. 'cue',
  527. 'cue-after',
  528. 'cue-before',
  529. 'cursor',
  530. 'direction',
  531. 'display',
  532. 'dominant-baseline',
  533. 'drop-initial-after-adjust',
  534. 'drop-initial-after-align',
  535. 'drop-initial-before-adjust',
  536. 'drop-initial-before-align',
  537. 'drop-initial-size',
  538. 'drop-initial-value',
  539. 'elevation',
  540. 'empty-cells',
  541. 'fit',
  542. 'fit-content',
  543. 'fit-position',
  544. 'flex',
  545. 'flex-basis',
  546. 'flex-direction',
  547. 'flex-flow',
  548. 'flex-grow',
  549. 'flex-shrink',
  550. 'flex-wrap',
  551. 'float',
  552. 'float-offset',
  553. 'flow-from',
  554. 'flow-into',
  555. 'font',
  556. 'font-family',
  557. 'font-feature-settings',
  558. 'font-kerning',
  559. 'font-language-override',
  560. 'font-optical-sizing',
  561. 'font-size',
  562. 'font-size-adjust',
  563. 'font-stretch',
  564. 'font-style',
  565. 'font-synthesis',
  566. 'font-variant',
  567. 'font-variant-alternates',
  568. 'font-variant-caps',
  569. 'font-variant-east-asian',
  570. 'font-variant-ligatures',
  571. 'font-variant-numeric',
  572. 'font-variant-position',
  573. 'font-variation-settings',
  574. 'font-weight',
  575. 'gap',
  576. 'grid',
  577. 'grid-area',
  578. 'grid-auto-columns',
  579. 'grid-auto-flow',
  580. 'grid-auto-rows',
  581. 'grid-column',
  582. 'grid-column-end',
  583. 'grid-column-gap',
  584. 'grid-column-start',
  585. 'grid-gap',
  586. 'grid-row',
  587. 'grid-row-end',
  588. 'grid-row-gap',
  589. 'grid-row-start',
  590. 'grid-template',
  591. 'grid-template-areas',
  592. 'grid-template-columns',
  593. 'grid-template-rows',
  594. 'hanging-punctuation',
  595. 'height',
  596. 'hyphens',
  597. 'icon',
  598. 'image-orientation',
  599. 'image-rendering',
  600. 'image-resolution',
  601. 'inline-box-align',
  602. 'inset',
  603. 'inset-block',
  604. 'inset-block-end',
  605. 'inset-block-start',
  606. 'inset-inline',
  607. 'inset-inline-end',
  608. 'inset-inline-start',
  609. 'isolation',
  610. 'justify-content',
  611. 'justify-items',
  612. 'justify-self',
  613. 'left',
  614. 'letter-spacing',
  615. 'line-break',
  616. 'line-height',
  617. 'line-height-step',
  618. 'line-stacking',
  619. 'line-stacking-ruby',
  620. 'line-stacking-shift',
  621. 'line-stacking-strategy',
  622. 'list-style',
  623. 'list-style-image',
  624. 'list-style-position',
  625. 'list-style-type',
  626. 'margin',
  627. 'margin-bottom',
  628. 'margin-left',
  629. 'margin-right',
  630. 'margin-top',
  631. 'marks',
  632. 'marquee-direction',
  633. 'marquee-loop',
  634. 'marquee-play-count',
  635. 'marquee-speed',
  636. 'marquee-style',
  637. 'mask-clip',
  638. 'mask-composite',
  639. 'mask-image',
  640. 'mask-mode',
  641. 'mask-origin',
  642. 'mask-position',
  643. 'mask-repeat',
  644. 'mask-size',
  645. 'mask-type',
  646. 'max-block-size',
  647. 'max-height',
  648. 'max-inline-size',
  649. 'max-width',
  650. 'min-block-size',
  651. 'min-height',
  652. 'min-inline-size',
  653. 'min-width',
  654. 'mix-blend-mode',
  655. 'move-to',
  656. 'nav-down',
  657. 'nav-index',
  658. 'nav-left',
  659. 'nav-right',
  660. 'nav-up',
  661. 'object-fit',
  662. 'object-position',
  663. 'offset',
  664. 'offset-anchor',
  665. 'offset-distance',
  666. 'offset-path',
  667. 'offset-position',
  668. 'offset-rotate',
  669. 'opacity',
  670. 'order',
  671. 'orphans',
  672. 'outline',
  673. 'outline-color',
  674. 'outline-offset',
  675. 'outline-style',
  676. 'outline-width',
  677. 'overflow',
  678. 'overflow-style',
  679. 'overflow-wrap',
  680. 'overflow-x',
  681. 'overflow-y',
  682. 'padding',
  683. 'padding-bottom',
  684. 'padding-left',
  685. 'padding-right',
  686. 'padding-top',
  687. 'page',
  688. 'page-break-after',
  689. 'page-break-before',
  690. 'page-break-inside',
  691. 'page-policy',
  692. 'pause',
  693. 'pause-after',
  694. 'pause-before',
  695. 'perspective',
  696. 'perspective-origin',
  697. 'pitch',
  698. 'pitch-range',
  699. 'place-content',
  700. 'place-items',
  701. 'place-self',
  702. 'play-during',
  703. 'position',
  704. 'presentation-level',
  705. 'punctuation-trim',
  706. 'quotes',
  707. 'region-break-after',
  708. 'region-break-before',
  709. 'region-break-inside',
  710. 'region-fragment',
  711. 'rendering-intent',
  712. 'resize',
  713. 'rest',
  714. 'rest-after',
  715. 'rest-before',
  716. 'richness',
  717. 'right',
  718. 'rotate',
  719. 'rotation',
  720. 'rotation-point',
  721. 'row-gap',
  722. 'ruby-align',
  723. 'ruby-overhang',
  724. 'ruby-position',
  725. 'ruby-span',
  726. 'scale',
  727. 'scroll-behavior',
  728. 'scroll-margin',
  729. 'scroll-margin-block',
  730. 'scroll-margin-block-end',
  731. 'scroll-margin-block-start',
  732. 'scroll-margin-bottom',
  733. 'scroll-margin-inline',
  734. 'scroll-margin-inline-end',
  735. 'scroll-margin-inline-start',
  736. 'scroll-margin-left',
  737. 'scroll-margin-right',
  738. 'scroll-margin-top',
  739. 'scroll-padding',
  740. 'scroll-padding-block',
  741. 'scroll-padding-block-end',
  742. 'scroll-padding-block-start',
  743. 'scroll-padding-bottom',
  744. 'scroll-padding-inline',
  745. 'scroll-padding-inline-end',
  746. 'scroll-padding-inline-start',
  747. 'scroll-padding-left',
  748. 'scroll-padding-right',
  749. 'scroll-padding-top',
  750. 'scroll-snap-align',
  751. 'scroll-snap-type',
  752. 'shape-image-threshold',
  753. 'shape-inside',
  754. 'shape-margin',
  755. 'shape-outside',
  756. 'size',
  757. 'speak',
  758. 'speak-as',
  759. 'speak-header',
  760. 'speak-numeral',
  761. 'speak-punctuation',
  762. 'speech-rate',
  763. 'stress',
  764. 'string-set',
  765. 'tab-size',
  766. 'table-layout',
  767. 'target',
  768. 'target-name',
  769. 'target-new',
  770. 'target-position',
  771. 'text-align',
  772. 'text-align-last',
  773. 'text-combine-upright',
  774. 'text-decoration',
  775. 'text-decoration-color',
  776. 'text-decoration-line',
  777. 'text-decoration-skip',
  778. 'text-decoration-skip-ink',
  779. 'text-decoration-style',
  780. 'text-emphasis',
  781. 'text-emphasis-color',
  782. 'text-emphasis-position',
  783. 'text-emphasis-style',
  784. 'text-height',
  785. 'text-indent',
  786. 'text-justify',
  787. 'text-orientation',
  788. 'text-outline',
  789. 'text-overflow',
  790. 'text-rendering',
  791. 'text-shadow',
  792. 'text-size-adjust',
  793. 'text-space-collapse',
  794. 'text-transform',
  795. 'text-underline-position',
  796. 'text-wrap',
  797. 'top',
  798. 'touch-action',
  799. 'transform',
  800. 'transform-origin',
  801. 'transform-style',
  802. 'transition',
  803. 'transition-delay',
  804. 'transition-duration',
  805. 'transition-property',
  806. 'transition-timing-function',
  807. 'translate',
  808. 'unicode-bidi',
  809. 'user-select',
  810. 'vertical-align',
  811. 'visibility',
  812. 'voice-balance',
  813. 'voice-duration',
  814. 'voice-family',
  815. 'voice-pitch',
  816. 'voice-range',
  817. 'voice-rate',
  818. 'voice-stress',
  819. 'voice-volume',
  820. 'volume',
  821. 'white-space',
  822. 'widows',
  823. 'width',
  824. 'will-change',
  825. 'word-break',
  826. 'word-spacing',
  827. 'word-wrap',
  828. 'writing-mode',
  829. 'z-index',
  830. // SVG-specific
  831. 'clip-path',
  832. 'clip-rule',
  833. 'mask',
  834. 'enable-background',
  835. 'filter',
  836. 'flood-color',
  837. 'flood-opacity',
  838. 'lighting-color',
  839. 'stop-color',
  840. 'stop-opacity',
  841. 'pointer-events',
  842. 'color-interpolation',
  843. 'color-interpolation-filters',
  844. 'color-rendering',
  845. 'fill',
  846. 'fill-opacity',
  847. 'fill-rule',
  848. 'image-rendering',
  849. 'marker',
  850. 'marker-end',
  851. 'marker-mid',
  852. 'marker-start',
  853. 'paint-order',
  854. 'shape-rendering',
  855. 'stroke',
  856. 'stroke-dasharray',
  857. 'stroke-dashoffset',
  858. 'stroke-linecap',
  859. 'stroke-linejoin',
  860. 'stroke-miterlimit',
  861. 'stroke-opacity',
  862. 'stroke-width',
  863. 'text-rendering',
  864. 'baseline-shift',
  865. 'dominant-baseline',
  866. 'glyph-orientation-horizontal',
  867. 'glyph-orientation-vertical',
  868. 'text-anchor',
  869. 'writing-mode',
  870. ],
  871. propertyKeywords = keySet(propertyKeywords_)
  872. var nonStandardPropertyKeywords_ = [
  873. 'accent-color',
  874. 'aspect-ratio',
  875. 'border-block',
  876. 'border-block-color',
  877. 'border-block-end',
  878. 'border-block-end-color',
  879. 'border-block-end-style',
  880. 'border-block-end-width',
  881. 'border-block-start',
  882. 'border-block-start-color',
  883. 'border-block-start-style',
  884. 'border-block-start-width',
  885. 'border-block-style',
  886. 'border-block-width',
  887. 'border-inline',
  888. 'border-inline-color',
  889. 'border-inline-end',
  890. 'border-inline-end-color',
  891. 'border-inline-end-style',
  892. 'border-inline-end-width',
  893. 'border-inline-start',
  894. 'border-inline-start-color',
  895. 'border-inline-start-style',
  896. 'border-inline-start-width',
  897. 'border-inline-style',
  898. 'border-inline-width',
  899. 'content-visibility',
  900. 'margin-block',
  901. 'margin-block-end',
  902. 'margin-block-start',
  903. 'margin-inline',
  904. 'margin-inline-end',
  905. 'margin-inline-start',
  906. 'overflow-anchor',
  907. 'overscroll-behavior',
  908. 'padding-block',
  909. 'padding-block-end',
  910. 'padding-block-start',
  911. 'padding-inline',
  912. 'padding-inline-end',
  913. 'padding-inline-start',
  914. 'scroll-snap-stop',
  915. 'scrollbar-3d-light-color',
  916. 'scrollbar-arrow-color',
  917. 'scrollbar-base-color',
  918. 'scrollbar-dark-shadow-color',
  919. 'scrollbar-face-color',
  920. 'scrollbar-highlight-color',
  921. 'scrollbar-shadow-color',
  922. 'scrollbar-track-color',
  923. 'searchfield-cancel-button',
  924. 'searchfield-decoration',
  925. 'searchfield-results-button',
  926. 'searchfield-results-decoration',
  927. 'shape-inside',
  928. 'zoom',
  929. ],
  930. nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_)
  931. var fontProperties_ = ['font-display', 'font-family', 'src', 'unicode-range', 'font-variant', 'font-feature-settings', 'font-stretch', 'font-weight', 'font-style'],
  932. fontProperties = keySet(fontProperties_)
  933. var counterDescriptors_ = ['additive-symbols', 'fallback', 'negative', 'pad', 'prefix', 'range', 'speak-as', 'suffix', 'symbols', 'system'],
  934. counterDescriptors = keySet(counterDescriptors_)
  935. var colorKeywords_ = [
  936. 'aliceblue',
  937. 'antiquewhite',
  938. 'aqua',
  939. 'aquamarine',
  940. 'azure',
  941. 'beige',
  942. 'bisque',
  943. 'black',
  944. 'blanchedalmond',
  945. 'blue',
  946. 'blueviolet',
  947. 'brown',
  948. 'burlywood',
  949. 'cadetblue',
  950. 'chartreuse',
  951. 'chocolate',
  952. 'coral',
  953. 'cornflowerblue',
  954. 'cornsilk',
  955. 'crimson',
  956. 'cyan',
  957. 'darkblue',
  958. 'darkcyan',
  959. 'darkgoldenrod',
  960. 'darkgray',
  961. 'darkgreen',
  962. 'darkgrey',
  963. 'darkkhaki',
  964. 'darkmagenta',
  965. 'darkolivegreen',
  966. 'darkorange',
  967. 'darkorchid',
  968. 'darkred',
  969. 'darksalmon',
  970. 'darkseagreen',
  971. 'darkslateblue',
  972. 'darkslategray',
  973. 'darkslategrey',
  974. 'darkturquoise',
  975. 'darkviolet',
  976. 'deeppink',
  977. 'deepskyblue',
  978. 'dimgray',
  979. 'dimgrey',
  980. 'dodgerblue',
  981. 'firebrick',
  982. 'floralwhite',
  983. 'forestgreen',
  984. 'fuchsia',
  985. 'gainsboro',
  986. 'ghostwhite',
  987. 'gold',
  988. 'goldenrod',
  989. 'gray',
  990. 'grey',
  991. 'green',
  992. 'greenyellow',
  993. 'honeydew',
  994. 'hotpink',
  995. 'indianred',
  996. 'indigo',
  997. 'ivory',
  998. 'khaki',
  999. 'lavender',
  1000. 'lavenderblush',
  1001. 'lawngreen',
  1002. 'lemonchiffon',
  1003. 'lightblue',
  1004. 'lightcoral',
  1005. 'lightcyan',
  1006. 'lightgoldenrodyellow',
  1007. 'lightgray',
  1008. 'lightgreen',
  1009. 'lightgrey',
  1010. 'lightpink',
  1011. 'lightsalmon',
  1012. 'lightseagreen',
  1013. 'lightskyblue',
  1014. 'lightslategray',
  1015. 'lightslategrey',
  1016. 'lightsteelblue',
  1017. 'lightyellow',
  1018. 'lime',
  1019. 'limegreen',
  1020. 'linen',
  1021. 'magenta',
  1022. 'maroon',
  1023. 'mediumaquamarine',
  1024. 'mediumblue',
  1025. 'mediumorchid',
  1026. 'mediumpurple',
  1027. 'mediumseagreen',
  1028. 'mediumslateblue',
  1029. 'mediumspringgreen',
  1030. 'mediumturquoise',
  1031. 'mediumvioletred',
  1032. 'midnightblue',
  1033. 'mintcream',
  1034. 'mistyrose',
  1035. 'moccasin',
  1036. 'navajowhite',
  1037. 'navy',
  1038. 'oldlace',
  1039. 'olive',
  1040. 'olivedrab',
  1041. 'orange',
  1042. 'orangered',
  1043. 'orchid',
  1044. 'palegoldenrod',
  1045. 'palegreen',
  1046. 'paleturquoise',
  1047. 'palevioletred',
  1048. 'papayawhip',
  1049. 'peachpuff',
  1050. 'peru',
  1051. 'pink',
  1052. 'plum',
  1053. 'powderblue',
  1054. 'purple',
  1055. 'rebeccapurple',
  1056. 'red',
  1057. 'rosybrown',
  1058. 'royalblue',
  1059. 'saddlebrown',
  1060. 'salmon',
  1061. 'sandybrown',
  1062. 'seagreen',
  1063. 'seashell',
  1064. 'sienna',
  1065. 'silver',
  1066. 'skyblue',
  1067. 'slateblue',
  1068. 'slategray',
  1069. 'slategrey',
  1070. 'snow',
  1071. 'springgreen',
  1072. 'steelblue',
  1073. 'tan',
  1074. 'teal',
  1075. 'thistle',
  1076. 'tomato',
  1077. 'turquoise',
  1078. 'violet',
  1079. 'wheat',
  1080. 'white',
  1081. 'whitesmoke',
  1082. 'yellow',
  1083. 'yellowgreen',
  1084. ],
  1085. colorKeywords = keySet(colorKeywords_)
  1086. var valueKeywords_ = [
  1087. 'above',
  1088. 'absolute',
  1089. 'activeborder',
  1090. 'additive',
  1091. 'activecaption',
  1092. 'afar',
  1093. 'after-white-space',
  1094. 'ahead',
  1095. 'alias',
  1096. 'all',
  1097. 'all-scroll',
  1098. 'alphabetic',
  1099. 'alternate',
  1100. 'always',
  1101. 'amharic',
  1102. 'amharic-abegede',
  1103. 'antialiased',
  1104. 'appworkspace',
  1105. 'arabic-indic',
  1106. 'armenian',
  1107. 'asterisks',
  1108. 'attr',
  1109. 'auto',
  1110. 'auto-flow',
  1111. 'avoid',
  1112. 'avoid-column',
  1113. 'avoid-page',
  1114. 'avoid-region',
  1115. 'axis-pan',
  1116. 'background',
  1117. 'backwards',
  1118. 'baseline',
  1119. 'below',
  1120. 'bidi-override',
  1121. 'binary',
  1122. 'bengali',
  1123. 'blink',
  1124. 'block',
  1125. 'block-axis',
  1126. 'blur',
  1127. 'bold',
  1128. 'bolder',
  1129. 'border',
  1130. 'border-box',
  1131. 'both',
  1132. 'bottom',
  1133. 'break',
  1134. 'break-all',
  1135. 'break-word',
  1136. 'brightness',
  1137. 'bullets',
  1138. 'button',
  1139. 'button-bevel',
  1140. 'buttonface',
  1141. 'buttonhighlight',
  1142. 'buttonshadow',
  1143. 'buttontext',
  1144. 'calc',
  1145. 'cambodian',
  1146. 'capitalize',
  1147. 'caps-lock-indicator',
  1148. 'caption',
  1149. 'captiontext',
  1150. 'caret',
  1151. 'cell',
  1152. 'center',
  1153. 'checkbox',
  1154. 'circle',
  1155. 'cjk-decimal',
  1156. 'cjk-earthly-branch',
  1157. 'cjk-heavenly-stem',
  1158. 'cjk-ideographic',
  1159. 'clear',
  1160. 'clip',
  1161. 'close-quote',
  1162. 'col-resize',
  1163. 'collapse',
  1164. 'color',
  1165. 'color-burn',
  1166. 'color-dodge',
  1167. 'column',
  1168. 'column-reverse',
  1169. 'compact',
  1170. 'condensed',
  1171. 'conic-gradient',
  1172. 'contain',
  1173. 'content',
  1174. 'contents',
  1175. 'content-box',
  1176. 'context-menu',
  1177. 'continuous',
  1178. 'contrast',
  1179. 'copy',
  1180. 'counter',
  1181. 'counters',
  1182. 'cover',
  1183. 'crop',
  1184. 'cross',
  1185. 'crosshair',
  1186. 'cubic-bezier',
  1187. 'currentcolor',
  1188. 'cursive',
  1189. 'cyclic',
  1190. 'darken',
  1191. 'dashed',
  1192. 'decimal',
  1193. 'decimal-leading-zero',
  1194. 'default',
  1195. 'default-button',
  1196. 'dense',
  1197. 'destination-atop',
  1198. 'destination-in',
  1199. 'destination-out',
  1200. 'destination-over',
  1201. 'devanagari',
  1202. 'difference',
  1203. 'disc',
  1204. 'discard',
  1205. 'disclosure-closed',
  1206. 'disclosure-open',
  1207. 'document',
  1208. 'dot-dash',
  1209. 'dot-dot-dash',
  1210. 'dotted',
  1211. 'double',
  1212. 'down',
  1213. 'drop-shadow',
  1214. 'e-resize',
  1215. 'ease',
  1216. 'ease-in',
  1217. 'ease-in-out',
  1218. 'ease-out',
  1219. 'element',
  1220. 'ellipse',
  1221. 'ellipsis',
  1222. 'embed',
  1223. 'end',
  1224. 'ethiopic',
  1225. 'ethiopic-abegede',
  1226. 'ethiopic-abegede-am-et',
  1227. 'ethiopic-abegede-gez',
  1228. 'ethiopic-abegede-ti-er',
  1229. 'ethiopic-abegede-ti-et',
  1230. 'ethiopic-halehame-aa-er',
  1231. 'ethiopic-halehame-aa-et',
  1232. 'ethiopic-halehame-am-et',
  1233. 'ethiopic-halehame-gez',
  1234. 'ethiopic-halehame-om-et',
  1235. 'ethiopic-halehame-sid-et',
  1236. 'ethiopic-halehame-so-et',
  1237. 'ethiopic-halehame-ti-er',
  1238. 'ethiopic-halehame-ti-et',
  1239. 'ethiopic-halehame-tig',
  1240. 'ethiopic-numeric',
  1241. 'ew-resize',
  1242. 'exclusion',
  1243. 'expanded',
  1244. 'extends',
  1245. 'extra-condensed',
  1246. 'extra-expanded',
  1247. 'fantasy',
  1248. 'fast',
  1249. 'fill',
  1250. 'fill-box',
  1251. 'fixed',
  1252. 'flat',
  1253. 'flex',
  1254. 'flex-end',
  1255. 'flex-start',
  1256. 'footnotes',
  1257. 'forwards',
  1258. 'from',
  1259. 'geometricPrecision',
  1260. 'georgian',
  1261. 'grayscale',
  1262. 'graytext',
  1263. 'grid',
  1264. 'groove',
  1265. 'gujarati',
  1266. 'gurmukhi',
  1267. 'hand',
  1268. 'hangul',
  1269. 'hangul-consonant',
  1270. 'hard-light',
  1271. 'hebrew',
  1272. 'help',
  1273. 'hidden',
  1274. 'hide',
  1275. 'higher',
  1276. 'highlight',
  1277. 'highlighttext',
  1278. 'hiragana',
  1279. 'hiragana-iroha',
  1280. 'horizontal',
  1281. 'hsl',
  1282. 'hsla',
  1283. 'hue',
  1284. 'hue-rotate',
  1285. 'icon',
  1286. 'ignore',
  1287. 'inactiveborder',
  1288. 'inactivecaption',
  1289. 'inactivecaptiontext',
  1290. 'infinite',
  1291. 'infobackground',
  1292. 'infotext',
  1293. 'inherit',
  1294. 'initial',
  1295. 'inline',
  1296. 'inline-axis',
  1297. 'inline-block',
  1298. 'inline-flex',
  1299. 'inline-grid',
  1300. 'inline-table',
  1301. 'inset',
  1302. 'inside',
  1303. 'intrinsic',
  1304. 'invert',
  1305. 'italic',
  1306. 'japanese-formal',
  1307. 'japanese-informal',
  1308. 'justify',
  1309. 'kannada',
  1310. 'katakana',
  1311. 'katakana-iroha',
  1312. 'keep-all',
  1313. 'khmer',
  1314. 'korean-hangul-formal',
  1315. 'korean-hanja-formal',
  1316. 'korean-hanja-informal',
  1317. 'landscape',
  1318. 'lao',
  1319. 'large',
  1320. 'larger',
  1321. 'left',
  1322. 'level',
  1323. 'lighter',
  1324. 'lighten',
  1325. 'line-through',
  1326. 'linear',
  1327. 'linear-gradient',
  1328. 'lines',
  1329. 'list-item',
  1330. 'listbox',
  1331. 'listitem',
  1332. 'local',
  1333. 'logical',
  1334. 'loud',
  1335. 'lower',
  1336. 'lower-alpha',
  1337. 'lower-armenian',
  1338. 'lower-greek',
  1339. 'lower-hexadecimal',
  1340. 'lower-latin',
  1341. 'lower-norwegian',
  1342. 'lower-roman',
  1343. 'lowercase',
  1344. 'ltr',
  1345. 'luminosity',
  1346. 'malayalam',
  1347. 'manipulation',
  1348. 'match',
  1349. 'matrix',
  1350. 'matrix3d',
  1351. 'media-controls-background',
  1352. 'media-current-time-display',
  1353. 'media-fullscreen-button',
  1354. 'media-mute-button',
  1355. 'media-play-button',
  1356. 'media-return-to-realtime-button',
  1357. 'media-rewind-button',
  1358. 'media-seek-back-button',
  1359. 'media-seek-forward-button',
  1360. 'media-slider',
  1361. 'media-sliderthumb',
  1362. 'media-time-remaining-display',
  1363. 'media-volume-slider',
  1364. 'media-volume-slider-container',
  1365. 'media-volume-sliderthumb',
  1366. 'medium',
  1367. 'menu',
  1368. 'menulist',
  1369. 'menulist-button',
  1370. 'menulist-text',
  1371. 'menulist-textfield',
  1372. 'menutext',
  1373. 'message-box',
  1374. 'middle',
  1375. 'min-intrinsic',
  1376. 'mix',
  1377. 'mongolian',
  1378. 'monospace',
  1379. 'move',
  1380. 'multiple',
  1381. 'multiple_mask_images',
  1382. 'multiply',
  1383. 'myanmar',
  1384. 'n-resize',
  1385. 'narrower',
  1386. 'ne-resize',
  1387. 'nesw-resize',
  1388. 'no-close-quote',
  1389. 'no-drop',
  1390. 'no-open-quote',
  1391. 'no-repeat',
  1392. 'none',
  1393. 'normal',
  1394. 'not-allowed',
  1395. 'nowrap',
  1396. 'ns-resize',
  1397. 'numbers',
  1398. 'numeric',
  1399. 'nw-resize',
  1400. 'nwse-resize',
  1401. 'oblique',
  1402. 'octal',
  1403. 'opacity',
  1404. 'open-quote',
  1405. 'optimizeLegibility',
  1406. 'optimizeSpeed',
  1407. 'oriya',
  1408. 'oromo',
  1409. 'outset',
  1410. 'outside',
  1411. 'outside-shape',
  1412. 'overlay',
  1413. 'overline',
  1414. 'padding',
  1415. 'padding-box',
  1416. 'painted',
  1417. 'page',
  1418. 'paused',
  1419. 'persian',
  1420. 'perspective',
  1421. 'pinch-zoom',
  1422. 'plus-darker',
  1423. 'plus-lighter',
  1424. 'pointer',
  1425. 'polygon',
  1426. 'portrait',
  1427. 'pre',
  1428. 'pre-line',
  1429. 'pre-wrap',
  1430. 'preserve-3d',
  1431. 'progress',
  1432. 'push-button',
  1433. 'radial-gradient',
  1434. 'radio',
  1435. 'read-only',
  1436. 'read-write',
  1437. 'read-write-plaintext-only',
  1438. 'rectangle',
  1439. 'region',
  1440. 'relative',
  1441. 'repeat',
  1442. 'repeating-linear-gradient',
  1443. 'repeating-radial-gradient',
  1444. 'repeating-conic-gradient',
  1445. 'repeat-x',
  1446. 'repeat-y',
  1447. 'reset',
  1448. 'reverse',
  1449. 'rgb',
  1450. 'rgba',
  1451. 'ridge',
  1452. 'right',
  1453. 'rotate',
  1454. 'rotate3d',
  1455. 'rotateX',
  1456. 'rotateY',
  1457. 'rotateZ',
  1458. 'round',
  1459. 'row',
  1460. 'row-resize',
  1461. 'row-reverse',
  1462. 'rtl',
  1463. 'run-in',
  1464. 'running',
  1465. 's-resize',
  1466. 'sans-serif',
  1467. 'saturate',
  1468. 'saturation',
  1469. 'scale',
  1470. 'scale3d',
  1471. 'scaleX',
  1472. 'scaleY',
  1473. 'scaleZ',
  1474. 'screen',
  1475. 'scroll',
  1476. 'scrollbar',
  1477. 'scroll-position',
  1478. 'se-resize',
  1479. 'searchfield',
  1480. 'searchfield-cancel-button',
  1481. 'searchfield-decoration',
  1482. 'searchfield-results-button',
  1483. 'searchfield-results-decoration',
  1484. 'self-start',
  1485. 'self-end',
  1486. 'semi-condensed',
  1487. 'semi-expanded',
  1488. 'separate',
  1489. 'sepia',
  1490. 'serif',
  1491. 'show',
  1492. 'sidama',
  1493. 'simp-chinese-formal',
  1494. 'simp-chinese-informal',
  1495. 'single',
  1496. 'skew',
  1497. 'skewX',
  1498. 'skewY',
  1499. 'skip-white-space',
  1500. 'slide',
  1501. 'slider-horizontal',
  1502. 'slider-vertical',
  1503. 'sliderthumb-horizontal',
  1504. 'sliderthumb-vertical',
  1505. 'slow',
  1506. 'small',
  1507. 'small-caps',
  1508. 'small-caption',
  1509. 'smaller',
  1510. 'soft-light',
  1511. 'solid',
  1512. 'somali',
  1513. 'source-atop',
  1514. 'source-in',
  1515. 'source-out',
  1516. 'source-over',
  1517. 'space',
  1518. 'space-around',
  1519. 'space-between',
  1520. 'space-evenly',
  1521. 'spell-out',
  1522. 'square',
  1523. 'square-button',
  1524. 'start',
  1525. 'static',
  1526. 'status-bar',
  1527. 'stretch',
  1528. 'stroke',
  1529. 'stroke-box',
  1530. 'sub',
  1531. 'subpixel-antialiased',
  1532. 'svg_masks',
  1533. 'super',
  1534. 'sw-resize',
  1535. 'symbolic',
  1536. 'symbols',
  1537. 'system-ui',
  1538. 'table',
  1539. 'table-caption',
  1540. 'table-cell',
  1541. 'table-column',
  1542. 'table-column-group',
  1543. 'table-footer-group',
  1544. 'table-header-group',
  1545. 'table-row',
  1546. 'table-row-group',
  1547. 'tamil',
  1548. 'telugu',
  1549. 'text',
  1550. 'text-bottom',
  1551. 'text-top',
  1552. 'textarea',
  1553. 'textfield',
  1554. 'thai',
  1555. 'thick',
  1556. 'thin',
  1557. 'threeddarkshadow',
  1558. 'threedface',
  1559. 'threedhighlight',
  1560. 'threedlightshadow',
  1561. 'threedshadow',
  1562. 'tibetan',
  1563. 'tigre',
  1564. 'tigrinya-er',
  1565. 'tigrinya-er-abegede',
  1566. 'tigrinya-et',
  1567. 'tigrinya-et-abegede',
  1568. 'to',
  1569. 'top',
  1570. 'trad-chinese-formal',
  1571. 'trad-chinese-informal',
  1572. 'transform',
  1573. 'translate',
  1574. 'translate3d',
  1575. 'translateX',
  1576. 'translateY',
  1577. 'translateZ',
  1578. 'transparent',
  1579. 'ultra-condensed',
  1580. 'ultra-expanded',
  1581. 'underline',
  1582. 'unidirectional-pan',
  1583. 'unset',
  1584. 'up',
  1585. 'upper-alpha',
  1586. 'upper-armenian',
  1587. 'upper-greek',
  1588. 'upper-hexadecimal',
  1589. 'upper-latin',
  1590. 'upper-norwegian',
  1591. 'upper-roman',
  1592. 'uppercase',
  1593. 'urdu',
  1594. 'url',
  1595. 'var',
  1596. 'vertical',
  1597. 'vertical-text',
  1598. 'view-box',
  1599. 'visible',
  1600. 'visibleFill',
  1601. 'visiblePainted',
  1602. 'visibleStroke',
  1603. 'visual',
  1604. 'w-resize',
  1605. 'wait',
  1606. 'wave',
  1607. 'wider',
  1608. 'window',
  1609. 'windowframe',
  1610. 'windowtext',
  1611. 'words',
  1612. 'wrap',
  1613. 'wrap-reverse',
  1614. 'x-large',
  1615. 'x-small',
  1616. 'xor',
  1617. 'xx-large',
  1618. 'xx-small',
  1619. ],
  1620. valueKeywords = keySet(valueKeywords_)
  1621. var allWords = documentTypes_
  1622. .concat(mediaTypes_)
  1623. .concat(mediaFeatures_)
  1624. .concat(mediaValueKeywords_)
  1625. .concat(propertyKeywords_)
  1626. .concat(nonStandardPropertyKeywords_)
  1627. .concat(colorKeywords_)
  1628. .concat(valueKeywords_)
  1629. CodeMirror.registerHelper('hintWords', 'css', allWords)
  1630. function tokenCComment(stream, state) {
  1631. var maybeEnd = false,
  1632. ch
  1633. while ((ch = stream.next()) != null) {
  1634. if (maybeEnd && ch == '/') {
  1635. state.tokenize = null
  1636. break
  1637. }
  1638. maybeEnd = ch == '*'
  1639. }
  1640. return ['comment', 'comment']
  1641. }
  1642. CodeMirror.defineMIME('text/css', {
  1643. documentTypes: documentTypes,
  1644. mediaTypes: mediaTypes,
  1645. mediaFeatures: mediaFeatures,
  1646. mediaValueKeywords: mediaValueKeywords,
  1647. propertyKeywords: propertyKeywords,
  1648. nonStandardPropertyKeywords: nonStandardPropertyKeywords,
  1649. fontProperties: fontProperties,
  1650. counterDescriptors: counterDescriptors,
  1651. colorKeywords: colorKeywords,
  1652. valueKeywords: valueKeywords,
  1653. tokenHooks: {
  1654. '/': function (stream, state) {
  1655. if (!stream.eat('*')) return false
  1656. state.tokenize = tokenCComment
  1657. return tokenCComment(stream, state)
  1658. },
  1659. },
  1660. name: 'css',
  1661. })
  1662. CodeMirror.defineMIME('text/x-scss', {
  1663. mediaTypes: mediaTypes,
  1664. mediaFeatures: mediaFeatures,
  1665. mediaValueKeywords: mediaValueKeywords,
  1666. propertyKeywords: propertyKeywords,
  1667. nonStandardPropertyKeywords: nonStandardPropertyKeywords,
  1668. colorKeywords: colorKeywords,
  1669. valueKeywords: valueKeywords,
  1670. fontProperties: fontProperties,
  1671. allowNested: true,
  1672. lineComment: '//',
  1673. tokenHooks: {
  1674. '/': function (stream, state) {
  1675. if (stream.eat('/')) {
  1676. stream.skipToEnd()
  1677. return ['comment', 'comment']
  1678. } else if (stream.eat('*')) {
  1679. state.tokenize = tokenCComment
  1680. return tokenCComment(stream, state)
  1681. } else {
  1682. return ['operator', 'operator']
  1683. }
  1684. },
  1685. ':': function (stream) {
  1686. if (stream.match(/^\s*\{/, false)) return [null, null]
  1687. return false
  1688. },
  1689. $: function (stream) {
  1690. stream.match(/^[\w-]+/)
  1691. if (stream.match(/^\s*:/, false)) return ['variable-2', 'variable-definition']
  1692. return ['variable-2', 'variable']
  1693. },
  1694. '#': function (stream) {
  1695. if (!stream.eat('{')) return false
  1696. return [null, 'interpolation']
  1697. },
  1698. },
  1699. name: 'css',
  1700. helperType: 'scss',
  1701. })
  1702. CodeMirror.defineMIME('text/x-less', {
  1703. mediaTypes: mediaTypes,
  1704. mediaFeatures: mediaFeatures,
  1705. mediaValueKeywords: mediaValueKeywords,
  1706. propertyKeywords: propertyKeywords,
  1707. nonStandardPropertyKeywords: nonStandardPropertyKeywords,
  1708. colorKeywords: colorKeywords,
  1709. valueKeywords: valueKeywords,
  1710. fontProperties: fontProperties,
  1711. allowNested: true,
  1712. lineComment: '//',
  1713. tokenHooks: {
  1714. '/': function (stream, state) {
  1715. if (stream.eat('/')) {
  1716. stream.skipToEnd()
  1717. return ['comment', 'comment']
  1718. } else if (stream.eat('*')) {
  1719. state.tokenize = tokenCComment
  1720. return tokenCComment(stream, state)
  1721. } else {
  1722. return ['operator', 'operator']
  1723. }
  1724. },
  1725. '@': function (stream) {
  1726. if (stream.eat('{')) return [null, 'interpolation']
  1727. if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, false)) return false
  1728. stream.eatWhile(/[\w\\\-]/)
  1729. if (stream.match(/^\s*:/, false)) return ['variable-2', 'variable-definition']
  1730. return ['variable-2', 'variable']
  1731. },
  1732. '&': function () {
  1733. return ['atom', 'atom']
  1734. },
  1735. },
  1736. name: 'css',
  1737. helperType: 'less',
  1738. })
  1739. CodeMirror.defineMIME('text/x-gss', {
  1740. documentTypes: documentTypes,
  1741. mediaTypes: mediaTypes,
  1742. mediaFeatures: mediaFeatures,
  1743. propertyKeywords: propertyKeywords,
  1744. nonStandardPropertyKeywords: nonStandardPropertyKeywords,
  1745. fontProperties: fontProperties,
  1746. counterDescriptors: counterDescriptors,
  1747. colorKeywords: colorKeywords,
  1748. valueKeywords: valueKeywords,
  1749. supportsAtComponent: true,
  1750. tokenHooks: {
  1751. '/': function (stream, state) {
  1752. if (!stream.eat('*')) return false
  1753. state.tokenize = tokenCComment
  1754. return tokenCComment(stream, state)
  1755. },
  1756. },
  1757. name: 'css',
  1758. helperType: 'gss',
  1759. })
  1760. })