Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Put pseudos into <style> tag

See original GitHub issue

I 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).


Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

jritcommented, Aug 9, 2018

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 called preservedPseudos or something like that and document it, I feel like that would be a good idea. Then we can leave alone ignoredPseudos and avoid a breaking, and also confusing, change.

Sound good?

cossssmincommented, Sep 26, 2018

Since #314 adds a preservePseudos option that fixes this, I guess this issue can be closed?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found