aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_sass.lua
diff options
context:
space:
mode:
authorAqil Contractor <32044067+AqilCont@users.noreply.github.com>2021-03-21 16:14:46 -0400
committerGitHub <noreply@github.com>2021-03-21 16:14:46 -0400
commitf18612d0bfea24547d52a189cb2613f3cc718e68 (patch)
tree387714de8dabe6f43fa6464bfcd96ee77d2ff048 /plugins/language_sass.lua
parent225f21ea99c28d2c0f816b3c5cdf879b95248d54 (diff)
downloadlite-xl-plugins-f18612d0bfea24547d52a189cb2613f3cc718e68.tar.gz
lite-xl-plugins-f18612d0bfea24547d52a189cb2613f3cc718e68.zip
Add syntax highlighting for sass.
Diffstat (limited to 'plugins/language_sass.lua')
-rw-r--r--plugins/language_sass.lua45
1 files changed, 45 insertions, 0 deletions
diff --git a/plugins/language_sass.lua b/plugins/language_sass.lua
new file mode 100644
index 0000000..5b043c1
--- /dev/null
+++ b/plugins/language_sass.lua
@@ -0,0 +1,45 @@
+local syntax = require "core.syntax"
+
+syntax.add {
+ files = { "%.sass$" },
+ comment = "//",
+ patterns = {
+ { pattern = "/[/%*].-\n", type = "comment" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = { "'", "'", '\\' }, type = "string" },
+ { pattern = "$%w+", type = "keyword" },
+ { pattern = "@%w+", type = "literal" },
+ { pattern = "[#,]%w+", type = "function" },
+ { pattern = "&", type = "keyword2" },
+ { pattern = "[:%/%*%-]", type = "operator" },
+ { pattern = "[%a][%w-]*%s*%f[:]", type = "keyword2" },
+ { pattern = "-?%d+[%d%.]*p[xt]", type = "number" },
+ { pattern = "-?%d+[%d%.]*deg", type = "number" },
+ { pattern = "-?%d+[%d%.]*[s%%]", type = "number" },
+ { pattern = "-?%d+[%d%.]*", type = "number" },
+ { pattern = "[%a_][%w_]*", type = "symbol" },
+ },
+ symbols = {
+ ["transparent"] = "literal",
+ ["none"] = "literal",
+ ["absolute"] = "literal",
+ ["relative"] = "literal",
+ ["solid"] = "literal",
+ ["flex"] = "literal",
+ ["flex-start"] = "literal",
+ ["flex-end"] = "literal",
+ ["row"] = "literal",
+ ["center"] = "literal",
+ ["column"] = "literal",
+ ["pointer"] = "literal",
+ ["ease"] = "literal",
+ ["white"] = "function",
+ ["black"] = "function",
+ ["gray"] = "function",
+ ["blue"] = "function",
+ ["red"] = "function",
+ ["purple"] = "function",
+ ["green"] = "function",
+ ["yellow"] = "function"
+ }
+}