Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9c3c0c7
draft: support Tailwind syntax in the CSS parser
dyc3 Aug 5, 2025
02238ea
fix incorrect string parsing
dyc3 Aug 5, 2025
54cc689
feat: add --value function to css grammar
dyc3 Aug 7, 2025
1494e8e
feat: add --value function and support * in css identifiers
dyc3 Aug 7, 2025
08063de
fix: make @variant work as intended
dyc3 Aug 7, 2025
5b7d31d
feat: parse tailwind --value expressions better
dyc3 Aug 9, 2025
62d8bff
fix: parse functional utility names better
dyc3 Aug 9, 2025
b705b9d
chore: clean up dead code
dyc3 Aug 9, 2025
6242c80
test: add error tests for tailwind syntax
dyc3 Aug 9, 2025
5c4a6d5
refactor: use ParseNodeList for @apply
dyc3 Aug 9, 2025
0a15895
chore: tweak codegen to avoid warnings
dyc3 Aug 9, 2025
57e33e4
fix: error cases for --alpha and --spacing
dyc3 Aug 9, 2025
df2049a
fix: cases for --alpha() were completely halucinated
dyc3 Aug 9, 2025
0dd8f7a
fix: accept theme reset syntax, eg `--color-*: initial`
dyc3 Aug 9, 2025
d028b8e
chore: accept new snapshots. could be a regression? can't tell
dyc3 Aug 10, 2025
ab01c22
fix: theme at rules can have a name
dyc3 Aug 10, 2025
7c40e35
refactor: move theme tests to folder
dyc3 Aug 10, 2025
782cf36
fix: theme blocks can contain at rules
dyc3 Aug 10, 2025
bd22f32
fix: loosely lex and parse tailwind classes in `@apply`
dyc3 Aug 10, 2025
9ed40d3
feat: correctly parse `@custom-variant` things, except for `@slot`
dyc3 Aug 10, 2025
dbfec6b
test: add shadcn default tailwind config as test case
dyc3 Aug 10, 2025
8ff9272
refactor: rename tailwind specific nodes
dyc3 Aug 10, 2025
8639a31
feat: parse `--modifier` functions
dyc3 Aug 10, 2025
6c08caf
fix: accept `[*]` syntax in `--value` and `--modifier`
dyc3 Aug 10, 2025
2c33458
chore: fix lints
dyc3 Aug 10, 2025
c4d25fa
refactor: reduce syntax kinds usage
dyc3 Aug 11, 2025
66d8771
chore: regenerate formatters
dyc3 Aug 11, 2025
49073f1
fix: correct error message
dyc3 Aug 16, 2025
1c8d19d
refactor: implement CssSyntaxFeatures
dyc3 Aug 19, 2025
a25091b
fix: lints and tests
dyc3 Aug 20, 2025
8e0c7fd
chore: add changeset
dyc3 Aug 20, 2025
41e23d6
fix: suggestions from code review
dyc3 Aug 20, 2025
622f9a5
Update crates/biome_css_parser/src/syntax/at_rule/tailwind.rs
dyc3 Aug 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/tasty-hairs-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@biomejs/biome": minor
---

Added a new CSS parser option `tailwindDirectives`. Enabling this option will allow all of Tailwind v4's syntax additions to be parsed by Biome.

You can enable this by setting `css.parser.tailwindDirectives` to `true` in your Biome configuration.

```json
{
"css": {
"parser": {
"tailwindDirectives": true
}
}
}
```
5 changes: 5 additions & 0 deletions crates/biome_configuration/src/css.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub struct CssConfiguration {

pub type CssAllowWrongLineCommentsEnabled = Bool<false>;
pub type CssModulesEnabled = Bool<false>;
pub type CssTailwindDirectivesEnabled = Bool<false>;

/// Options that changes how the CSS parser behaves
#[derive(
Expand All @@ -50,6 +51,10 @@ pub struct CssParserConfiguration {
/// Enables parsing of CSS Modules specific features.
#[bpaf(hide)]
pub css_modules: Option<CssModulesEnabled>,

/// Enables parsing of Tailwind CSS 4.0 directives and functions.
#[bpaf(hide)]
pub tailwind_directives: Option<CssTailwindDirectivesEnabled>,
}

pub type CssFormatterEnabled = Bool<true>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ impl RecessOrderMember {
NodeKindOrder::CustomProperty
}
AnyCssDeclarationName::CssIdentifier(_) => NodeKindOrder::Declaration,
AnyCssDeclarationName::TwValueThemeReference(_) => {
NodeKindOrder::Declaration
}
}
}
}
Expand Down
200 changes: 200 additions & 0 deletions crates/biome_css_factory/src/generated/node_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading