KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

226 lines
9.9KB

  1. <?php
  2. /*************************************************************************************
  3. * css.php
  4. * -------
  5. * Author: Nigel McNie (nigel@geshi.org)
  6. * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2004/06/18
  9. *
  10. * CSS language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2008/05/23 (1.0.7.22)
  15. * - Added description of extra language features (SF#1970248)
  16. * 2004/11/27 (1.0.3)
  17. * - Added support for multiple object splitters
  18. * 2004/10/27 (1.0.2)
  19. * - Changed regexps to catch "-" symbols
  20. * - Added support for URLs
  21. * 2004/08/05 (1.0.1)
  22. * - Added support for symbols
  23. * 2004/07/14 (1.0.0)
  24. * - First Release
  25. *
  26. * TODO (updated 2004/11/27)
  27. * -------------------------
  28. * * Improve or drop regexps for class/id/psuedoclass highlighting
  29. * * Re-look at keywords - possibly to make several CSS language
  30. * files, all with different versions of CSS in them
  31. *
  32. *************************************************************************************
  33. *
  34. * This file is part of GeSHi.
  35. *
  36. * GeSHi is free software; you can redistribute it and/or modify
  37. * it under the terms of the GNU General Public License as published by
  38. * the Free Software Foundation; either version 2 of the License, or
  39. * (at your option) any later version.
  40. *
  41. * GeSHi is distributed in the hope that it will be useful,
  42. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  43. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  44. * GNU General Public License for more details.
  45. *
  46. * You should have received a copy of the GNU General Public License
  47. * along with GeSHi; if not, write to the Free Software
  48. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  49. *
  50. ************************************************************************************/
  51. $language_data = array (
  52. 'LANG_NAME' => 'CSS',
  53. 'COMMENT_SINGLE' => array(1 => '@'),
  54. 'COMMENT_MULTI' => array('/*' => '*/'),
  55. 'COMMENT_REGEXP' => array(
  56. 2 => "/(?<=\\()\\s*(?:(?:[a-z0-9]+?:\\/\\/)?[a-z0-9_\\-\\.\\/:]+?)?[a-z]+?\\.[a-z]+?(\\?[^\)]+?)?\\s*?(?=\\))/i"
  57. ),
  58. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  59. 'QUOTEMARKS' => array('"', "'"),
  60. 'ESCAPE_CHAR' => '',
  61. 'ESCAPE_REGEXP' => array(
  62. //Simple Single Char Escapes
  63. //1 => "#\\\\[nfrtv\$\"\n\\\\]#i",
  64. //Hexadecimal Char Specs
  65. 2 => "#\\\\[\da-fA-F]{1,6}\s?#i",
  66. //Unicode Char Specs
  67. //3 => "#\\\\u[\da-fA-F]{1,8}#i",
  68. ),
  69. 'KEYWORDS' => array(
  70. 1 => array(
  71. 'aqua', 'azimuth', 'background-attachment', 'background-color',
  72. 'background-image', 'background-position', 'background-repeat',
  73. 'background', 'black', 'blue', 'border-bottom-color',
  74. 'border-radius', 'border-top-left-radius', 'border-top-right-radius',
  75. 'border-bottom-right-radius', 'border-bottom-left-radius',
  76. 'border-bottom-style', 'border-bottom-width', 'border-left-color',
  77. 'border-left-style', 'border-left-width', 'border-right',
  78. 'border-right-color', 'border-right-style', 'border-right-width',
  79. 'border-top-color', 'border-top-style',
  80. 'border-top-width','border-bottom', 'border-collapse',
  81. 'border-left', 'border-width', 'border-color', 'border-spacing',
  82. 'border-style', 'border-top', 'border', 'caption-side', 'clear',
  83. 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
  84. 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
  85. 'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
  86. 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
  87. 'font-weight', 'font', 'line-height', 'letter-spacing',
  88. 'list-style', 'list-style-image', 'list-style-position',
  89. 'list-style-type', 'margin-bottom', 'margin-left', 'margin-right',
  90. 'margin-top', 'margin', 'marker-offset', 'marks', 'max-height',
  91. 'max-width', 'min-height', 'min-width', 'orphans', 'outline',
  92. 'outline-color', 'outline-style', 'outline-width', 'overflow',
  93. 'padding-bottom', 'padding-left', 'padding-right', 'padding-top',
  94. 'padding', 'page', 'page-break-after', 'page-break-before',
  95. 'page-break-inside', 'pause-after', 'pause-before', 'pause',
  96. 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
  97. 'richness', 'right', 'size', 'speak-header', 'speak-numeral',
  98. 'speak-punctuation', 'speak', 'speech-rate', 'stress',
  99. 'table-layout', 'text-align', 'text-decoration', 'text-indent',
  100. 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
  101. 'vertical-align', 'visibility', 'voice-family', 'volume',
  102. 'white-space', 'widows', 'width', 'word-spacing', 'z-index',
  103. 'bottom', 'left', 'height'
  104. ),
  105. 2 => array(
  106. 'above', 'absolute', 'always', 'armenian', 'aural', 'auto',
  107. 'avoid', 'baseline', 'behind', 'below', 'bidi-override', 'blink',
  108. 'block', 'bold', 'bolder', 'both', 'capitalize', 'center-left',
  109. 'center-right', 'center', 'circle', 'cjk-ideographic',
  110. 'close-quote', 'collapse', 'condensed', 'continuous', 'crop',
  111. 'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero',
  112. 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
  113. 'e-resize', 'embed', 'extra-condensed', 'extra-expanded',
  114. 'expanded', 'fantasy', 'far-left', 'far-right', 'faster', 'fast',
  115. 'fixed', 'fuchsia', 'georgian', 'gray', 'green', 'groove',
  116. 'hebrew', 'help', 'hidden', 'hide', 'higher', 'high',
  117. 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table',
  118. 'inline', 'inset', 'inside', 'invert', 'italic', 'justify',
  119. 'katakana-iroha', 'katakana', 'landscape', 'larger', 'large',
  120. 'left-side', 'leftwards', 'level', 'lighter', 'lime',
  121. 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek',
  122. 'lower-roman', 'lowercase', 'ltr', 'lower', 'low', 'maroon',
  123. 'medium', 'message-box', 'middle', 'mix', 'monospace', 'n-resize',
  124. 'narrower', 'navy', 'ne-resize', 'no-close-quote',
  125. 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap',
  126. 'nw-resize', 'oblique', 'olive', 'once', 'open-quote', 'outset',
  127. 'outside', 'overline', 'pointer', 'portrait', 'purple', 'px',
  128. 'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb',
  129. 'ridge', 'right-side', 'rightwards', 's-resize', 'sans-serif',
  130. 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded',
  131. 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower',
  132. 'small-caps', 'small-caption', 'smaller', 'soft', 'solid',
  133. 'spell-out', 'square', 'static', 'status-bar', 'super',
  134. 'sw-resize', 'table-caption', 'table-cell', 'table-column',
  135. 'table-column-group', 'table-footer-group', 'table-header-group',
  136. 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom',
  137. 'text-top', 'thick', 'thin', 'transparent', 'ultra-condensed',
  138. 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin',
  139. 'upper-roman', 'uppercase', 'url', 'visible', 'w-resize', 'wait',
  140. 'white', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud',
  141. 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yellow',
  142. 'yes'
  143. )
  144. ),
  145. 'SYMBOLS' => array(
  146. '(', ')', '{', '}', ':', ';',
  147. '>', '+', '*', ',', '^', '='
  148. ),
  149. 'CASE_SENSITIVE' => array(
  150. GESHI_COMMENTS => false,
  151. 1 => true,
  152. 2 => true
  153. ),
  154. 'STYLES' => array(
  155. 'KEYWORDS' => array(
  156. 1 => 'color: #000000; font-weight: bold;',
  157. 2 => 'color: #993333;'
  158. ),
  159. 'COMMENTS' => array(
  160. 1 => 'color: #a1a100;',
  161. 2 => 'color: #ff0000; font-style: italic;',
  162. 'MULTI' => 'color: #808080; font-style: italic;'
  163. ),
  164. 'ESCAPE_CHAR' => array(
  165. 0 => 'color: #000099; font-weight: bold;',
  166. //1 => 'color: #000099; font-weight: bold;',
  167. 2 => 'color: #000099; font-weight: bold;'
  168. //3 => 'color: #000099; font-weight: bold;'
  169. ),
  170. 'BRACKETS' => array(
  171. 0 => 'color: #00AA00;'
  172. ),
  173. 'STRINGS' => array(
  174. 0 => 'color: #ff0000;'
  175. ),
  176. 'NUMBERS' => array(
  177. 0 => 'color: #cc66cc;'
  178. ),
  179. 'METHODS' => array(
  180. ),
  181. 'SYMBOLS' => array(
  182. 0 => 'color: #00AA00;'
  183. ),
  184. 'SCRIPT' => array(
  185. ),
  186. 'REGEXPS' => array(
  187. 0 => 'color: #cc00cc;',
  188. 1 => 'color: #6666ff;',
  189. 2 => 'color: #3333ff;',
  190. 3 => 'color: #933;'
  191. )
  192. ),
  193. 'URLS' => array(
  194. 1 => '',
  195. 2 => ''
  196. ),
  197. 'OOLANG' => false,
  198. 'OBJECT_SPLITTERS' => array(
  199. ),
  200. 'REGEXPS' => array(
  201. //DOM Node ID
  202. 0 => '\#[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*',
  203. //CSS classname
  204. 1 => '\.(?!\d)[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*\b(?=[\{\.#\s,:].|<\|)',
  205. //CSS Pseudo classes
  206. //note: & is needed for &gt; (i.e. > )
  207. 2 => '(?<!\\\\):(?!\d)[a-zA-Z0-9\-]+\b(?:\s*(?=[\{\.#a-zA-Z,:+*&](.|\n)|<\|))',
  208. //Measurements
  209. 3 => '[+\-]?(\d+|(\d*\.\d+))(em|ex|pt|px|cm|in|%)',
  210. ),
  211. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  212. 'SCRIPT_DELIMITERS' => array(
  213. ),
  214. 'HIGHLIGHT_STRICT_BLOCK' => array(
  215. ),
  216. 'TAB_WIDTH' => 4,
  217. 'PARSER_CONTROL' => array(
  218. 'KEYWORDS' => array(
  219. 'DISALLOWED_AFTER' => '(?![\-a-zA-Z0-9_\|%\\-&\.])',
  220. 'DISALLOWED_BEFORE' => '(?<![\-a-zA-Z0-9_\|%\\~&\.])'
  221. )
  222. )
  223. );
  224. ?>