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

Using postcss-apply in Polymer 3 with webpack #41

Open
sebastianroming opened this issue Apr 13, 2018 · 3 comments
Open

Using postcss-apply in Polymer 3 with webpack #41

sebastianroming opened this issue Apr 13, 2018 · 3 comments

Comments

@sebastianroming
Copy link

Hello there,

If I declare some styles like this:

:host {
  --test-elem: {
    color:#F00;
  }
}
[...]
span.account-name {
  @apply --test-elem;
}

it works pretty well. But if I use

:host {
  --app-drawer-width: 65px;
  --app-drawer-scrim-background: #fff;
  --app-drawer-content-container: {
    background-color: #263448;
  }
}

like I should, with polymer elements (see app-drawer polymer 3 elem), it doesn't work. that's annoying :(
Do you have any solution / help for this?

@pascalduez
Copy link
Owner

Hi,

please provide a reduced and ready to debug repo or sample, so that we can have chance to try to debug.
I have no experience with Polymer though, so dunno. Are Polymer styles using PostCSS?

@sebastianroming
Copy link
Author

Polymer doesn't natively use PostCSS. I use the Polymer Skeleton from PolymerX and they use PostCSS.

I'll provide a short sample for you tomorrow.

@sebastianroming
Copy link
Author

I forked the Polymer Skeleton and created a small example for you:

https://github.com/sebastianroming/polymer-skeleton/tree/postcss-apply-sample

You need yarn to install and run:

  • clone the repo and change the branch to postcss-apply-sample
  • run yarn to install dependencies
  • run yarn dev:module to create a local development server at localhost:3000

You can see that the app-drawer doesn't get styled as defined in src/components/containers/sk-app/style.pcss, but the span.account-name does.

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