Mega Code Archive
Store selectorss names that are registered with the StyleManager in an Array
.unusedStyleTest { fontSize:17; color:green; }
private var stylesList:Array = [
'fontSize', 'color', 'fontWeight', 'fontFamily', 'fontStyle'
];
public function showSelectors():void {
msg.text = "List all selectors, and show when they explicitly define the following:\n";
msg.text += stylesList.toString();
var selectors:Array = styleManager.selectors;
for (var i:int = 0; i < selectors.length; i++) {
msg.text += "\n\n" + selectors[i] + " {"
for (var j:int = 0; j < stylesList.length; j++) {
var s:String = CSSStyleDeclaration(styleManager.getStyleDeclaration(selectors[i])).getStyle(stylesList[j]);
if (s != null) {
msg.text += "\n " + stylesList[j] + ":" + s + ";";
}
}
msg.text += "\n}";
}
}