Skip to content

Commit dc5e750

Browse files
authored
1 parent 6b7c4f2 commit dc5e750

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
* Add support for the new `@view-transition` CSS at rule ([#4313](https://github.com/evanw/esbuild/pull/4313))
4+
5+
```css
6+
/* Original code */
7+
@view-transition {
8+
navigation: auto;
9+
types: check;
10+
}
11+
/* Output */
12+
@view-transition{navigation:auto;types:check}
13+
```
14+
15+
This was contributed by [@yisibl](https://github.com/yisibl).
16+
317
## 0.25.11
418

519
* Add support for `with { type: 'bytes' }` imports ([#4292](https://github.com/evanw/esbuild/issues/4292))

internal/css_parser/css_parser.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,10 @@ var specialAtRules = map[string]atRuleKind{
11091109
// Anchor Positioning
11101110
// Reference: https://drafts.csswg.org/css-anchor-position-1/#at-ruledef-position-try
11111111
"position-try": atRuleDeclarations,
1112+
1113+
// @view-transition
1114+
// Reference: https://drafts.csswg.org/css-view-transitions-2/#view-transition-rule
1115+
"view-transition": atRuleDeclarations,
11121116
}
11131117

11141118
var atKnownRuleCanBeRemovedIfEmpty = map[string]bool{

internal/css_parser/css_parser_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,10 @@ func TestAtRule(t *testing.T) {
15161516
}
15171517
}
15181518
}`, "@supports (container-type: size){@container (width <= 150px){#inner{background-color:#87ceeb}}}", "")
1519+
expectPrintedMinify(t, `@view-transition {
1520+
navigation: auto;
1521+
types: check;
1522+
}`, "@view-transition{navigation:auto;types:check}", "")
15191523

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

0 commit comments

Comments
 (0)