This project has moved and is read-only. For the latest updates, please go here.

How to write rule for list of CSS selectors

Jan 19, 2012 at 4:16 PM
Edited Jan 19, 2012 at 4:17 PM


I would like to ask you. Is it possible to write some rule for list of CSS selectors? For example I have following list:

frontAdmin .menu ul.leftMenu li.pc .pageTypes .item

each selector has to be represented by one node. So, I need 6 nodes. I tried to write some rules but I am not sure how to work with whitespaces between selectors. Is it not possible to write each selector on new line because we have a lot of big css files.

Thank you very much.




Feb 8, 2012 at 12:53 AM

don't quite understand what is the problem here. You should define a "selector" like this:

selector.Rule = identifier | identifier + "." + identifier;

selectorList.Rule = MakePlusRule(selectorList, selector);

cssExpr.Rule = identifier + selectorList + NewLine; 

Whitespaces are "swallowed" automatically by scanner. I don't know much about exact CSS format, so I'm not sure if I got it right. Is Line-break a meaningful terminator in CSS?