Skip to content

Commit bc6de15

Browse files
vrugtehagelargyleink
authored andcommitted
Add round() function
1 parent 9c69945 commit bc6de15

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

CSS3.sublime-syntax

+13
Original file line numberDiff line numberDiff line change
@@ -2436,6 +2436,15 @@ contexts:
24362436
- meta_scope: meta.function.math-return-any.css
24372437
- include: value-calc
24382438
- include: end-func
2439+
- match: \b(round)(\()
2440+
captures:
2441+
1: support.function.math-return-any.css
2442+
2: punctuation.section.function.begin.css
2443+
push:
2444+
- meta_scope: meta.function.math-return-any.css
2445+
- include: rounding-strategy
2446+
- include: value-calc
2447+
- include: end-func
24392448

24402449
func-math-return-number:
24412450
- match: \b(cos|exp|log|pow|sign|sin|sqrt|tan)(\()
@@ -10867,6 +10876,10 @@ contexts:
1086710876
- include: percentage
1086810877
- include: number
1086910878

10879+
rounding-strategy:
10880+
- match: '\b(nearest|up|down|to-zero){{b}}'
10881+
scope: support.constant.property-value.css
10882+
1087010883
# A rule is a selector and a declaration list.
1087110884
# selector {
1087210885
# property1: value1;

test/property-list.css

+5
Original file line numberDiff line numberDiff line change
@@ -4302,6 +4302,11 @@
43024302
line-height: sin(5deg);
43034303
line-height: sqrt(1.2 + .1);
43044304
line-height: tan(5deg + 10deg);
4305+
line-height: round(1.2);
4306+
line-height: round(nearest, 125%, 10%);
4307+
line-height: round(up, 5rem / 2, 1rem);
4308+
line-height: round(down, pi, 1);
4309+
line-height: round(to-zero, 5rem / 2, 1rem);
43054310

43064311
line-snap: initial;
43074312
line-snap: inherit;

0 commit comments

Comments
 (0)