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

Variables not defined for selectors of higher specificity #98

Closed
yangshun opened this issue Apr 17, 2019 · 1 comment
Closed

Variables not defined for selectors of higher specificity #98

yangshun opened this issue Apr 17, 2019 · 1 comment

Comments

@yangshun
Copy link

yangshun commented Apr 17, 2019

Thanks for this awesome plugin! I have some questions regarding how the plugin deals with selectors of higher specificity.

I see that

.button {
  --button-background-color: red;	
  color: var(--button-background-color);
}

.button:hover {
  --button-background-color: green;
}

correctly becomes

.button {	
  color: red;
}
.button:hover {	
  color: green;
}

because .button:hover is a pseudoclass of .button.

But the following:

.button {
  --button-background-color: red;	
  color: var(--button-background-color);
}
.button.button-primary {
  --button-background-color: green;
}

produces just

.button {	
  color: red;
}

I was expecting the following because .button.button-primary is more specific than .button:

.button.button-primary {	
  color: green;
}

Is this a bug or is this intended? If it's a bug I could try sending a PR to fix it.

@MadLittleMods
Copy link
Owner

Duplicate of #77

@MadLittleMods MadLittleMods marked this as a duplicate of #77 Apr 17, 2019
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