test: add case to verify no CSS var media queries in extracted styles (#30)
Provide a lib like @ant-design/static-style-extract to support generate static css for SSR usage to generate raw css file for caching.
@ant-design/static-style-extract
npm install @ant-design/static-style-extract
import extractStyle from `@ant-design/static-style-extract`; const cssText = extractStyle(); // :where(.css-bAMboOo).ant-btn ...
use with custom theme
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
import extractStyle from `@ant-design/static-style-extract`; const cssText = extractStyle({ includes: ['Button'] // Only Button style will be extracted });
http://localhost:8000
online example: http://react-component.github.io/static-style-extract/
npm install npm start
npm test
npm run coverage
open coverage/ dir
@ant-design/static-style-extract is released under the MIT license.
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
@ant-design/static-style-extract
Provide a lib like
@ant-design/static-style-extractto support generate static css for SSR usage to generate raw css file for caching.Install
Usage
use with custom theme
use with blacklist or whitelist
Example
http://localhost:8000
online example: http://react-component.github.io/static-style-extract/
Development
Test Case
Coverage
open coverage/ dir
License
@ant-design/static-style-extractis released under the MIT license.