ProjectEvergreen / greenwood

Greenwood is your full-stack workbench for the web, focused on supporting modern web standards and development to help you create your next project.
https://www.greenwoodjs.io
MIT License
94 stars 9 forks source link

functions in CSS declarations (like CSS `var`) are being incorrectly optimized #1242

Closed thescientist13 closed 2 weeks ago

thescientist13 commented 1 month ago

Summary

When writing a CSS selector that has a CSS Variable (Function) that comes after something like an Identifier, the resulting CSS is incorrectly optimized with a space missing between the Declaration values

Input

.snippet {
  padding: 0 var(--size-4);
}

Output

# actual
.snippet{padding:0var(--size-4);}

# expected
.snippet{padding:0 var(--size-4);}

and thus "breaks" in browsers Screenshot 2024-06-07 at 11 38 29 AM

Details

Interestingly enough, the other way around works just fine

Input

.snippet {
  margin: var(--size-4) 0;
}

Output

.snippet{margin:var(--size-4) 0;}

Screenshot 2024-06-07 at 11 38 29 AM