Skip to content

Feat: CSS - css.multiple() API supports#222

Merged
github-actions[bot] merged 1 commit intomainfrom
css-multiple
Jul 19, 2025
Merged

Feat: CSS - css.multiple() API supports#222
github-actions[bot] merged 1 commit intomainfrom
css-multiple

Conversation

@black7375
Copy link
Contributor

@black7375 black7375 commented Jul 19, 2025

Description

cssVariant() to css.multiple().

Related Issue

Summary by CodeRabbit

  • New Features

    • Introduced a grouped API for CSS utilities, allowing access to multiple CSS variant functionality via css.multiple().
  • Refactor

    • Updated usage to reference css.multiple() instead of the previous cssVariants export.
    • Streamlined exports by removing the standalone cssVariants and grouping it under the main css API.

Additional context

Checklist

@changeset-bot
Copy link

changeset-bot bot commented Jul 19, 2025

🦋 Changeset detected

Latest commit: ee6e517

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

This PR includes changesets to release 7 packages
Name Type
@mincho-js/babel Minor
@mincho-js/css Minor
@mincho-js/integration Patch
@mincho-js/react Patch
@mincho-js/vite Patch
react-babel Patch
@mincho-js/esbuild 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

@github-actions
Copy link
Contributor

Triggered from #222 by @​black7375.

Checking if we can fast forward main (90cde80) to css-multiple (ee6e517).

Target branch (main):

commit 90cde801cc0133649869bfed9c2e053aa600f6db (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sat Jul 19 21:37:30 2025 +0900

    Chore: Seperate vanilla extract API to `./compat`

Pull request (css-multiple):

commit ee6e51736f26effa8bcb72d8d5cd907c2de629d8 (pull_request/css-multiple)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Mon Jun 9 00:00:00 2025 +0900

    Feat: CSS - css.multiple() API supports #221

It is possible to fast forward main (90cde80) to css-multiple (ee6e517). If you have write access to the target repository, you can add a comment with /fast-forward to fast forward main to css-multiple.

@coderabbitai
Copy link

coderabbitai bot commented Jul 19, 2025

Walkthrough

This update refactors the cssVariants function by namespacing it as css.multiple, updates all references accordingly, and removes its direct export. The extractionAPIs array is adjusted to reflect this change. A new changeset documents the minor version updates and API modification.

Changes

File(s) Change Summary
.changeset/sad-meals-rescue.md Added changeset documenting minor version updates and the introduction of the css.multiple() API.
packages/babel/src/utils.ts Removed "cssVariants" from the extractionAPIs array.
packages/css/src/css/index.ts Renamed css to cssImpl, introduced css.multiple for cssVariants, updated all references.
packages/css/src/index.ts Removed direct export of cssVariants, now only exports globalCss and css.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant css
  participant cssImpl
  participant cssVariants

  User->>css: call css(style, debugId?)
  css->>cssImpl: delegate call

  User->>css: call css.multiple(styles, debugId?)
  css->>cssVariants: delegate call
Loading

Possibly related issues

Possibly related PRs

Suggested labels

enhancement

Poem

A hop, a skip, a namespace leap,
cssVariants now runs deep—
Under css.multiple it hides,
Where modularity abides.
Rabbits cheer with every call,
For tidy code delights us all!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

yarn install v1.22.22
[1/4] Resolving packages...
(node:14442) [DEP0169] DeprecationWarning: url.parse() behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for url.parse() vulnerabilities.
(Use node --trace-deprecation ... to show where the warning was created)
error Couldn't find any versions for "eslint-config-custom" that matches "workspace:^"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90cde80 and ee6e517.

📒 Files selected for processing (4)
  • .changeset/sad-meals-rescue.md (1 hunks)
  • packages/babel/src/utils.ts (0 hunks)
  • packages/css/src/css/index.ts (4 hunks)
  • packages/css/src/index.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/babel/src/utils.ts
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
.changeset/sad-meals-rescue.md (1)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
packages/css/src/index.ts (2)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#134
File: packages/transform-to-vanilla/src/transform.ts:49-51
Timestamp: 2024-12-03T11:16:32.528Z
Learning: In projects that target both CommonJS and ES modules, adjusting the TypeScript `module` option may not be feasible. Therefore, using `@ts-ignore` comments to suppress TypeScript errors related to `import.meta` is acceptable.
packages/css/src/css/index.ts (3)
Learnt from: black7375
PR: mincho-js/mincho#113
File: packages/css/src/index.ts:33-33
Timestamp: 2024-10-09T13:00:38.449Z
Learning: `recipe` is properly exported from './rules' in `packages/css/src/rules/index.ts`.
Learnt from: black7375
PR: mincho-js/mincho#110
File: packages/css/src/rules/types.ts:25-29
Timestamp: 2024-09-29T14:13:13.977Z
Learning: For `ToggleVariantMap`, only the `true` state is needed for toggle variants.
Learnt from: black7375
PR: mincho-js/mincho#110
File: packages/css/src/rules/types.ts:25-29
Timestamp: 2024-10-09T13:00:38.449Z
Learning: For `ToggleVariantMap`, only the `true` state is needed for toggle variants.
🔇 Additional comments (4)
.changeset/sad-meals-rescue.md (1)

1-7: LGTM! Changeset properly documents the API change.

The changeset correctly uses minor version bumps for both affected packages and clearly describes the new css.multiple() API introduction.

packages/css/src/css/index.ts (3)

104-106: Good refactoring approach.

Renaming the original css function to cssImpl is a clean way to maintain the existing implementation while preparing for the new namespaced API structure.


108-110: Excellent API design using Object.assign.

The approach of using Object.assign to combine the original cssImpl function with a multiple property is elegant. This maintains the original css function behavior while adding the new namespaced multiple method.


215-271: Tests properly updated for the new API.

All test cases have been correctly updated to use css.multiple() instead of the standalone cssVariants function. The test logic remains the same, ensuring the refactoring doesn't introduce behavioral changes.

} from "@vanilla-extract/css";

export { globalCss, css, cssVariants } from "./css/index.js";
export { globalCss, css } from "./css/index.js";
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify that existing cssVariants usage has been updated.

The removal of cssVariants from the exports is correct for the new API design. However, ensure all existing usage of the standalone cssVariants import has been updated to use css.multiple instead.


🏁 Script executed:

#!/bin/bash
# Description: Check for any remaining direct imports or usage of cssVariants that might be broken
# Expected: No direct imports of cssVariants should remain

echo "Checking for direct cssVariants imports..."
rg "import.*cssVariants" --type ts --type tsx --type js --type jsx

echo "Checking for cssVariants usage (excluding the implementation file)..."
rg "cssVariants" --type ts --type tsx --type js --type jsx -A 2 | grep -v "packages/css/src/css/index.ts"

Length of output: 472


🏁 Script executed:

#!/bin/bash
# Re-run searches without relying on ripgrep’s file-type flags

echo "Checking for direct cssVariants imports across the repo..."
grep -R "import.*cssVariants" -n .

echo
echo "Checking for any cssVariants usage outside of the CSS package implementation..."
grep -R "cssVariants" -n . | grep -Ev 'packages/css/src/index.ts|packages/css/src/css/index.ts'

Length of output: 734


Update internal cssVariants references to use css.multiple

We’ve found remaining direct uses of the standalone cssVariants function inside the CSS package itself. To keep the API surface consistent, these should be updated to import only css and call css.multiple.

Locations to fix:

  • packages/css/src/rules/index.ts:11
    Change
    import { css, cssVariants } from "../css/index.js";
    to
    import { css } from "../css/index.js";
  • packages/css/src/rules/index.ts:113
    Replace
    cssVariants(...)
    with
    css.multiple(...)
  • packages/css/src/compat.ts:24
    Replace
    cssVariants as styleVariants
    with
    css.multiple as styleVariants

Once these are updated, the standalone cssVariants export removal from your main index.ts won’t break any internal or external code.

🤖 Prompt for AI Agents
In packages/css/src/index.ts at line 28, remove the standalone export of
cssVariants and only export css and globalCss. Then, in
packages/css/src/rules/index.ts at line 11, update the import to remove
cssVariants and import only css from "../css/index.js". At line 113 in the same
file, replace all calls to cssVariants(...) with css.multiple(...). Finally, in
packages/css/src/compat.ts at line 24, replace the export or usage of
cssVariants as styleVariants with css.multiple as styleVariants. This ensures
all internal references use css.multiple consistently.

@black7375
Copy link
Contributor Author

/fast-forward

@github-actions
Copy link
Contributor

Triggered from #222 (comment) by @​black7375.

Trying to fast forward main (90cde80) to css-multiple (ee6e517).

Target branch (main):

commit 90cde801cc0133649869bfed9c2e053aa600f6db (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Sat Jul 19 21:37:30 2025 +0900

    Chore: Seperate vanilla extract API to `./compat`

Pull request (css-multiple):

commit ee6e51736f26effa8bcb72d8d5cd907c2de629d8 (pull_request/css-multiple)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Mon Jun 9 00:00:00 2025 +0900

    Feat: CSS - css.multiple() API supports #221

Fast forwarding main (90cde80) to css-multiple (ee6e517).

$ git push origin ee6e51736f26effa8bcb72d8d5cd907c2de629d8:main
To https://github.com/mincho-js/mincho.git
   90cde80..ee6e517  ee6e51736f26effa8bcb72d8d5cd907c2de629d8 -> main

@github-actions github-actions bot merged commit ee6e517 into main Jul 19, 2025
12 checks passed
@github-actions github-actions bot deleted the css-multiple branch July 19, 2025 13:37
@github-actions github-actions bot mentioned this pull request Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant