changeset 104:f2d500466492

Add initial CSS syntax highlighting
author IBBoard <dev@ibboard.co.uk>
date Tue, 03 Apr 2018 12:53:35 +0100
parents 767746af2cfe
children 38e63e27f3da
files nanorc nanorc.d/css.nanorc
diffstat 2 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/nanorc	Mon Apr 02 20:22:55 2018 +0100
+++ b/nanorc	Tue Apr 03 12:53:35 2018 +0100
@@ -26,6 +26,9 @@
 ## PHP (and HTML)
 include "~/.nanorc.d/php.nanorc"
 
+## CSS
+include "~/.nanorc.d/css.nanorc"
+
 ## Bourne shell scripts
 include "~/.nanorc.d/sh.nanorc"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nanorc.d/css.nanorc	Tue Apr 03 12:53:35 2018 +0100
@@ -0,0 +1,24 @@
+syntax "css" "\.css$"
+comment "/*|*/"
+
+# Style rules
+color brightblue "\b(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|bgsound|big|blink|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|content|data|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|element|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hgroup|hr|html|i|iframe|image|img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|main|map|mark|marquee|menu|menuitem|meta|meter|multicol|nav|nextid|nobr|noembed|noframes|noscript|object|ol|optgroup|option|output|p|param|picture|plaintext|pre|progress|q|rp|rt|rtc|ruby|s|samp|script|section|select|slot|small|source|spacer|span|strike|strong|sub|summary|sup|table|tbody|td|template|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp)\b"
+color brightblue "::?(active|any|any-link|checked|default|defined|dir\([^\)]+\)|disabled|empty|enabled|first|first-child|first-of-type|fullscreen|focus|focus-visible|host|host\([^\)]+\)|host-context\([^\)]+\)|hover|indeterminate|in-range|invalid|lang\([^\)]+\)|last-child|last-of-type|left|link|not\([^\)]+\)|nth-child\([^\)]+\)|nth-last-child\([^\)]+\)|nth-last-of-type\([^\)]+\)|nth-of-type\([^\)]+\)|only-child|only-of-type|optional|out-of-range|read-only|read-write|required|right|root|scope|target|valid|visited)"
+color brightcyan "#[a-zA-Z][a-zA-Z0-9_]+"
+color cyan "\.([a-zA-Z0-9_]|\\[0-9]+)+"
+
+# Strings.
+color yellow ""((\\")?(\.|[^"])*[^\\])?"" "'((\\')?(\.|[^'])*[^\\])?'"
+
+# Colours and measurements
+color yellow "#([a-fA-F0-9]{3}){1,2}"
+color yellow "-?[0-9]+(\.[0-9]+)?(em|ex|pt|px|%)?"
+
+# Reset headings
+color brightblue "h[1-6]"
+
+# @-functions
+color magenta "@font-face" "@media \(.*\)"
+
+# Comments
+color green start="/\*" end="\*/"
\ No newline at end of file