You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 18, 2022. It is now read-only.
I don't know if this can be solved in this library. However, I a) wanted to know if anyone has solved this. or b) throw some ideas out and see if anyone can take them any further
The entire tree that the css is applied to must be one dir, otherwise there is equality in specificity.
css logical properties postcss takes lines like this:
I've been trying to use css variables to accomplish it. Idea originally from reading https://css-tricks.com/logical-operations-with-css-variables/. Essentially I've come up with a couple variables that need to be set on any node that has the 'dir' attribute.
Something along the lines of
it's not quite there though, I can't get an invalid variable, haha.
there's also still the issue of what happens if both padding-inline-start and padding-inline-end were declared
The text was updated successfully, but these errors were encountered:
I would need to test this further but the basic idea is this :
create a unique variable name
assign value for rtl with [dir="rtl"] { --the-id: the-rtl-value; }
assign value for lrt with [dir="ltr"] { --the-id: the-ltr-value; }
The id's need be unique per property and selector (excluding :dir or [dir] parts).
An md5 hash of the selector and property would work well.
The tricky part is that the selector also needs to transformed in a way that it matches the elements. This is easier id :dir() is always part of a compound selector. (.foo:dir(ltr) vs :dir(ltr))
Maybe it works well enough with :not([dir="<inverse>"]).
Support of this would be limited to browsers that have variable support.
I would need to prototype this and check if there are any unexpected issues.
Work on this will continue here : csstools/postcss-plugins#88
Closing this issue here as the repo has been moved and will be archived soon, preventing further discussion.
I don't know if this can be solved in this library. However, I a) wanted to know if anyone has solved this. or b) throw some ideas out and see if anyone can take them any further
The entire tree that the css is applied to must be one dir, otherwise there is equality in specificity.
css logical properties postcss takes lines like this:
and transforms them into:
this is problematic because these are equal in specificity, so if you have nested locale changing nodes you could end up with both applied
I've been trying to use css variables to accomplish it. Idea originally from reading https://css-tricks.com/logical-operations-with-css-variables/. Essentially I've come up with a couple variables that need to be set on any node that has the 'dir' attribute.
Something along the lines of
the purpose of this is to make one of the variables invalid
with that, my hope would then be to use css variable fallbacks to
unset
propertiesit's not quite there though, I can't get an invalid variable, haha.
there's also still the issue of what happens if both padding-inline-start and padding-inline-end were declared
The text was updated successfully, but these errors were encountered: