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

The custom properties shim alters the cascade order incorrectly #2621

Closed
philipwalton opened this issue Oct 24, 2015 · 2 comments
Closed

The custom properties shim alters the cascade order incorrectly #2621

philipwalton opened this issue Oct 24, 2015 · 2 comments

Comments

@philipwalton
Copy link

For example, I have the following CSS in my <flex-line> element definition:

:host {
  --flex-line-gutter: 1em;
}
:host ::content > * {
  margin: var(--flex-line-gutter) 0 0 var(--flex-line-gutter);
}
:host ::content > flex-line {
  margin: 0;
}

It get translated into this:

<style scope="flex-line">
  flex-line > flex-line {
    margin: 0;
  }
</style>
<style scope="flex-line-0">
  flex-line.flex-line-0 > * {
    margin: 1em 0 0 1em;
  }
</style>

As you can see, the order of the rules has been reversed and the specificity of the first content rule has increased, completely changing the cascade order.

If you're going to change the specificity of a rule (which I understand you have to in some cases) you should normalize it so all rules are increased by the same relative specificity.

@TimvdLippe
Copy link
Contributor

This issues was fixed in #2642 but not closed.

@ebidel
Copy link
Contributor

ebidel commented Jan 3, 2016

Thanks Tim.

Phil holler if you see anything contrary.

@ebidel ebidel closed this as completed Jan 3, 2016
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

4 participants