Put pseudos into <style> tag
See original GitHub issueI was under the impression that pseudo selectors would automatically be placed into a <style>
tag and preserved, just like media queries are. After looking around it seems like this isn’t the case.
It feels like an anti-pattern to have to use:
@media all {
a:hover {
color: red;
}
}
to get them to work.
Happy to try to put together a pull request if you think this would be valuable. In any case, I think it should be documented that ignoredPseudos
will be removed (ignored gives the wrong impression to me).
Cheers!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
Using CSS :before and :after pseudo-elements with inline CSS?
No. The style attribute only defines style properties for a given HTML element. Pseudo-classes are a member of the family of selectors, which ......
Read more >Pseudo-elements - CSS: Cascading Style Sheets | MDN
A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected element(s).
Read more >How To Create Pseudo-classes With CSS - DigitalOcean
Pseudo -classes are declared in CSS by appending a : and the name of the pseudo-class to a tag, class, or ID selector....
Read more >CSS Pseudo-elements - W3Schools
A CSS pseudo-element is used to style specified parts of an element. For example, it can be used to: Style the first letter,...
Read more >[Proposal] Expand inline style='' attributes to allow pseudo ...
Modify the grammar of the style attribute, to allow style rules containing the pseudo-only selectors to be placed after any inline style ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can pass the array from juiceClient.ignoredPseudos into utils either as an argument/option to the existing functions being called or you could define a new getter/setter on utils to handle that.
If you want to put together a PR with tests I feel like what you are suggesting makes sense.
Regarding
ignoredPseudos
as a name. It seems to be confusing already. If you want to maybe add an option calledpreservedPseudos
or something like that and document it, I feel like that would be a good idea. Then we can leave aloneignoredPseudos
and avoid a breaking, and also confusing, change.Sound good?
Since #314 adds a
preservePseudos
option that fixes this, I guess this issue can be closed?