You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docstrings generation was requested by @black7375.
* #219 (comment)
The following files were modified:
* `packages/babel/src/styled.ts`
* `packages/css/src/css/index.ts`
* `packages/css/src/rules/index.ts`
Copy file name to clipboardExpand all lines: packages/babel/src/styled.ts
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,11 @@ import type { PluginState, ProgramScope } from "@/types.js";
3
3
import{registerImportMethod}from"@/utils.js";
4
4
5
5
/**
6
-
* The plugin for transforming styled components
6
+
* Babel plugin that transforms `styled` calls from "@mincho-js/react" into runtime calls with tree-shaking annotations.
7
7
*
8
-
* This plugin transforms calls to `styled` from "@mincho-js/react" into runtime
9
-
* calls with proper tree-shaking annotations.
8
+
* Replaces calls to `styled` with calls to runtime-imported `$$styled` and `rules`, preserving comments and source locations for accurate source maps. Ensures transformed calls are annotated for tree-shaking and updates scope references after transformation.
10
9
*
11
-
* @returnsThe plugin object
10
+
* @returnsA Babel plugin object for transforming styled component calls.
* Processes a prop definition object to generate CSS variables and assign them to specified CSS properties.
197
+
*
198
+
* For each prop, creates a CSS variable (optionally with a debug name), stores its key in `propVars`, and sets the variable as the value for each target CSS property in `propStyles`. If a base value is provided, uses it as a fallback.
199
+
*
200
+
* @param props - The prop definitions mapping prop names to their configuration
201
+
* @param propVars - Object to store generated CSS variable keys for each prop
202
+
* @param propStyles - CSS rule object to which the variables are assigned as property values
203
+
* @param debugId - Optional identifier used for debugging and variable naming
0 commit comments