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

Chaining variables in media queries results in duplicated blocks #67

Open
deioo opened this issue Feb 1, 2018 · 2 comments
Open

Chaining variables in media queries results in duplicated blocks #67

deioo opened this issue Feb 1, 2018 · 2 comments
Labels

Comments

@deioo
Copy link

deioo commented Feb 1, 2018

The issue might seem related to #64, the difference being that there is no problem with nesting in the example below.

The issue can be replicated in the playground with the following input:

:root {
  --space-small: 10px;
  --space-large: 20px;
}

@media (min-width: 768px) {
  :root {
    --space-small: 20px;
    --space-large: 30px;
  }
}

h1 {
  padding: var(--space-small) var(--space-large);
}

h2 {
  padding: var(--space-small);
}

In the output, the h2 is defined as expected, while h1's media query block gets duplicated a few times:

h1 {
  padding: 10px 20px;
}

@media (min-width: 768px) {

  h1 {
  padding: 20px 30px;
  }
}

@media (min-width: 768px) {

  h1 {
  padding: 20px 30px;
  }
}

@media (min-width: 768px) {

  h1 {
  padding: 20px 30px;
  }
}

@media (min-width: 768px) {

  h1 {
  padding: 20px 30px;
  }
}

If using 3 values for padding, the level of replication is increased.

@runar
Copy link

runar commented Sep 24, 2019

Any news on this?

@maccapakka
Copy link

I'd love an update on this. We want to implement this package at our company but this is a massive blocker.

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

4 participants