Closed wc-matteo closed 7 years ago
I’d be very surprised if this worked because Applys can have multiple properties. You would have to set the important declarations within the foo apply itself.
e.g.
--foo: {
position: absolute!important;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
};
@apply --foo;
@JayGeorge Yes, I meant that calling @apply
with important
would set it for all properties.
The proplem with setting important
within the declaration block is that if you need the same properties without it, you have to duplicate all of them.
I know that this is not a common use case.
Hm, well effectively setting !important
on all the all the properties would be a bit of a sledgehammer approach.
I would suggest increasing the specificity of the class that you’re calling the apply to e.g.
body .some-class {
@apply --foo;
};
I’m not involved in the spec but I would be surprised if they made it possible to add !important to Applies.
In this case, being a style inclued in a (possibly) hostile environment, I need the (relative) security afforded by imporant
.
e.g.
@apply --foo !important;
Would it go against "the spec"?