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

Shorthand expansion is busted #51

Closed
wants to merge 1 commit into from

Conversation

hurrymaplelad
Copy link
Contributor

Here's a case where the shorthand form of padding behaves differently before and after inlining.

Using the styles directly, browsers set padding-bottom: 0px on the <p/>. Juice doesn't expand padding: 0px to padding-bottom, so the <p/> ends up with both padding: 0px; padding-bottom: 10px.

Anyone else caught by this? My only idea for fixing it is to expand shorthand properties as they're [parsed])(https://github.com/LearnBoost/juice/blob/master/lib/juice.js#L112). This could balloon style length. Might be worth another pass after inlining to combine styles back into shorthands where it's safe. Thoughts?

@pkat
Copy link

pkat commented Jan 16, 2014

I'm having the same issue. Would be great if juice parsed both shorthand and long properties when determining what to inline.

@rauchg
Copy link
Contributor

rauchg commented Jan 16, 2014

Good stuff.

@rauchg
Copy link
Contributor

rauchg commented Oct 27, 2014

I like the two-pass approach suggested in the issue.

parshap added a commit to parshap/juice that referenced this pull request Jan 15, 2015
Makes properties that affect each other (e.g., "padding" and
"padding-bottom") work as expected.

Fixes test cases from Automattic#51 (see
Automattic#51).
@jrit
Copy link
Collaborator

jrit commented May 4, 2015

Believe this was resolved by #96

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