Working with the CSSstyleSheet
API
- Changing the selectorText -
Continuing story in the exchange of views in the topic css-tricks.com/an-introduction-and-guide-to-the-css-object-model-cssom, especially about the
CodePen 'Changing the SelectorText'.
The test pages are stand-alone, so the CodePen machine can not influence the results.
Tested are Firefox, Chrome, Opera and IE-11 on desktop under Windows-7.
The CodePen results
But first: the results when the CodePen is used directly on the CodePen site.
- I changed in the CSS panel the selector
.component
in.composition
. - Result: positive in Firefox, Chrome and Opera (IE-11 can't be tested in CodePen).
The change is displayed after a click on the button (as well as the adding ofa:active
to thea:hover
selector). - But:
the displayed initial selectorText (above the button) is changed as well: immediately, without waiting for the button click.
It seems CodePen is applying the javascript again (of his own accord) after a change in the HTMl or CSS panel.
Conclusion
- Time to drop the CodePen codes in a stand-alone version, and see what happens!