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

mobileOn -mobileOff don't work #22

Open
erdemildiz opened this issue Jan 18, 2017 · 4 comments
Open

mobileOn -mobileOff don't work #22

erdemildiz opened this issue Jan 18, 2017 · 4 comments

Comments

@erdemildiz
Copy link

Hello everyone;

We are using email-framwork for our mails. Sometimes we need to seperate views for device width. For example; For mobile and desktop using different view, so we decided to use mobileOn and mobileOff, but when we add <style> at the top of page, It didn't work in gmail. Gmail removes all <style> tags, so the mail view is shown as desktop.

How can we fix. Thanks

@jameswilson
Copy link
Contributor

You need to use a tool like https://github.com/jjriv/emogrifier to apply all styles in <style> tags to their respective HTML tags before sending out your emails.

@jameswilson
Copy link
Contributor

Unfortunately this wont help you with mobile styles if you're using media queries and breakpoints. I don't think there is any workaround.

@g13nn
Copy link
Owner

g13nn commented Mar 21, 2017

Apologies for my late reply, to my knowledge there is no workaround to hide all on android devices using Gmail. This may help -> http://freshinbox.com/blog/targeting-new-gmail-css/

@oscarOficial
Copy link

@erdemildiz I had also this same issue and found out that the problem was in the selector:
*[class="mobileOff"] { width: 0px !important; display: none !important; } *[class="mobileOn"] { display: block !important; max-height:none !important; }
In my case I did:
.mobileOff { width: 0px !important; display: none !important; } .mobileOn { display: block !important; max-height:none !important; }

I dont know if it will have some side effects. But I hope it work for you too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants