Skip to content

Conversation

@puckowski
Copy link
Contributor

What:

This pull request resolves issue #4247 by fixing @starting-style at-rule nesting.

Why:

Users of Less.js may wish to use newer features of CSS supported by newer versions of most browsers. Estimated support for @starting-style is 84.76%+ (https://caniuse.com/mdn-css_at-rules_starting-style).

Checklist:

  • Documentation
  • Added/updated unit tests
  • Code complete

Bundle size:

Less.js 4.2.1 minified is 151,936 bytes.
With PR merged Less.js bundle minified becomes 155,088 bytes.
Delta: 3,152 bytes

Lines of code delta: 275 added (including tests)

The following Less:

[popover]:popover-open {
    opacity: 1;
    transform: scaleX(1);

    @starting-style {
        opacity: 0;
        transform: scaleX(0);
    }
}

becomes:

[popover]:popover-open {
  opacity: 1;
  transform: scaleX(1);
  @starting-style {
    opacity: 0;
    transform: scaleX(0);
  }
}

* Add support for ```@starting-style``` at-rule now that browser support
  is broader.
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 25, 2024
@puckowski
Copy link
Contributor Author

I submitted a few PRs. I expect rebase(s) will be needed in order to merge all of them, so let me know when a rebase is needed.

@puckowski
Copy link
Contributor Author

PR #4302 should resolve a semi-related issue with nesting of at-rules such as @starting-style.

@matthew-dean
Copy link
Member

@puckowski

See the comments here.

The TL;DR is that at-rules should, in general, not be distinct nodes. There may be some sub-types of at-rules that have "combination" behavior, but there's nothing special about @starting-style that warrants its own copy/paste file. At-rules are just at-rules. The only exception might be @import. Everything else can and probably should be an AtRule node.

@puckowski
Copy link
Contributor Author

I worked on a new implementation to add support for @starting-style where starting-style is just an AtRule.

Passes all tests, though I have to do some cleanup and further code review before I send along a new PR.

@puckowski
Copy link
Contributor Author

Going to close this in favor of #4333 per above comments.

@puckowski puckowski closed this Mar 29, 2025
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.

2 participants