css.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
  3. Available via Academic Free License >= 2.1 OR the modified BSD license.
  4. see: http://dojotoolkit.org/license for details
  5. */
  6. if(!dojo._hasResource["dojox.highlight.languages.css"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
  7. dojo._hasResource["dojox.highlight.languages.css"] = true;
  8. dojo.provide("dojox.highlight.languages.css");
  9. dojo.require("dojox.highlight._base");
  10. dojo.require("dojox.highlight.languages.html");
  11. (function(){
  12. var dh = dojox.highlight, dhc = dh.constants, dhl = dh.languages;
  13. dhl.css = {
  14. defaultMode: {
  15. contains: ['id', 'class', 'attr_selector', 'rules', 'comment'],
  16. keywords: dhl.html.HTML_TAGS,
  17. lexems: [dhc.IDENT_RE],
  18. illegal: '='
  19. },
  20. case_insensitive: true,
  21. modes: [
  22. {
  23. className: 'id',
  24. begin: '\\#[A-Za-z0-9_-]+', end: '^'
  25. },
  26. {
  27. className: 'class',
  28. begin: '\\.[A-Za-z0-9_-]+', end: '^',
  29. relevance: 0
  30. },
  31. {
  32. className: 'attr_selector',
  33. begin: '\\[', end: '\\]',
  34. illegal: '$'
  35. },
  36. {
  37. className: 'rules',
  38. begin: '{', end: '}',
  39. lexems: ['[A-Za-z-]+'],
  40. keywords: {
  41. 'play-during': 1, 'counter-reset': 1,
  42. 'counter-increment': 1, 'min-height': 1, 'quotes': 1,
  43. 'border-top': 1, 'pitch': 1, 'font': 1, 'pause': 1,
  44. 'list-style-image': 1, 'border-width': 1, 'cue': 1,
  45. 'outline-width': 1, 'border-left': 1, 'elevation': 1,
  46. 'richness': 1, 'speech-rate': 1, 'border-bottom': 1,
  47. 'border-spacing': 1, 'background': 1, 'list-style-type': 1,
  48. 'text-align': 1, 'page-break-inside': 1, 'orphans': 1,
  49. 'page-break-before': 1, 'text-transform': 1,
  50. 'line-height': 1, 'padding-left': 1, 'font-size': 1,
  51. 'right': 1, 'word-spacing': 1, 'padding-top': 1,
  52. 'outline-style': 1, 'bottom': 1, 'content': 1,
  53. 'border-right-style': 1, 'padding-right': 1,
  54. 'border-left-style': 1, 'voice-family': 1,
  55. 'background-color': 1, 'border-bottom-color': 1,
  56. 'outline-color': 1, 'unicode-bidi': 1, 'max-width': 1,
  57. 'font-family': 1, 'caption-side': 1,
  58. 'border-right-width': 1, 'pause-before': 1,
  59. 'border-top-style': 1, 'color': 1, 'border-collapse': 1,
  60. 'border-bottom-width': 1, 'float': 1, 'height': 1,
  61. 'max-height': 1, 'margin-right': 1, 'border-top-width': 1,
  62. 'speak': 1, 'speak-header': 1, 'top': 1, 'cue-before': 1,
  63. 'min-width': 1, 'width': 1, 'font-variant': 1,
  64. 'border-top-color': 1, 'background-position': 1,
  65. 'empty-cells': 1, 'direction': 1, 'border-right': 1,
  66. 'visibility': 1, 'padding': 1, 'border-style': 1,
  67. 'background-attachment': 1, 'overflow': 1,
  68. 'border-bottom-style': 1, 'cursor': 1, 'margin': 1,
  69. 'display': 1, 'border-left-width': 1, 'letter-spacing': 1,
  70. 'vertical-align': 1, 'clip': 1, 'border-color': 1,
  71. 'list-style': 1, 'padding-bottom': 1, 'pause-after': 1,
  72. 'speak-numeral': 1, 'margin-left': 1, 'widows': 1,
  73. 'border': 1, 'font-style': 1, 'border-left-color': 1,
  74. 'pitch-range': 1, 'background-repeat': 1,
  75. 'table-layout': 1, 'margin-bottom': 1,
  76. 'speak-punctuation': 1, 'font-weight': 1,
  77. 'border-right-color': 1, 'page-break-after': 1,
  78. 'position': 1, 'white-space': 1, 'text-indent': 1,
  79. 'background-image': 1, 'volume': 1, 'stress': 1,
  80. 'outline': 1, 'clear': 1, 'z-index': 1,
  81. 'text-decoration': 1, 'margin-top': 1, 'azimuth': 1,
  82. 'cue-after': 1, 'left': 1, 'list-style-position': 1
  83. },
  84. contains: ['comment', 'value']
  85. },
  86. dhc.C_BLOCK_COMMENT_MODE,
  87. {
  88. className: 'value',
  89. begin: ':',
  90. end: ';',
  91. endsWithParent: true,
  92. excludeBegin: true,
  93. excludeEnd: true
  94. }
  95. ]
  96. };
  97. })();
  98. }