Skip to content

Commit

Permalink
✨ feat: 优化 css-prefix key 为 acss 以减少样式类名体积
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Mar 1, 2023
1 parent 310850f commit d367033
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ export * from './CacheManager';
export * from './createCSS';
export * from './createEmotion';
export { serializeCSS, type SerializeCSS } from './createSerializeStyles';

export const DEFAULT_CSS_PREFIX_KEY = 'acss';
3 changes: 2 additions & 1 deletion src/factories/createStyleProvider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DEFAULT_CSS_PREFIX_KEY } from '@/core';
import { createEmotion, Emotion } from '@/core/createEmotion';
import { StyleManager } from '@/types';
import { StylisPlugin } from '@emotion/cache';
Expand Down Expand Up @@ -36,7 +37,7 @@ export const createStyleProvider = (
memo(
({
children,
prefix = defaultProps?.prefix || 'ant-css',
prefix = defaultProps?.prefix || DEFAULT_CSS_PREFIX_KEY,
speedy = defaultProps?.speedy,
getStyleManager,

Expand Down
3 changes: 2 additions & 1 deletion src/functions/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { DEFAULT_CSS_PREFIX_KEY } from '@/core';
import { createInstance } from './createInstance';

export { setupStyled } from './setupStyled';
export { createInstance };

const styleInstance = createInstance({ key: 'ant-css', speedy: false });
const styleInstance = createInstance({ key: DEFAULT_CSS_PREFIX_KEY, speedy: false });

export const {
// **** 样式生成相关 **** //
Expand Down

0 comments on commit d367033

Please sign in to comment.