Coder Social home page Coder Social logo

Comments (10)

judah-firewood avatar judah-firewood commented on July 19, 2024 1

No worries, that's where I ended up with the issue as well. I appreciate you taking the time to look into it! Have a great day. :)

from email-lab.

judah-firewood avatar judah-firewood commented on July 19, 2024

It seems my note above did the opposite of what I'm describing, lol.

Example: > becomes & g t ;

from email-lab.

nrambeck avatar nrambeck commented on July 19, 2024

hi @judah-firewood!

Not sure I understand how this is manifesting itself. Let's say you have:

.inner > tbody {
  color: #000;
}

It should inline the CSS like this in the HTML:

<div class="inner">
  ...
  <tbody style="color:#000;">
  ...
</div>

Where is the .inner &gt; tbody string getting added to the HTML?

from email-lab.

judah-firewood avatar judah-firewood commented on July 19, 2024

Correct, the inline-css works as you've described. However, I'm adding media queries which are getting added to the 'style' tag, just within the 'body' in the HTML.

from email-lab.

judah-firewood avatar judah-firewood commented on July 19, 2024

Same place that .ExternalClass and #backgroundTable can be found in the HTML of a build from project init.

from email-lab.

judah-firewood avatar judah-firewood commented on July 19, 2024
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="-ms-text-size-adjust: none; -webkit-text-size-adjust: none; background: #f2f2f2; height: 100% !important; margin: 0; mso-line-height-rule: exactly; padding: 0; width: 100% !important" bgcolor="#f2f2f2">
<style type="text/css">
  body {
    width: 100% !important;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }
  .ExternalClass {
    width: 100%;
  }
  .ExternalClass {
    line-height: 100%;
  }
  #backgroundTable {
    width: 100% !important;
    margin: 0;
    padding: 0;
    line-height: 100% !important;
  }
  @media only screen and (max-width: 640px) {
    .inner &gt; tbody {
      display: block !important;
      max-width: 600px !important;
      width: 100% !important;
      height: auto !important;
    }
    .inner &gt; tbody &gt; tr {
      display: block !important;
      max-width: 600px !important;
      width: 100% !important;
      height: auto !important;
    }
    .inner &gt; tbody &gt; tr &gt; td {
      display: block !important;
      max-width: 600px !important;
      width: 100% !important;
      height: auto !important;
    }
  }
</style>

from email-lab.

judah-firewood avatar judah-firewood commented on July 19, 2024

Apologies for the formatting

from email-lab.

nrambeck avatar nrambeck commented on July 19, 2024

Thanks for the rendered output example. I understand now. Also, I updated your code snippet to use triple backticks. That preserves your line-breaks. I'll look into it.

from email-lab.

judah-firewood avatar judah-firewood commented on July 19, 2024

Awesome, thanks!

from email-lab.

nrambeck avatar nrambeck commented on July 19, 2024

@judah-firewood, I was able to replicate your problem. Unfortunately, I don't see an immediate solution. The source of the problem is Premailer. They encode the HTML and there isn't an option to prevent that. Also, they are moving the styles that can't be inlined (like your media query rules) inside of the <body> element instead of inside the <head> element. If they put it inside the head this encoding probably wouldn't happen. See this issue with a similar complaint.

I'd recommend you post your problem in the Premailer issue queue. Also, consider rewriting your media query styles to prevent having to use the direct descendent selector which is being encoded.

Sorry, I couldn't be more helpful.

from email-lab.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.