language_css.lua 998 B

123456789101112131415161718192021222324
  1. local syntax = require "core.syntax"
  2. syntax.add {
  3. files = { "%.css$" },
  4. patterns = {
  5. { pattern = "\\.", type = "normal" },
  6. { pattern = "//.-\n", type = "comment" },
  7. { pattern = { "/%*", "%*/" }, type = "comment" },
  8. { pattern = { '"', '"', '\\' }, type = "string" },
  9. { pattern = { "'", "'", '\\' }, type = "string" },
  10. { pattern = "[%a][%w-]*%s*%f[:]", type = "keyword" },
  11. { pattern = "#%x+", type = "string" },
  12. { pattern = "-?%d+[%d%.]*p[xt]", type = "number" },
  13. { pattern = "-?%d+[%d%.]*deg", type = "number" },
  14. { pattern = "-?%d+[%d%.]*", type = "number" },
  15. { pattern = "[%a_][%w_]*", type = "symbol" },
  16. { pattern = "#[%a][%w_-]*", type = "keyword2" },
  17. { pattern = "@[%a][%w_-]*", type = "keyword2" },
  18. { pattern = "%.[%a][%w_-]*", type = "keyword2" },
  19. { pattern = "[{}:]", type = "operator" },
  20. },
  21. symbols = {},
  22. }