Commit 5effc7ad authored by Jeffery To's avatar Jeffery To
parent 978ea0b1
......@@ -59,6 +59,7 @@
<!-- style properties -->
<style id="property-name" name="Property Name" map-to="def:keyword"/>
<style id="custom-property-name" name="Custom Property Name" map-to="def:identifier"/>
<!-- modifiers -->
<style id="modifier" name="Modifier" map-to="def:keyword"/>
......@@ -181,6 +182,11 @@
)
</define-regex>
<!-- https://drafts.csswg.org/css-variables/#defining-variables -->
<define-regex id="custom-property-identifier" extended="true">
(?: -- \%{identifier-chars}+ )
</define-regex>
<define-regex id="declaration-value-end">(?=[!;}])</define-regex>
<define-regex id="test-value-end">(?=\))</define-regex>
......@@ -220,6 +226,10 @@
<match>\%{vendor-specific-identifier}</match>
</context>
<context id="custom-property-name" style-ref="custom-property-name">
<match>\%{custom-property-identifier}</match>
</context>
<context id="escape" style-ref="escape">
<match>\%{escape}</match>
</context>
......@@ -553,6 +563,19 @@
</include>
</context>
<!-- https://drafts.csswg.org/css-variables/#using-variables -->
<context id="var">
<start>var\(</start>
<end>\)</end>
<include>
<context sub-pattern="0" where="start" style-ref="function"/>
<context sub-pattern="0" where="end" style-ref="function"/>
<context ref="comment"/>
<context ref="custom-property-name"/>
<context ref="function-content"/>
</include>
</context>
<context id="function-content">
<include>
<context ref="css3-function-arguments"/>
......@@ -586,6 +609,7 @@
<include>
<context ref="vendor-specific-function"/>
<context ref="url"/>
<context ref="var"/>
<context ref="function"/>
</include>
</context>
......@@ -1465,6 +1489,7 @@
<context id="property-name">
<include>
<context ref="vendor-specific-name"/>
<context ref="custom-property-name"/>
<context ref="svg-property-names"/>
<context ref="css3-property-names"/>
<context ref="property-names"/>
......
......@@ -229,6 +229,11 @@ svg|[fill] { /* attribute */
/* animatable */
transition-property: height, font-size, visibility;
/* custom properties */
--my-custom-color: #fff;
color: var(--my-custom-color);
background-color: var(--my-custom-color, white);
}
/*
......
......@@ -651,6 +651,11 @@ svg|[fill] { /* attribute */
/* animatable */
transition-property: height, font-size, visibility;
/* custom properties */
--my-custom-color: #fff;
color: var(--my-custom-color);
background-color: var(--my-custom-color, white);
}
/*
......
......@@ -676,6 +676,11 @@ svg|[fill] { /* attribute */
/* animatable */
transition-property: height, font-size, visibility;
/* custom properties */
--my-custom-color: #fff;
color: var(--my-custom-color);
background-color: var(--my-custom-color, white);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment