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

@apply bunch of styles for various elements #2319

Closed
nazar-pc opened this issue Aug 19, 2015 · 3 comments
Closed

@apply bunch of styles for various elements #2319

nazar-pc opened this issue Aug 19, 2015 · 3 comments
Labels

Comments

@nazar-pc
Copy link
Contributor

I'd like to use normalize.css, while avoiding to patch it with html /deep/ whatever.
Perfect solution would be to create WebComponent and then use it inside other elements with:

@apply(--normalize-css);

I mean right in CSS root, not in some specific selector.
In such way I can apply it only to elements I need, not literally everywhere.
It doesn't seem to be possible at the moment, but are there any plans for this?

@nazar-pc
Copy link
Contributor Author

How to use it: for instance, I've imported component called x-button.
This nice button comes in red color.
I want to add to it's styles:

:host([green]) {
    background: green;
}

So that it would be possible to use the same button as:

<x-button green></x-button>

Currently there is no possibility to reuse it in such way other than:

html /deep/ x-button[green] {
    background: green;
}

@dfreedm
Copy link
Member

dfreedm commented Jan 28, 2016

It sounds like what you want is style modules: https://www.polymer-project.org/1.0/docs/devguide/styling.html#style-modules

@dfreedm dfreedm closed this as completed Jan 28, 2016
@nazar-pc
Copy link
Contributor Author

Unfortunately not, it will not work for x-button[green] within Shadow DOM (native).

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

No branches or pull requests

3 participants