I created an HTML5 tool that used to be on a separate page. The client wants to include it on their page, but is concerned about CSS conflicts.
I would like to put my tool in a wrapper div with the class say 'customtool' and then the preface of each CSS selector with .customtool. I have several style sheets, and the total number of selectors is large. I am aware of the risks of human error when manually making changes to selectors.
Obviously, I can’t just aim. "Or '#', since it will not work for a type selector. .wrapper .content.customclass #div
In this case, I would like to
.customtool .wrapper .content.customclass #div
but replacing the "." with ".customtool". and '#' with '.customtool #' will give.customtool .wrapper .customtool .content.customtool. customclass .customtool #div
How could you do an automatic procedure to add a selector before each rule?
source
share