Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS prop doesn't work when component that uses it is exported #252

Closed
Mad-Kat opened this issue Dec 30, 2024 · 0 comments · Fixed by #253
Closed

CSS prop doesn't work when component that uses it is exported #252

Mad-Kat opened this issue Dec 30, 2024 · 0 comments · Fixed by #253
Labels
bug Something isn't working

Comments

@Mad-Kat
Copy link
Collaborator

Mad-Kat commented Dec 30, 2024

When we have a CSS prop in a component that itself is exported e.g.

import { css } from "next-yak";

export const Yak = () => (
  <div
    css={css`
      display: flex;
      gap: 6px;
    `}
  >
    Yak
  </div>
);

the compilation doesn't add the class name to it:

import { css, __yak_mergeCssProp } from "next-yak/internal";
import __styleYak from "./input.yak.module.css!=!./input?./input.yak.module.css";
export const YakLogo = ()=><div {.../*YAK EXPORTED MIXIN:YakLogo
.YakLogo {
  display: flex;
  gap: 6px;
}
*/ /*#__PURE__*/ css()({})}>
    Yak
  </div>;

and this means that the styling isn't applied.

@Mad-Kat Mad-Kat added the bug Something isn't working label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

1 participant