[gtksourceview] css.lang: Add keyword arguments for CSS3 functions



commit bb6a105f23099aab141ad212ef4e087f595de896
Author: Jeffery To <jeffery to gmail com>
Date:   Wed May 9 04:51:18 2018 +0800

    css.lang: Add keyword arguments for CSS3 functions
    
    This adds a css3-function-arguments context to highlight keyword
    arguments for CSS3 functions.
    
    This also adds named colors as values to match in the function context,
    which will work when bug 795947 is resolved.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795949

 data/language-specs/css.lang       |   26 ++++++++++++++++++++++++++
 tests/syntax-highlighting/file.css |    4 ++++
 2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/data/language-specs/css.lang b/data/language-specs/css.lang
index 9361401..4d3b2bf 100644
--- a/data/language-specs/css.lang
+++ b/data/language-specs/css.lang
@@ -1079,6 +1079,29 @@
       <keyword>zoom-out</keyword>
     </context>
 
+    <context id="css3-function-arguments" style-ref="property-values">
+      <keyword>at</keyword>
+      <keyword>auto-fill</keyword>
+      <keyword>auto-fit</keyword>
+      <keyword>auto</keyword>
+      <keyword>bottom</keyword>
+      <keyword>center</keyword>
+      <keyword>circle</keyword>
+      <keyword>closest-corner</keyword>
+      <keyword>closest-side</keyword>
+      <keyword>ellipse</keyword>
+      <keyword>end</keyword>
+      <keyword>farthest-corner</keyword>
+      <keyword>farthest-side</keyword>
+      <keyword>left</keyword>
+      <keyword>max-content</keyword>
+      <keyword>min-content</keyword>
+      <keyword>right</keyword>
+      <keyword>start</keyword>
+      <keyword>top</keyword>
+      <keyword>to</keyword>
+    </context>
+
     <context id="style-block">
       <start>\{</start>
       <end>\}</end>
@@ -1134,9 +1157,12 @@
         <context ref="def:escape"/>
         <context ref="def:line-continue"/>
         <context ref="hexadecimal-color"/>
+        <context ref="css3-named-color"/>
+        <context ref="named-color"/>
         <context ref="resolution"/>
         <context ref="dimension"/>
         <context ref="number"/>
+        <context ref="css3-function-arguments"/>
         <context ref="function"/>
       </include>
     </context>
diff --git a/tests/syntax-highlighting/file.css b/tests/syntax-highlighting/file.css
index edd802f..7eec0aa 100644
--- a/tests/syntax-highlighting/file.css
+++ b/tests/syntax-highlighting/file.css
@@ -29,12 +29,16 @@ INPUT::PLACEHOLDER {
 
 @media all {
     * ~ ul {
+        background-image: linear-gradient(to left top, #fff, blue);
         padding: 10VW;
     }
     @media screen and (orientation: portrait) {
         .heading > .news {
             background-image: url(image.png);
         }
+        .grid {
+            grid-template-columns: repeat(2, minmax(max-content, 300px) 1fr) 100px;
+        }
     }
     @media print and (min-monochrome: 16) {
         body {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]