+
默认情况下不会自动删除添加的样式
+
+
+
+ {show && (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+
+ );
+}
diff --git a/docs/examples/ssr-hydrate-file.tsx b/docs/examples/ssr-hydrate-file.tsx
index dbd60e53..4ba2fc07 100644
--- a/docs/examples/ssr-hydrate-file.tsx
+++ b/docs/examples/ssr-hydrate-file.tsx
@@ -2,7 +2,7 @@ import { createCache, StyleProvider } from '@ant-design/cssinjs';
import React from 'react';
import { hydrateRoot } from 'react-dom/client';
import { Demo } from './ssr-advanced';
-import './ssr-hydrate-file.css';
+// import './ssr-hydrate-file.css';
// Copy from `ssr-advanced-hydrate.tsx`
const HTML = `
diff --git a/package.json b/package.json
index e8a40e9b..977ad578 100644
--- a/package.json
+++ b/package.json
@@ -25,6 +25,7 @@
"license": "MIT",
"scripts": {
"start": "dumi dev",
+ "dev": "father dev",
"docs:build": "dumi build",
"docs:deploy": "gh-pages -d .doc",
"compile": "father build",
diff --git a/src/hooks/useCSSVarRegister.ts b/src/hooks/useCSSVarRegister.ts
new file mode 100644
index 00000000..bc58448a
--- /dev/null
+++ b/src/hooks/useCSSVarRegister.ts
@@ -0,0 +1,70 @@
+import hash from '@emotion/hash';
+import { removeCSS, updateCSS } from 'rc-util/lib/Dom/dynamicCSS';
+import { useContext } from 'react';
+import StyleContext, {
+ ATTR_MARK,
+ ATTR_TOKEN,
+ CSS_IN_JS_INSTANCE,
+} from '../StyleContext';
+import { isClientSide } from '../util';
+import type { TokenWithCSSVar } from '../util/css-variables';
+import { transformToken } from '../util/css-variables';
+import useGlobalCache from './useGlobalCache';
+
+const useCSSVarRegister =