Home › Forums › JavaScript › pesudo element change property values › Reply To: pesudo element change property values
February 12, 2018 at 4:00 am
#266783
Shikkediel
Participant
Pseudos can be selected with JS (which I didn’t realise until shortly) but are only readable. Changing their properties isn’t possible. What you would be looking for is this:
https://developer.mozilla.org/en-US/docs/Web/API/CSSRule
Like Paulie mentioned, the script will need to use a regex and go through the entire stylesheet to find a match. Both the external accessing of the file and especially this search will certainly be a slow and “intensive” approach.
An example, I found it quite complicated: