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

styleToAttribute and related functions do not apply for style attributes #254

Open
tndev opened this issue Dec 23, 2016 · 2 comments
Open

Comments

@tndev
Copy link

tndev commented Dec 23, 2016

Is there a reason why juice not use the informations stored in the style attributes for:

  • applyHeightAttributes
  • applyWidthAttributes
  • styleToAttribute

e.g. <img style="width: 100px"> will remain <img style="width: 100px">.

But

<style>
img {
     width: 100px;
}
</style>
<img>

Will become <img style="width: 100px" width="100px">

Or have I overlooked an option there?

The reason I ask is because, when styling e.g. html emails using a WYSIWYG editor like CKEditor, then then most of the styles are applied using the style tag.

If this option does not exists right now then I would suggest to add it.

@tndev tndev changed the title applyHeightAttributes and related functions do not apply for style attributes styleToAttribute and related functions do not apply for style attributes Dec 23, 2016
@jrit
Copy link
Collaborator

jrit commented Dec 24, 2016

The reason is that juice is conceived as a way to inline CSS into style tags, so it doesn't currently take any information from style tags and apply them elsewhere. It is a valid point though, so if someone wants to create a PR to update it that would be welcome.

@HowardChris
Copy link

Where does it take the information from to change the CSS and add as HTML attribute?

I am trying to get a CSS background-color to bgcolor on a td?

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

No branches or pull requests

3 participants