mirror of
https://github.com/zhigang1992/wallet.git
synced 2026-01-12 09:34:37 +08:00
21 lines
518 B
JavaScript
21 lines
518 B
JavaScript
import { mapObject } from '../helpers.js';
|
|
import { css } from '../css/index.js';
|
|
|
|
const squareConfig = {
|
|
transform(props) {
|
|
const { size, ...rest } = props;
|
|
return {
|
|
display: "flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
flex: "0 0 auto",
|
|
width: size,
|
|
height: size,
|
|
...rest
|
|
};
|
|
}}
|
|
|
|
export const getSquareStyle = (styles = {}) => squareConfig.transform(styles, { map: mapObject })
|
|
|
|
export const square = (styles) => css(getSquareStyle(styles))
|
|
square.raw = (styles) => styles |