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

Allow host to override custom properties #1459

Closed
wants to merge 1 commit into from
Closed

Allow host to override custom properties #1459

wants to merge 1 commit into from

Conversation

blasten
Copy link
Contributor

@blasten blasten commented Apr 28, 2015

I've been working with custom properties and I noticed that a host could not override the custom properties defined by the element. For example:

<style is="x-style">
 html  x-demo{
   --foo: 1px;
   color: red;
}
</style>

Now, imagine x-demo defined a default value for --foo

:host {
   --foo: 2px;
   color: blue;
}
.read-foo {
      /** color is red which is correct **/
    /** but var(--foo) is 2px  **/
}

var(--foo) should be 1px to be compliant with standard css properties.

@masonlouchart
Copy link

If I understood, you want define a style on an element but you don't want apply it. The question is, why define a style on the element ? If you allow the Host to ignore the CSS rules you'll never be able to redefine the style of a nested class.

@blasten
Copy link
Contributor Author

blasten commented Apr 30, 2015

@LM450N I actually commented more about it on #1470. I will close this pull request.

@masonlouchart
Copy link

Nice catch ! You're right, the CSS rules should be propagated. Thank you for your explanations.

@blasten blasten closed this May 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants