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

[0.8][styling] Want to define custom variables in the same scope as their references #1406

Closed
morethanreal opened this issue Apr 13, 2015 · 1 comment
Assignees

Comments

@morethanreal
Copy link
Contributor

I want to give a custom element a default color from the shared theme while allowing a hook for the user to customize the color by doing this:

* {
  --my-element-background-color: var(--my-theme-background-color);
}

:host {
  background-color: var(--my-element-background-color);
}

It seems like the variable definition must be in a different scope than the reference to the variable.

@sorvell
Copy link
Contributor

sorvell commented May 22, 2015

Variables now support default values via syntax like this:

background-color: var(--my-element-background-color, --my-element-default-background-color);

In addition properties can be defined in the scope that they are used via :host or :root.

@sorvell sorvell closed this as completed May 22, 2015
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

No branches or pull requests

2 participants