Skip to content

Commit

Permalink
Merge pull request #1162 from forkeith/1066_css_translateZ
Browse files Browse the repository at this point in the history
[CSS] support 0 lengths i.e. for translateZ function and var function in other transform functions
  • Loading branch information
wbond committed Sep 19, 2017
2 parents 577ad28 + de08a6d commit 1b20678
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CSS/CSS.sublime-syntax
Expand Up @@ -1032,6 +1032,7 @@ contexts:
pop: true
- include: comma-delimiter
- include: number-type
- include: var-function

# transform functions with comma separated <number> or <length> types
# translate(), translate3d()
Expand All @@ -1050,6 +1051,7 @@ contexts:
- include: percentage-type
- include: length-type
- include: number-type
- include: var-function

# transform functions with a single <number> or <length> type
# translateX(), translateY()
Expand Down Expand Up @@ -1966,6 +1968,8 @@ contexts:
scope: constant.numeric.css
captures:
1: keyword.other.unit.css
- match: '0\b(?!%)'
scope: constant.numeric.css

time-type:
- match: '{{number}}({{duration_units}})\b'
Expand Down
12 changes: 12 additions & 0 deletions CSS/syntax_test_css.css
Expand Up @@ -631,8 +631,13 @@
/* ^^^ constant.numeric.css */

top: translateX(1%);
/* ^^^^^^^^^^ support.function.transform */
/* ^^ constant.numeric.css */

top: translateZ(0);
/* ^^^^^^^^^^ support.function.transform */
/* ^ constant.numeric.css */

top: skewY(1deg);
/* ^^^^^ support.function.transform.css */
/* ^^^^ constant.numeric.css */
Expand All @@ -654,6 +659,13 @@
top: skewY(1rad) rotate(1turn);
/* ^^^^^^ support.function.transform.css */
/* ^^^^^ constant.numeric.css */

transform: translate(var(--center), 0) scale(var(--ripple-scale), 1);
/* ^^^^^^^^^ support.function.transform */
/* ^^^ support.function.var */
/* ^^^^^^^^ support.type.custom-property */
/* ^ constant.numeric */
/* ^^^ support.function.var */
}

.test-timing-functions {
Expand Down

0 comments on commit 1b20678

Please sign in to comment.