Provide a lib like @ant-design/static-style-extract to support generate static css for SSR usage to generate raw css file for caching.
npm install @ant-design/static-style-extract
``tsx | pure
import extractStyle from@ant-design/static-style-extract`;
const cssText = extractStyle(); // :where(.css-bAMboOo).ant-btn ...
use with custom theme
```tsx | pure
import extractStyle from `@ant-design/static-style-extract`;
const cssText = extractStyle(); // :where(.css-bAMboOo).ant-btn ...
const cssText = extractStyle((node) => (
<ConfigProvider theme={theme}>
{node}
</ConfigProvider>
));
use with blacklist or whitelist
``tsx | pure
import extractStyle from@ant-design/static-style-extract`;
const cssText = extractStyle({ includes: ['Button'] // Only Button style will be extracted });
## Example
http://localhost:8000
online example: http://react-component.github.io/static-style-extract/
## Development
npm install npm start
## Test Case
npm test
## Coverage
npm run coverage ```
open coverage/ dir
@ant-design/static-style-extract is released under the MIT license.
$ claude mcp add static-style-extract \
-- python -m otcore.mcp_server <graph>