Closed iChenLei closed 2 years ago
Looks great! Thanks so much! One thing I'm thinking of -- IIRC, I believe there are tests somewhere that test attribute equality. Essentially there are tests like:
.foo when ([attr=value] = [attr="value"]) { }
So we may want to add this attribute selector to the equality check as well. IMO I feel like these equality checks are an overly-specific feature of Less, but since they exist, we want to make sure they don't break or that equality isn't true when the additional cif
is present on one side of the comparison (and is true when, for example, one side side has a different casing than the other).
.foo when ([attr="value" i] = [attr="value" I]) { } // should be true and output .foo {}
In other words, the flag should probably serialize to the lower-case variant. Probably? What do you think? I don't want to over-engineer / over-think this, but I thought I should at least make you aware of it.
@matthew-dean Thanks for review, will add more unit test soon. 😄
@matthew-dean Sir, looks like current not support use when
to compare attrbuite selectors(without case-insensitive flag) ?
@iChenLei Oh, no? Then never mind! Thanks for checking it out!
@matthew-dean puppeteer e2e test often fail. 😢 https://github.com/less/less.js/runs/4619921788?check_suite_focus=true
What:
add support for case-insensitive attribute selectors try to fix https://github.com/less/less.js/issues/3027 https://github.com/less/less.js/issues/3670 https://github.com/go-gitea/gitea/pull/15520 https://github.com/go-gitea/gitea/issues/15565
Why:
CSS spec -> https://www.w3.org/TR/selectors-4/#attribute-case
How:
https://github.com/less/less.js/issues/3027#issuecomment-828223873
Checklist:
cc @matthew-dean