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

Wrong css property applied after restructuring #457

Open
tomasz1986 opened this issue Aug 8, 2022 · 0 comments
Open

Wrong css property applied after restructuring #457

tomasz1986 opened this issue Aug 8, 2022 · 0 comments

Comments

@tomasz1986
Copy link

tomasz1986 commented Aug 8, 2022

Before:

bdo[dir="ltr"]  { direction: ltr; unicode-bidi: bidi-override }
bdo[dir="rtl"]  { direction: rtl; unicode-bidi: bidi-override }

*[dir="ltr"]    { direction: ltr; unicode-bidi: embed }
*[dir="rtl"]    { direction: rtl; unicode-bidi: embed }

After:

bdo[dir=ltr] {
    direction: ltr
}

bdo[dir=ltr],bdo[dir=rtl] {
    unicode-bidi: bidi-override
}

[dir=ltr],[dir=rtl] {
    direction: ltr;
    unicode-bidi: embed
}

[dir=rtl],bdo[dir=rtl] {
    direction: rtl
}

The problem is

[dir=ltr],[dir=rtl] {
    direction: ltr;
    unicode-bidi: embed
}

Why is direction: ltr applied to [dir=rtl] here?

Tested with http://css.github.io/csso/csso.html v5.0.4.

Edit:

Interestingly, if I take the processed code from above and keep processing it with CSSO several more times (with restructuring enabled), then the final version is correct.

[dir=ltr],bdo[dir=ltr] {
    direction: ltr
}

bdo[dir=ltr],bdo[dir=rtl] {
    unicode-bidi: bidi-override
}

[dir=ltr],[dir=rtl] {
    unicode-bidi: embed
}

[dir=rtl],bdo[dir=rtl] {
    direction: rtl
}
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

1 participant