mirror of
https://github.com/zhigang1992/wallet.git
synced 2026-01-12 09:34:37 +08:00
20 lines
536 B
JavaScript
20 lines
536 B
JavaScript
import { mapObject } from '../helpers.js';
|
|
import { css } from '../css/index.js';
|
|
|
|
const stackConfig = {
|
|
transform(props) {
|
|
const { align, justify, direction = "column", gap = "10px", ...rest } = props;
|
|
return {
|
|
display: "flex",
|
|
flexDirection: direction,
|
|
alignItems: align,
|
|
justifyContent: justify,
|
|
gap,
|
|
...rest
|
|
};
|
|
}}
|
|
|
|
export const getStackStyle = (styles = {}) => stackConfig.transform(styles, { map: mapObject })
|
|
|
|
export const stack = (styles) => css(getStackStyle(styles))
|
|
stack.raw = (styles) => styles |