Skip to content

bug: CSS renders with break lines and breaks CSS #6516

@adoumas

Description

@adoumas

Prerequisites

Stencil Version

4.40.1

Current Behavior

When you use prettier for css and you have a long property that breaks in lines the output renders the new lines and breaks the css.
input
`
.my-component {
--theme-primary-color: #2c3e50;
--theme-primary-opacity: 10%;
--theme-secondary-color: #0a0a0a;
--theme-secondary-opacity: 20%;

display: block;
color: color-mix(
in srgb,
var(--theme-primary-color) var(--theme-primary-opacity),
var(--theme-secondary-color) var(--theme-secondary-opacity)
);
}
`

output
.my-component { --theme-primary-color: #2c3e50; --theme-primary-opacity: 10%; --theme-secondary-color: #0a0a0a; --theme-secondary-opacity: 20%; display: block; color: color-mix(\n in srgb, \n var(--theme-primary-color) var(--theme-primary-opacity), \n var(--theme-secondary-color) var(--theme-secondary-opacity) \n); }

Expected Behavior

css property should render in single line

`
.my-component {
--theme-primary-color: #2c3e50;
--theme-primary-opacity: 10%;
--theme-secondary-color: #0a0a0a;
--theme-secondary-opacity: 20%;

display: block;
color: color-mix(in srgb, var(--theme-primary-color) var(--theme-primary-opacity), var(--theme-secondary-color) var(--theme-secondary-opacity));
}
`

System Info

Steps to Reproduce

inspect rendered css on den tools

Code Reproduction URL

https://github.com/adoumas/stencil-css-bug

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within StencilHelp Wanted

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions