Skip to content

Support mixin name like a hex color or number - #228

Merged
fisker merged 5 commits into
nextfrom
copilot/move-mixin-parse
Nov 25, 2026
Merged

fisker merged 5 commits into
nextfrom
copilot/move-mixin-parse

Conversation

@fisker

@fisker fisker commented Nov 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Classify mixin candidates in the Less tokenizer and dispatch them in the parser.
  • Remove the standalone mixin helper module.

Testing

  • Full test suite: 383 passed, 2 skipped.
  • ESLint and Prettier checks passed.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/postcss-less@228

commit: ac72cac

Comment thread lib/less-tokenize.js Outdated
Comment on lines +42 to +43
!HASH_COLOR_PATTERN.test(symbol) &&
!UNPADDED_FRACTIONAL_NUMBERS_PATTERN.test(symbol)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot If I remove these two lines, the tests will still pass, are we missing tests or these two line just useless?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They preserve the previous classification: without them, #abc; and .5; become mixin calls instead of raising Unknown word. They don't affect ordinary declaration values. Added tokenizer and parser regression tests in 1eada3f.

@fisker

fisker commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

@copilot solve conflicts.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
# Conflicts:
#	lib/less-parser.js

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

@copilot solve conflicts.

Merged next and resolved the conflict in 46e0829. The full test suite and lint checks pass.

@fisker fisker changed the title Move mixin token detection into tokenizer Support mixin name like a hex color or number Nov 25, 2026
@fisker
fisker merged commit e66c914 into next Nov 25, 2026
8 checks passed
@fisker
fisker deleted the copilot/move-mixin-parse branch November 25, 2026 15:08
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

Successfully merging this pull request may close these issues.

2 participants