Line comments are not supported in multiline style declarations
Author: ZelenetskaCreated Oct 21, 2025Updated Jul 23, 2026
There seems to be an issue with parsing line comments within multiline style declarations. For example, when a line comment is added at the end of a multiline calc() function, it results in a parsing error. This is similar to a previously reported issue in stylelint-processor-styled-components (issue #156).
Similarly to (issue #156) converting to a typical CSS comment /* */ avoids the error.
Example The following code snippet fails to parse correctly:
const MyStyledComponent = styled.div`
max-height: calc(
${someVariable1} + ${someVariable2} + ${someVariable3}
); // This comment causes a parsing error
`;Source: styled-components/styled-components