Nothing Special   »   [go: up one dir, main page]

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

Add cx function for merging multiple class names #417

Merged
merged 9 commits into from
Jul 15, 2024

Conversation

thomaslindstrom
Copy link
Contributor

https://emotion.sh/docs/@emotion/css#cx

Emotion has a cx utility function that merges multiple class names. Now, while this function doesn’t do nearly as much (their cx function also ensures styles are applied and take priority from left-to-right), having an out-of-the-box (albeit dumb) cx function to apply multiple class names would be great.

<div
  className={cx(
    css`
      font-size: 18px;
      color: blue;
    `,
    isLoggedIn &&
      css`
        color: red;
      `
  )}
/>

Copy link
changeset-bot bot commented Jul 15, 2024

🦋 Changeset detected

Latest commit: 77f6a8c

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

This PR includes changesets to release 11 packages
Name Type
@kuma-ui/core Patch
@kuma-ui/babel-plugin Patch
@kuma-ui/compiler Patch
@kuma-ui/next-plugin Patch
next-app-router Patch
next Patch
react-vite-example Patch
webpack Patch
website Patch
@kuma-ui/vite Patch
@kuma-ui/webpack-plugin 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
vercel bot commented Jul 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kuma-ui-website ❌ Failed (Inspect) Jul 15, 2024 1:53pm

Copy link
Member
@poteboy poteboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@poteboy
Copy link
Member
poteboy commented Jul 15, 2024

@thomaslindstrom
Can you add documentation to https://github.com/kuma-ui/kuma-ui/blob/main/website/src/pages/docs/API/css.mdx based on your changes?

@thomaslindstrom
Copy link
Contributor Author

@thomaslindstrom Can you add documentation to https://github.com/kuma-ui/kuma-ui/blob/main/website/src/pages/docs/API/css.mdx based on your changes?

Will do. Give me a few minutes.

@poteboy poteboy merged commit 6055686 into kuma-ui:main Jul 15, 2024
6 of 7 checks passed
@github-actions github-actions bot mentioned this pull request Jul 15, 2024
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