Provide a lib like @ant-design/static-style-extract to support generate static css for SSR usage to generate raw css file for caching.
Install
npm install @ant-design/static-style-extract
Usage
import extractStyle from `@ant-design/static-style-extract`;
const cssText = extractStyle();
use with custom theme
import extractStyle from `@ant-design/static-style-extract`;
const cssText = extractStyle();
const cssText = extractStyle((node) => (
<ConfigProvider theme={theme}>
{node}
</ConfigProvider>
));
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
License
static-style-extract is released under the MIT license.