Skip to content

Commit f43d4b1

Browse files
committed
1 parent 6b7c4f2 commit f43d4b1

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

internal/css_parser/css_parser.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,9 @@ 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+
// @property
1113+
// Reference: https://drafts.css-houdini.org/css-properties-values-api/#at-property-rule
1114+
"property": atRuleDeclarations,
11121115
}
11131116

11141117
var atKnownRuleCanBeRemovedIfEmpty = map[string]bool{

internal/css_parser/css_parser_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,19 @@ func TestAtRule(t *testing.T) {
15471547
}
15481548
}`, "@starting-style{h1{background-color:transparent}}", "")
15491549

1550+
// Test @property
1551+
expectPrintedMinify(t, `@property --property-name {
1552+
syntax: "<color>+";
1553+
inherits: false;
1554+
initial-value: #ff0000;
1555+
}`, "@property --property-name{syntax:\"<color>+\";inherits:false;initial-value:#ff0000}", "")
1556+
1557+
expectPrintedMinify(t, `@property --❤️ {
1558+
syntax: "<length> | <percentage>";
1559+
inherits: true;
1560+
initial-value: 90.6%;
1561+
}`, "@property --❤️{syntax:\"<length> | <percentage>\";inherits:true;initial-value:90.6%}", "")
1562+
15501563
// https://drafts.csswg.org/css-counter-styles/#the-counter-style-rule
15511564
expectPrinted(t, `
15521565
@counter-style box-corner {

0 commit comments

Comments
 (0)