@xiangfa/mindmap 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -140,6 +140,38 @@ In readonly mode, users can still pan, zoom, and select nodes, but cannot create
140
140
  <MindMap data={data} theme="light" /> {/* always light */}
141
141
  ```
142
142
 
143
+ ### Custom Styling
144
+
145
+ Override CSS custom properties on the container to customize colors, fonts, and more:
146
+
147
+ ```css
148
+ /* Override theme variables */
149
+ .mindmap-container {
150
+ --mindmap-root-bg: #1a73e8;
151
+ --mindmap-canvas-bg: #f0f4f8;
152
+ --mindmap-node-text: #1a1a2e;
153
+ }
154
+ ```
155
+
156
+ Target specific elements with semantic CSS classes:
157
+
158
+ ```css
159
+ /* Style all edges */
160
+ .mindmap-edge { stroke-width: 3; }
161
+
162
+ /* Style root node background */
163
+ .mindmap-node-root .mindmap-node-bg { fill: #6c5ce7; }
164
+ ```
165
+
166
+ Customize individual branch colors via `data-branch-index`:
167
+
168
+ ```css
169
+ .mindmap-edge[data-branch-index="0"] { stroke: #e74c3c; }
170
+ .mindmap-edge[data-branch-index="1"] { stroke: #2ecc71; }
171
+ ```
172
+
173
+ > See [Custom Styling Guide](docs/Custom%20Styling.md) for the full list of 30+ CSS variables, class selectors, and examples.
174
+
143
175
  ### Layout Direction
144
176
 
145
177
  ```tsx
package/README.zh-CN.md CHANGED
@@ -140,6 +140,38 @@ const markdown = `
140
140
  <MindMap data={data} theme="light" /> {/* 始终亮色 */}
141
141
  ```
142
142
 
143
+ ### 自定义样式
144
+
145
+ 通过覆盖容器上的 CSS 自定义属性来定制颜色、字体等:
146
+
147
+ ```css
148
+ /* 覆盖主题变量 */
149
+ .mindmap-container {
150
+ --mindmap-root-bg: #1a73e8;
151
+ --mindmap-canvas-bg: #f0f4f8;
152
+ --mindmap-node-text: #1a1a2e;
153
+ }
154
+ ```
155
+
156
+ 通过语义化 CSS 类选择器定制特定元素:
157
+
158
+ ```css
159
+ /* 定制所有连线 */
160
+ .mindmap-edge { stroke-width: 3; }
161
+
162
+ /* 定制根节点背景 */
163
+ .mindmap-node-root .mindmap-node-bg { fill: #6c5ce7; }
164
+ ```
165
+
166
+ 通过 `data-branch-index` 定制各分支颜色:
167
+
168
+ ```css
169
+ .mindmap-edge[data-branch-index="0"] { stroke: #e74c3c; }
170
+ .mindmap-edge[data-branch-index="1"] { stroke: #2ecc71; }
171
+ ```
172
+
173
+ > 完整的 30+ CSS 变量、class 选择器和示例请参阅 [自定义样式指南](docs/Custom%20Styling.md)。
174
+
143
175
  ### 布局方向
144
176
 
145
177
  ```tsx
@@ -17,4 +17,4 @@ export interface MindMapContextMenuProps {
17
17
  onDirectionChange: (dir: LayoutDirection) => void;
18
18
  onClose: () => void;
19
19
  }
20
- export declare function MindMapContextMenu({ position, theme, messages, readonly: readonlyProp, onNewRootNode, onExportSVG, onExportPNG, onExportMarkdown, onDirectionChange, onClose, }: MindMapContextMenuProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function MindMapContextMenu({ position, messages, readonly: readonlyProp, onNewRootNode, onExportSVG, onExportPNG, onExportMarkdown, onDirectionChange, onClose, }: MindMapContextMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -13,4 +13,4 @@ export interface MindMapControlsProps {
13
13
  onModeToggle: () => void;
14
14
  onFullscreenToggle: () => void;
15
15
  }
16
- export declare function MindMapControls({ zoom, theme, messages, showZoom, mode, isFullscreen, onZoomIn, onZoomOut, onAutoFit, onModeToggle, onFullscreenToggle, }: MindMapControlsProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function MindMapControls({ zoom, messages, showZoom, mode, isFullscreen, onZoomIn, onZoomOut, onAutoFit, onModeToggle, onFullscreenToggle, }: MindMapControlsProps): import("react/jsx-runtime").JSX.Element;