use of com.helger.css.decl.CSSSelector in project ph-css by phax.
the class WikiVisitSelectors method readAllSelectors.
public void readAllSelectors() {
final String sStyle = "blockquote p,\r\n" + "blockquote ul,\r\n" + "blockquote ol {\r\n" + " line-height:normal;\r\n" + " font-style:italic;\r\n" + "}\r\n" + "\r\n" + "a { color:#FFEA6F; }\r\n" + "\r\n" + "a:hover { text-decoration:none; }\r\n" + "\r\n" + "img { border:none; }";
final CascadingStyleSheet aCSS = CSSReader.readFromString(sStyle, ECSSVersion.CSS30);
final ICommonsList<String> aAllSelectors = new CommonsArrayList<>();
CSSVisitor.visitCSS(aCSS, new DefaultCSSVisitor() {
@Override
public void onStyleRuleSelector(@Nonnull final CSSSelector aSelector) {
aAllSelectors.add(aSelector.getAsCSSString(new CSSWriterSettings(ECSSVersion.CSS30)));
}
});
System.out.println(aAllSelectors);
}
Aggregations