DevTools/CSSTips: Difference between revisions

No edit summary
Line 104: Line 104:


Sometimes you have a style that you want to turn on and off. For example a tree twisty, a tab background, etc. The Mozilla way is to perform the toggle using an attribute rather than a class. So:
Sometimes you have a style that you want to turn on and off. For example a tree twisty, a tab background, etc. The Mozilla way is to perform the toggle using an attribute rather than a class. So:
  .tree-node[opened] { background-image: url(down-arrow.png); }
  .tree-node[opened] {
  .tree-node:not([opened]) { background-image: url(right-arrow.png); }
  background-image: url(down-arrow.png);
}
  .tree-node:not([opened]) {
  background-image: url(right-arrow.png);
}


== The Mozilla Environment ==
== The Mozilla Environment ==
Confirmed users
295

edits