Closed redonkulus closed 4 years ago
Hello @redonkulus, thank you for your time and suggestion!
Just id
seems very limiting to me, considering that by default injector creates multiple style
tags, which means they all will have the same id
, which is generally not the best practice.
I propose the following - add selector
option to injector with the following rules:
id
attribute start selector with #
class
attribute start selector with .
selector
data attributePlease let me know if that will work for you.
That works for me as long as I can target a specific id for my usecase.
Done, although I did generalize it further than I mentioned before, to simply adding attributes as object, just like you suggested. You can read the docs here. Let me know if this solves your problem!
@Anidetrix tried it locally and it works great! thanks for the quick turnaround, really helped me out.
@redonkulus I'm glad, good luck with your work! Closing this issue then, can be reopened if needed.
I need to pass an
id
attribute to the injectedstyle
tag so that I can access the CSS later on. Is it possible to add this functionality? It could be generic and support any number of attribute via some object passed into inject options...