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

Master fix 3622 #4298

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Master fix 3622 #4298

wants to merge 4 commits into from

Conversation

puckowski
Copy link
Contributor

What:

Contains fixes for a variety of syntax raised in #3622

Why:

Existing less code was too rigid and expected ) where a list of selectors was possible.

Checklist:

  • Documentation
  • Added/updated unit tests
  • Code complete

The following Less.js:

@-moz-document domain("example.com") {
  :is(
    [a1],
    [a2]
  ):is(
    [a3],
    [a4]:not(
      :is([a5],[a6])
    ):is(
      [a7]:not(:is([a8],[a9])),
      [b1]:not(:is([b2],[b3]))
    ):is(
      [b4],[b5]
    ),
    [b6],
    [b7]
  ) {
    color: red; }

}

@-moz-document domain("example.com") {
	:is([foo], [bar] /* :is(a, b) */, [baz]) {
		color: red; }
}

@color: red green;

each(@color, {
  :is(.color-@{key},
  .focus-color-@{key}:focus,
  .hover-color-@{key}:hover) {
    color: @value !important;
  }
});

becomes the following CSS:

@-moz-document domain("example.com") {
  :is(
    [a1],
    [a2]
  ):is( [a3], [a4]:not( :is([a5],[a6])):is( [a7]:not(:is([a8],[a9])), [b1]:not(:is([b2],[b3]))):is(
      [b4],[b5]
    ), [b6], [b7]) {
    color: red;
  }
}
@-moz-document domain("example.com") {
  :is([foo], [bar], [baz]) {
    color: red;
  }
}
:is(.color-1, .focus-color-1:focus, .hover-color-1:hover) {
  color: red !important;
}
:is(.color-2, .focus-color-2:focus, .hover-color-2:hover) {
  color: green !important;
}

* Fix issue less#3622 by resolving rigid parethensis parsing issues.
* Improve logic for different scenarios for issue less#3622.
* Refactor and cleanup unused code for issue less#3622.
* Fix for issue less#3622. Add incorrectly removed code back in for merge.
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant