-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add pseudoClasses option #3
Add pseudoClasses option #3
Conversation
Hi @dan-gamble, thanks for your PR! Cheers! |
Sure :) I came across this when using another plugin postcss-ref where you can do: .foo {
background: red;
}
.bar {
color: ref(.foo, background);
} The use case i had was: .lst-Split_Item {
@apply --Font-14;
@apply --GridColumn;
width: calc(percentage(1, 2) - (var(--Grid_Gutter) * 2));
padding-top: 0.5vr;
padding-bottom: @padding-top;
font-weight: 700;
letter-spacing: calc(100em / 1000);
text-transform: uppercase;
border-bottom: 1px solid var(--Color_Border);
color: var(--Color_Blue-dark);
&:nth-child(-n+2) {
border-top: ref(^&, border-bottom);
}
} The problem here is: &:nth-child(-n+2) {
border-top: ref(^&, border-bottom);
}
Does that explain it? :) |
Now I see what you're trying to do! The main reason why postcss-nested-ancestors is not able to replace placeholders into CSS rules is that it currently cast the replacement function on CSS selectors. Anyway, we might try to merge it as an optional feature. I'll get back to you as soon as I have the time to better check your additions. Thanks again @dan-gamble! |
Awesome, thanks! I added it as an optional feature, |
Hi @dan-gamble, here is your merged pull request. |
Looks good to me :) |
Shipped in v0.1.0! |
If this is true then pseudo classes (
&:hover
,&:focus
) are included in the parent chainThis would need to be merged after #2 as it includes #2 commits in this as well :)