chore: extract getSizeStyle
This commit is contained in:
@@ -10,6 +10,16 @@ export function addUnit(value?: string | number): string | undefined {
|
||||
return isNumeric(value) ? `${value}px` : value;
|
||||
}
|
||||
|
||||
export function getSizeStyle(originSize?: string | number) {
|
||||
if (isDef(originSize)) {
|
||||
const size = addUnit(originSize);
|
||||
return {
|
||||
width: size,
|
||||
height: size,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// cache
|
||||
let rootFontSize: number;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
export { addUnit } from './format/unit';
|
||||
export { addUnit, getSizeStyle } from './format/unit';
|
||||
export { createNamespace } from './create';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
|
||||
Reference in New Issue
Block a user