Preserve spacing for container feature functions#4441
Conversation
Signed-off-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com>
📝 WalkthroughWalkthroughParser media feature logic is updated to correctly detect and propagate whitespace behavior for parentheses-wrapped query and declaration nodes. The spacing detection regex is broadened, ChangesContainer Style Query Spacing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/test-data/tests-unit/container/container.less (1)
180-202: ⚡ Quick winAdd one explicit non-ASCII container-name fixture case.
The new fixtures cover many identifier forms, but they still miss a direct non-ASCII container name case called out in the objective. Add one example here and mirror it in
packages/test-data/tests-unit/container/container.css.Suggested fixture addition
+@container café (min-width: 1300px) { + .unicode-container { + width: 25%; + } +}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/test-data/tests-unit/container/container.less` around lines 180 - 202, Add one explicit non-ASCII container-name fixture by inserting an `@container` rule with a non-ASCII identifier (for example `@container` контейнер (min-width: 1300px) { .nonascii-container { width: 25%; } }) into packages/test-data/tests-unit/container/container.less alongside the existing `@container` rules (contactBody, _body, --body, contact\.body), and mirror that exact rule (same container name and selector .nonascii-container) in packages/test-data/tests-unit/container/container.css so the test fixture covers a direct non-ASCII container-name case.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/test-data/tests-unit/container/container.less`:
- Around line 180-202: Add one explicit non-ASCII container-name fixture by
inserting an `@container` rule with a non-ASCII identifier (for example `@container`
контейнер (min-width: 1300px) { .nonascii-container { width: 25%; } }) into
packages/test-data/tests-unit/container/container.less alongside the existing
`@container` rules (contactBody, _body, --body, contact\.body), and mirror that
exact rule (same container name and selector .nonascii-container) in
packages/test-data/tests-unit/container/container.css so the test fixture covers
a direct non-ASCII container-name case.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8a2ce99b-6e52-4375-b229-a9c90a0299c8
📒 Files selected for processing (3)
packages/less/lib/less/parser/parser.jspackages/test-data/tests-unit/container/container.csspackages/test-data/tests-unit/container/container.less
Fixes #4235
Summary
Testing
COREPACK_HOME=$PWD/.corepack PNPM_HOME=$PWD/.pnpm-home pnpm install --frozen-lockfile --store-dir $PWD/.pnpm-storeCOREPACK_HOME=$PWD/.corepack PNPM_HOME=$PWD/.pnpm-home pnpm --dir packages/less exec node test/index.js containerCOREPACK_HOME=$PWD/.corepack PNPM_HOME=$PWD/.pnpm-home pnpm --dir packages/less exec eslint --no-ignore lib/less/parser/parser.jsCOREPACK_HOME=$PWD/.corepack PNPM_HOME=$PWD/.pnpm-home pnpm --dir packages/less run typecheckCOREPACK_HOME=$PWD/.corepack PNPM_HOME=$PWD/.pnpm-home pnpm --dir packages/less run test:nodegit diff --checkNote: the commit hook also ran the repo
npm testpath. Node/build portions passed; the browser runner reported missing local Playwright browser binaries and therefore did not execute those browser pages in this environment.Summary by CodeRabbit
Bug Fixes
Tests