haidubogdan commented on code in PR #8409:
URL: https://github.com/apache/netbeans/pull/8409#discussion_r2096540735


##########
ide/css.lib/src/org/netbeans/modules/css/lib/Css3.g:
##########
@@ -456,13 +456,32 @@ mediaType
 
 mediaExpression
     :
-    (LPAREN) => (LPAREN ws? mediaFeature mediaFeatureValue? ws? RPAREN)
+    (LPAREN) => (LPAREN ws? mediaFeatureType ws? RPAREN)
     | (HASH) => {isCssPreprocessorSource()}? sass_interpolation_expression_var
     ;
 
+mediaComparisonOperator
+    : 
+    OPEQ | LESS | LESS_OR_EQ | GREATER | GREATER_OR_EQ
+    ;    
+
+mediaRangeExplicitValue
+    : LENGTH | EMS | REM | RESOLUTION
+    ;
+
+mediaFeatureType
+    : 
+    mediaFeature (ws? (COLON | mediaComparisonOperator) ws? 
(mediaRangeExplicitValue | mediaFeatureValue))?
+    | mediaFeatureRangeContext
+;
+
+mediaFeatureRangeContext
+    :
+    (mediaRangeExplicitValue | mediaFeatureValue) ws? mediaComparisonOperator 
ws? mediaFeature (ws? mediaComparisonOperator ws? (mediaRangeExplicitValue | 
mediaFeatureValue))?

Review Comment:
   W3c css validator does not show an error for the expression, but it does 
give the warning.
   
   Yet 
   ```
   @media (30em < width > 50em) {}
   ```
   Is detected as a parser error without any explanation. So I did the 
correction.
   
   ---
   
   I also, wanted to include support for negation conditions and I think I 
managed to do it.
   
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries#testing_for_multiple_features_with_or
   
   ```
   @media (not (color)) or (hover) {
     /* … */
   }
   ```
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to