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

Fix nested css prop #245

Merged
merged 5 commits into from
Dec 21, 2024
Merged

Fix nested css prop #245

merged 5 commits into from
Dec 21, 2024

Conversation

Mad-Kat
Copy link
Collaborator

@Mad-Kat Mad-Kat commented Dec 20, 2024

This issue was raised here: #240 (comment)

This PR fixes the assigned class names for css props in nested JSX structures.

<div
  css={css`
    color: red;
  `}
>
  <p
    css={css`
      color: blue;
    `}
  >
    <span
      css={css`
        color: green;
      }`}
    >
      hello
    </span>
    world
  </p>
</div>

produced this:

<div {.../*YAK Extracted CSS:
.yak {
  color: red;
}
*/ /*#__PURE__*/ css(__styleYak.yak)({})}>
  <p {.../*YAK Extracted CSS:
.yak-01 {
  color: blue;
}
-*/ /*#__PURE__*/ css(__styleYak.yak)({})}>
+*/ /*#__PURE__*/ css(__styleYak["yak-01"])({})}>
    <span {.../*YAK Extracted CSS:
.yak-02 {
  color: green;
}
-*/ /*#__PURE__*/ css(__styleYak.yak)({})}>
+*/ /*#__PURE__*/ css(__styleYak["yak-02"])({})}>
      hello
    </span>
    world
  </p>
</div>;

Copy link

changeset-bot bot commented Dec 20, 2024

🦋 Changeset detected

Latest commit: 594d55e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
next-yak Patch
yak-swc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codspeed-hq bot commented Dec 20, 2024

CodSpeed Performance Report

Merging #245 will not alter performance

Comparing fix-nested-css-prop (594d55e) with main (11261b7)

Summary

✅ 2 untouched benchmarks

@Mad-Kat Mad-Kat marked this pull request as ready for review December 20, 2024 19:38
@Mad-Kat Mad-Kat requested a review from jantimon December 20, 2024 19:38
@Mad-Kat Mad-Kat merged commit 154da2f into main Dec 21, 2024
8 checks passed
@Mad-Kat Mad-Kat deleted the fix-nested-css-prop branch December 21, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants