Box align
This commit is contained in:
1 parent
cced734dc4
commit
c0694b0953
2 files changed
+9
-3
No files matched your search
@@ -1,18 +1,22 @@
|
|||||||
.box {
|
.box {
|
||||||
display: flex;
|
display: flex;
|
||||||
/* align-items: baseline; */
|
align-items: baseline;
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.box.align {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.box.wrap {
|
.box.wrap {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box.center {
|
.box.center {
|
||||||
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export type BoxProps = {
|
|||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
style?: React.CSSProperties
|
style?: React.CSSProperties
|
||||||
wrap?: boolean
|
wrap?: boolean
|
||||||
|
align?: boolean
|
||||||
vertical?: boolean
|
vertical?: boolean
|
||||||
center?: boolean
|
center?: boolean
|
||||||
}
|
}
|
||||||
@@ -19,11 +20,12 @@ export const Box: React.FC<BoxProps> = ({
|
|||||||
wrap = false,
|
wrap = false,
|
||||||
vertical = false,
|
vertical = false,
|
||||||
center = false,
|
center = false,
|
||||||
|
align = true,
|
||||||
style,
|
style,
|
||||||
...props
|
...props
|
||||||
}) => {
|
}) => {
|
||||||
const newProps = {
|
const newProps = {
|
||||||
className: cx(s.box, { vertical, center, wrap }),
|
className: cx(s.box, { vertical, align, center, wrap }),
|
||||||
style,
|
style,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user