Skip to content

Commit

Permalink
feat: tuple rbg/rgba
Browse files Browse the repository at this point in the history
  • Loading branch information
luckasRanarison committed Feb 28, 2024
1 parent 8602513 commit 739a6f0
Show file tree
Hide file tree
Showing 5 changed files with 1,508 additions and 1,293 deletions.
5 changes: 4 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ module.exports = grammar({

legacy_hex: ($) => seq("0x", $.hex),

rgb: ($) => seq(choice("rgb", "rgba"), "(", $.hex, ")"),
rgb: ($) =>
seq(choice("rgb", "rgba"), "(", choice($.hex, $.number_tuple), ")"),

gradient: ($) => seq($.color, repeat($.color), optional($.angle)),

number_tuple: ($) => seq($.number, repeat(seq(",", $.number))),

hex: () => /[0-9a-fA-F]{6,8}/,

angle: () => seq(/[0-9]{1,3}/, "deg"),
Expand Down
38 changes: 36 additions & 2 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 739a6f0

Please sign in to comment.