jantimon / next-yak

a streamlined CSS-in-JS solution tailor-made for Next.js, seamlessly combining the expressive power of styled-components syntax with efficient build-time extraction and minimal runtime footprint, ensuring optimal performance and easy integration with existing atomic CSS frameworks like Tailwind CSS
https://yak.js.org
118 stars 4 forks source link

Semicolons after template literal expressions should show error (or correct it) #74

Closed Mad-Kat closed 4 months ago

Mad-Kat commented 8 months ago

When you have a semicolon after a template literal expression

export const Input = styled.input<{$primary: boolean}>`
  ${({$primary}) => $primary && css`
    color: red;
  `};
  color: blue;
`;

next-yak should show you an error because it generates non valid CSS that ignores other styles.

.Input {
  &:where(.primary_0) {
    color: red;
  }
;
  color: blue;
}
jantimon commented 5 months ago

@Mad-Kat it looks like we are now correctly removing the ; - can we close this issue? shot-sPFraDN8@2x