Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

* Add support for the new `@view-transition` CSS at rule ([#4313](https://github.com/evanw/esbuild/pull/4313))

```css
/* Original code */
@view-transition {
navigation: auto;
types: check;
}
/* Output */
@view-transition{navigation:auto;types:check}
```

This was contributed by [@yisibl](https://github.com/yisibl).

## 0.25.11

* Add support for `with { type: 'bytes' }` imports ([#4292](https://github.com/evanw/esbuild/issues/4292))
Expand Down
4 changes: 4 additions & 0 deletions internal/css_parser/css_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,10 @@ var specialAtRules = map[string]atRuleKind{
// Anchor Positioning
// Reference: https://drafts.csswg.org/css-anchor-position-1/#at-ruledef-position-try
"position-try": atRuleDeclarations,

// @view-transition
// Reference: https://drafts.csswg.org/css-view-transitions-2/#view-transition-rule
"view-transition": atRuleDeclarations,
}

var atKnownRuleCanBeRemovedIfEmpty = map[string]bool{
Expand Down
4 changes: 4 additions & 0 deletions internal/css_parser/css_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,10 @@ func TestAtRule(t *testing.T) {
}
}
}`, "@supports (container-type: size){@container (width <= 150px){#inner{background-color:#87ceeb}}}", "")
expectPrintedMinify(t, `@view-transition {
navigation: auto;
types: check;
}`, "@view-transition{navigation:auto;types:check}", "")

// https://drafts.csswg.org/css-transitions-2/#defining-before-change-style-the-starting-style-rule
expectPrinted(t, `
Expand Down
Loading