Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSS] Add rounding strategy keywords #4049

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CSS/CSS.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -2819,6 +2819,10 @@ contexts:
- include: function-arguments-prototype
- include: comma-delimiters
- include: attr-functions
# round() keywords
- match: (?:down|nearest|to-zero|up){{break}}
scope: keyword.other.round.strategy.css
# common constants
- match: (?:e|pi){{break}}
scope: constant.language.css
- match: -?infinity{{break}}
Expand Down
34 changes: 34 additions & 0 deletions CSS/syntax_test_css.css
Original file line number Diff line number Diff line change
Expand Up @@ -3615,6 +3615,40 @@
/* ^^ constant.language.css */
}

.test-round-function {
top: round(down 10px var(--interval));
/* ^^^^^ meta.function-call.identifier.css support.function.calc.css */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.css meta.group.css */
/* ^^^^ keyword.other.round.strategy.css */
/* ^^^^ meta.number.integer.decimal.css */
/* ^^^ support.function.var.css */
/* ^^^^^^^^^^ variable.other.custom-property.css */

top: round(nearest 10px var(--interval));
/* ^^^^^ meta.function-call.identifier.css support.function.calc.css */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.css meta.group.css */
/* ^^^^^^^ keyword.other.round.strategy.css */
/* ^^^^ meta.number.integer.decimal.css */
/* ^^^ support.function.var.css */
/* ^^^^^^^^^^ variable.other.custom-property.css */

top: round(to-zero 10px var(--interval));
/* ^^^^^ meta.function-call.identifier.css support.function.calc.css */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.css meta.group.css */
/* ^^^^^^^ keyword.other.round.strategy.css */
/* ^^^^ meta.number.integer.decimal.css */
/* ^^^ support.function.var.css */
/* ^^^^^^^^^^ variable.other.custom-property.css */

top: round(up 10px var(--interval));
/* ^^^^^ meta.function-call.identifier.css support.function.calc.css */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.css meta.group.css */
/* ^^ keyword.other.round.strategy.css */
/* ^^^^ meta.number.integer.decimal.css */
/* ^^^ support.function.var.css */
/* ^^^^^^^^^^ variable.other.custom-property.css */
}

.test-toggle-function {
top: toggle(5px red preserve-3d);
/* ^^^^^^ support.function.toggle.css */
Expand Down