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

skip selectors starting with '@' #15

Merged
merged 2 commits into from
Jan 3, 2012
Merged

Conversation

revolunet
Copy link
Contributor

Hi !

Tiny fix for issue #14

nosetests runs OK

Thanks ;)

@peterbe
Copy link
Owner

peterbe commented Jan 3, 2012

Can you add a unit test to demonstrate that it works?

@revolunet
Copy link
Contributor Author

done

i think the media query should be removed as any CSS rule.

peterbe pushed a commit that referenced this pull request Jan 3, 2012
skip selectors starting with '@'
@peterbe peterbe merged commit 3b9f03b into peterbe:master Jan 3, 2012
@peterbe
Copy link
Owner

peterbe commented Jan 3, 2012

Well done @revolunet! Thanks!

@revolunet
Copy link
Contributor Author

thanks to you, great work !

@dhruv
Copy link

dhruv commented Oct 26, 2013

@peterbe, @revolunet : Given most people are working on responsive emails, and that major clients are now supporting media queries(http://litmus.com/help/email-clients/media-query-support), do you guys think you'd be open to a patch that leaves media queries(at the very least, ones with screen and width in there) untouched?

@peterbe
Copy link
Owner

peterbe commented Oct 26, 2013

@dhruv Yes! I'd love that. I think it should be a configurable option.

@scottwb
Copy link

scottwb commented Nov 15, 2014

For anyone else that arrived here because of problems with their @media and @import (e.g., for google fonts) being completely stripped out by pre-mailer...here is the solution I came up with. It looks like this solution is intentionally supported but I did not find it in the docs -- I only discovered it by stepping through the premailer code:

<html>
  <head>
    <!-- Tell premailer to ignore this style tag and put all your
         @media and @import statements here
    -->
    <style data-premailer='ignore'>
      @import url(http://fonts.googleapis.com/css?family=Open+Sans)
    </style>

    <!-- Go ahead with the rest of your <style> as usual to have it inlined. -->
  </head>
  <body>...</body>
</html>

@peterbe
Copy link
Owner

peterbe commented Nov 15, 2014

Thanks @scottwb !
I suspect premailer needs better documentation so that a troubleshooting section could describe a case like this and be easily findable with a google search.

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

Successfully merging this pull request may close these issues.

4 participants