Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zoho mail removes selectors with general sibling combinator ~ #121

Open
M-J-Robbins opened this issue Nov 16, 2022 · 1 comment
Open

zoho mail removes selectors with general sibling combinator ~ #121

M-J-Robbins opened this issue Nov 16, 2022 · 1 comment
Labels
Other clients Samsung, SFR, Orange, T-Online, Onet, …

Comments

@M-J-Robbins
Copy link
Contributor

Zoho mail will remove selectors that include a general sibling combinator ~. However it will still add the prefix that targets the wrapping element, meaning those styles will be applied directly to the wrapping element.

So a style like this

.foo ~ .bar{
   display: none
}

With the normal zoho prefixing we would expect it to apply as

div.zm_123456789_parse_12345678 x_12345foo ~ .x_12345bar{
  display: none
}

But instead it is applied as

div.zm_123456789_parse_12345678{
  display: none
}

Which would apply to the wrapper around the outside of our message, and in this case it will hide the whole email.


Workaround

As a workaround, we can use this quirk to apply a fix that will undo the styles we don't want on the wrapper.

.zoho ~ .zoho{
  display: block;
}

It doesn't matter what the class name is we use here as it will be removed, but to avoid potential issues with other email clients, try and use a class name that doesn't appear anywhere in the email.

We can't add specificity within the selector or by using an !important flag, so to get this to override the unwanted styles we need to place it at the end of the stylesheet.

@hteumeuleu hteumeuleu added the Other clients Samsung, SFR, Orange, T-Online, Onet, … label Nov 16, 2022
@M-J-Robbins
Copy link
Contributor Author

Also worth noting here that we can't use a shortcut like all:unset as that isn't supported. And we can't set individual properties back to initial as that isn't supported either so we need to reset every style to a default value

.zoho ~ .zoho{
  height:auto;
  width:auto;
  display:block;
  padding:0;
  border:none;
  position:static;
  margin:0;
  text-align: left;
}

This is a good starting point but you may need more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Other clients Samsung, SFR, Orange, T-Online, Onet, …
Projects
None yet
Development

No branches or pull requests

2 participants