Skip to content

formatter: PostCSS Extend Rule support #24116

Description

@EskiMojo14

Input

%thick-border {
  border: thick dotted red;
}

.modal {
  @extend %thick-border;

  color: red;
}

Config

{
  "experimentalSortImports": {},
}

Oxfmt output

Oxfmt version: 0.57.0

  × Syntax error: CSS rule is expected
    ╭─[website/src/shared/styles/example.css:11:1]
 10 │
 11 │ %thick-border {
    · ─
 12 │   border: thick dotted red;
    ╰────

Oxfmt playground link

No response

Prettier output

Prettier version: 3.9.4

%thick-border {
  border: thick dotted red;
}

.modal {
  @extend %thick-border;

  color: red;
}

Prettier playground link

https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBSGALAlmA1gWgCMIAnAEzhIAJgAdKKq48ypKzHXKsiGeMqiThkA3PQC+9egDoAthDIBDADY16jAAJwAHvCgD02PEVIUSYqOqqRlpNkNESQAGhAQADjCzQAzslCKJCQQAO4ACoEIfigqIYoAnn6uhCSKeHAwAMqKsnAAMlhQcMgAZio+cK4QhABWcGAwAOqp7sgg7kIVJABuxcmp6VnuaYUA5sgwJACulSAVslgT07M67pRYubAqAPJrqTCkYRA+WF7QbQhkLiCr65swKgAqlFCBWHDRZcoVridQo8o4ABFKa8YpIL4-EA1HzaTJjQEgsGlcqzACOoPgYWC7miIEUPnwRWEwmuk0UWGUYwAwhBZLJFG0VMprn8AXAAIJ8EhYQhTLGUApFFHfWYYGCyZSNbDwHzDMBwTJRU5YbqneJtMA+JIgbozACS+gQWTAPM8HP0mRg8UBIqhHWOcGailaKA6H0ovWul22JSF4JAyhK10KXRg2MUowZdtmwxIXU12uuHUKTSwZEwyAAHAAGVxCDFYIQRqOMiGo1wPQiNdOZpAAJlcUwqj0UhE+FZuskIwgoZDyin+U0jcAAYqQGXwxkz+RAQOJxEA

Additional notes

I believe this is an intentional breakage due to the switch of CSS parser, but it would be nice to have support back :)

Metadata

Metadata

Assignees

Labels

A-formatter-prettier-diffArea - Formatter difference with PrettierF-lang-cssFormatter - oxc_formatter_css related

Type

Fields

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions