0

I want to be able to comb through a CSS stylesheet and select all matched values, then replace it using JavaScript. Let's say that I have 10+ values of "blue" in my stylesheet. Upon receiving user input, I want to change all the "blue" to "red" - I know there's the RegEx replace method but I'm not sure how to make it comb through a CSS stylesheet. Is this possible?

Thanks!

3
  • Do you have the stylesheet read into memory or it is a file? Commented Oct 10, 2017 at 5:34
  • stackoverflow.com/a/6620400/6773269 Commented Oct 10, 2017 at 5:35
  • Is "red" chosen from a fixed set of values? If so, why not create all stylesheets with the different colors and then only change the stylesheet itself. Commented Oct 10, 2017 at 5:51

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.