feat(parser/tailwind): support arbitrary candidates#7086
Conversation
|
1f74626 to
ad490d4
Compare
We could jump into their Discord server and ask them if they could provide more, or if they have a repository with them |
CodSpeed Performance ReportMerging #7086 will not alter performanceComparing Summary
Footnotes |
|
It appears they keep their discord private |
|
Damn. Maybe we could open a discussion and hope for the best. Or ask a Code Agent to generate some tests. Or leave it like this, and maybe the community will help once we release new rules |
|
I've learned that this is basically a way to set any css property to any value. I'll add more tests. |
ad490d4 to
60efe97
Compare
WalkthroughThis update introduces support for parsing "arbitrary candidate" syntax in the Tailwind parser. A new lexer method and a parsing function specifically handle arbitrary candidates, which are class patterns like ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (6)
crates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-property.txt (1)
1-1: Good negative case[:40px] ensures a diagnostic for missing property before the colon. Consider adding siblings:
- Missing value: [width:]
- Unbalanced bracket: [width:10px
- Stray colon: [width::10px]
crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-2.txt (1)
1-1: Nice combo coveragedark:[--pattern-fg:var(--color-white)]/10 hits variant + custom prop + var() + modifier. As a follow-up, consider:
- Quotes: [content:'hi']
- url(): [background-image:url('/a/b.png')]
- Escaped chars: [content:"hi"]
crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-1.txt (1)
1-1: Nice real-world sample (custom prop + var() + modifier).Consider adding a couple more happy-paths to harden coverage:
- With spaces around the colon:
[--pattern-fg : var(--color-gray-950)]/5- Without modifier:
[--pattern-fg:var(--color-gray-950)]I’m happy to draft them if useful.
crates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-value-in-arbitrary.txt (1)
1-1: Good negative case; please double-check the diagnostic.Ensure the error reads as “missing value” (or similar) rather than a generic “expected candidate”. Also worth adding:
- Missing property:
[:40px] w-5- Entirely empty brackets:
[] w-5I can add these if you want.
crates/biome_tailwind_parser/src/lexer/mod.rs (1)
166-184: Whitespace stops inside bracketed segments—confirm intended grammar.
consume_bracketed_thingstops on whitespace. That means[background:blue 10px]would split at the space. If Tailwind allows spaces in arbitrary candidate values (common for filter/shadow lists), this could be too strict.If spaces should be allowed, consider not breaking on
char.is_whitespace()forTW_VALUEinArbitraryCandidatecontext, or only allow spaces when parentheses/quotes are open. Happy to prototype a minimal balanced-delimiter scan if needed.crates/biome_tailwind_parser/src/syntax/mod.rs (1)
143-185: Solid first cut; a couple of tidy-ups and diagnostic tweaks.
- Minor nit: the double check on
/can be simplified.- Consider emitting more specific errors for missing property/value, not just generic candidate recovery.
Suggested simplification:
if !p.expect(T![']']) { m.abandon(p); p.rewind(checkpoint); return Absent; } - if !p.at(T![/]) { - return Present(m.complete(p, TW_ARBITRARY_CANDIDATE)); - } - - if p.at(T![/]) { - parse_modifier(p).or_add_diagnostic(p, expected_modifier); - } + if p.at(T![/]) { + parse_modifier(p).or_add_diagnostic(p, expected_modifier); + } return Present(m.complete(p, TW_ARBITRARY_CANDIDATE))For diagnostics, if feasible:
- Add
expected_propertyalongside existingexpected_value/expected_modifier, then replace the bareexpect_with_context(TW_PROPERTY, …)with a variant that records a property-specific message.I can draft the
parse_errorhelper and wire-up if you’d like.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (6)
crates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-property.txt.snapis excluded by!**/*.snapcrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-value-in-arbitrary.txt.snapis excluded by!**/*.snapcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-0.txt.snapis excluded by!**/*.snapcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-1.txt.snapis excluded by!**/*.snapcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-2.txt.snapis excluded by!**/*.snapcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-3.txt.snapis excluded by!**/*.snap
📒 Files selected for processing (9)
crates/biome_tailwind_parser/src/lexer/mod.rs(2 hunks)crates/biome_tailwind_parser/src/syntax/mod.rs(3 hunks)crates/biome_tailwind_parser/src/token_source.rs(1 hunks)crates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-property.txt(1 hunks)crates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-value-in-arbitrary.txt(1 hunks)crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-0.txt(1 hunks)crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-1.txt(1 hunks)crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-2.txt(1 hunks)crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-3.txt(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-3.txtcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-0.txtcrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-property.txtcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-2.txtcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-1.txtcrates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-value-in-arbitrary.txtcrates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just formatFormat Rust and TOML files using
just f(alias forjust format).
Files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
**/*.rs
📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
🧠 Learnings (23)
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/specs/html/**/*.html : Create your first `.html` test file inside `tests/specs/html`, preferably organizing tests into subfolders by kind.
Applied to files:
crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-3.txtcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-0.txtcrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-property.txtcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-1.txtcrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-value-in-arbitrary.txt
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : Update the `spec_tests.rs` file to generate a test function for each `.html` file found inside `tests/specs/html` using the `tests_macros::gen_tests!` macro.
Applied to files:
crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-3.txtcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-0.txtcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-2.txtcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-1.txt
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/tests/specs/*/*/*.jsonc : Files ending with `.jsonc` in snapshot tests should contain arrays of code snippets for script environments.
Applied to files:
crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-0.txtcrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-property.txtcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-1.txtcrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-value-in-arbitrary.txt
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/tests/specs/*/*/{invalid*,valid*}* : Snapshot tests for rules should be placed in `tests/specs/<group>/<rule_name>/` with files prefixed by `invalid` or `valid`.
Applied to files:
crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-0.txtcrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-property.txtcrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-value-in-arbitrary.txt
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/{spec_test.rs,spec_tests.rs,language.rs} : Inside the `biome_html_formatter` crate, create a `tests` folder containing a `specs` folder and the files `spec_test.rs`, `spec_tests.rs`, and `language.rs` for test infrastructure.
Applied to files:
crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-0.txt
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unknown*_*.rs : Rules that report unknown entities (e.g., CSS units) should use the `noUnknown<Concept>` naming convention (e.g., `noUnknownUnit`).
Applied to files:
crates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-property.txtcrates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-2.txtcrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-value-in-arbitrary.txt
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/token_source*.rs : Implement a token source as a thin layer wrapping the lexer, supporting lookahead, re-lexing, and checkpoint features.
Applied to files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new variant to `LanguageKind` in `language_kind.rs` for each new language, and implement all required methods for the new variant.
Applied to files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Bogus nodes must be part of a variant (e.g., included in a union node definition).
Applied to files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use the provided helper functions when formatting AST nodes.
Applied to files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, if a token is mandatory and the AST has that information, use the token from the AST node (e.g., `node.l_paren_token().format()`) instead of hardcoding the token (e.g., `token("(")`).
Applied to files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new prefix (e.g., `html_`) to `LANGUAGE_PREFIXES` in `language_kind.rs` for each new language.
Applied to files:
crates/biome_tailwind_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : Implement the `Lexer` trait from the `biome_parser` crate for your language-specific lexer struct.
Applied to files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Use conditional syntax handling to add diagnostics if a syntax is not supported in the current file or context, and wrap invalid syntax in a `BOGUS` node if necessary.
Applied to files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes for enclosing syntax errors must have the word `Bogus` in their name (e.g., `HtmlBogusAttribute`).
Applied to files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/tests/tailwind_specs/error/arbitrary-candidate/missing-value-in-arbitrary.txt
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Consult the grammar to identify the appropriate `BOGUS` node for error recovery in your parse rule.
Applied to files:
crates/biome_tailwind_parser/src/token_source.rscrates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions should take a `&mut` reference to the parser as their only parameter and return a `ParsedSyntax`.
Applied to files:
crates/biome_tailwind_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions must be prefixed with `parse_` and use the name defined in the grammar file (e.g., `parse_for_statement`).
Applied to files:
crates/biome_tailwind_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : When parsing lists, perform error recovery to avoid infinite loops, using the provided parser infrastructure.
Applied to files:
crates/biome_tailwind_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : Create a `lexer/mod.rs` file inside the parser crate for each language to implement the lexer.
Applied to files:
crates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/parser*.rs : Implement the `Parser` trait for your language-specific parser struct.
Applied to files:
crates/biome_tailwind_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions must return `Present` if they consume any token and can parse the node with at least some children, and return `Absent` otherwise without progressing the parser or adding errors.
Applied to files:
crates/biome_tailwind_parser/src/syntax/mod.rscrates/biome_tailwind_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code when formatting AST nodes. If a mandatory token or node is missing, return `None` instead.
Applied to files:
crates/biome_tailwind_parser/src/lexer/mod.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_package)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Test Node.js API
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: autofix
🔇 Additional comments (5)
crates/biome_tailwind_parser/src/token_source.rs (1)
29-30: New lexing context LGTMArbitraryCandidate fits neatly alongside Arbitrary and ArbitraryVariant. No API churn and derives remain sane.
crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-3.txt (1)
1-1: Solid happy-path[background:blue] is a clear, minimal success case. Nice.
crates/biome_tailwind_parser/tests/tailwind_specs/ok/candidates/arbitrary-candidate-0.txt (1)
1-1: Covers modifier after candidate[color:red]/50 exercises the post-bracket modifier path. Good addition.
crates/biome_tailwind_parser/src/lexer/mod.rs (1)
247-249: Wiring toArbitraryCandidatecontext looks correct.The new context is properly dispatched here. No concerns.
crates/biome_tailwind_parser/src/syntax/mod.rs (1)
71-77: Good parse ordering: arbitrary candidate first, then fallback.This avoids misclassifying
[prop:value]as a variant or static. Nice.
Summary
This adds support for parsing "arbitrary candidates". They're like arbitrary variants, but they're the candidate part instead.
Test Plan
Added a test, which I got from the tailwind source.
I would like to add more, but I actually can't find any more examples of it in the tailwind source, or the docs. Maybe I'm just looking in the wrong places.
Docs