I'm trying to parse css by using CSSParser For example, I have css:
final String css = "@media screen and (color) { h1 { color: red } }";
I want to get this part:
{ h1 { color: red } }
But when I'm doing it by using mediaList
final CSSStyleSheet sheet = parse(css);
final CSSRule cssRule = sheet.getCssRules().item(0);
final MediaList mediaList = ((CSSMediaRuleImpl) cssRule).getMedia();
I get only
Output: screen and (color)
Maybe somebody faced with this issue?
If anyone needs answer :