1
0
Fork 0
mirror of synced 2024-06-02 02:25:17 +12:00

Add gap to container settings and remove some colours from color picker

This commit is contained in:
Andrew Kingston 2021-06-24 11:29:20 +01:00
parent 35c9b4ff2f
commit 3074b3894f
3 changed files with 48 additions and 8 deletions

View file

@ -22,8 +22,6 @@
label: "Grays",
colors: [
"white",
"gray-50",
"gray-75",
"gray-100",
"gray-200",
"gray-300",

View file

@ -174,6 +174,32 @@
}
],
"defaultValue": "shrink"
},
{
"type": "select",
"label": "Gap",
"key": "gap",
"showInBar": true,
"barStyle": "picker",
"options": [
{
"label": "None",
"value": "N"
},
{
"label": "Small",
"value": "S"
},
{
"label": "Medium",
"value": "M"
},
{
"label": "Large",
"value": "L"
}
],
"defaultValue": "M"
}
]
},
@ -368,7 +394,7 @@
"type": "select",
"label": "Size",
"key": "size",
"defaultValue": "Medium",
"defaultValue": "M",
"showInBar": true,
"barStyle": "picker",
"options": [{
@ -462,7 +488,7 @@
"type": "select",
"label": "Size",
"key": "size",
"defaultValue": "Medium",
"defaultValue": "M",
"showInBar": true,
"barStyle": "picker",
"options": [{

View file

@ -8,17 +8,23 @@
export let hAlign
export let vAlign
export let size
export let gap
$: directionClass = direction ? `valid-container direction-${direction}` : ""
$: hAlignClass = hAlign ? `hAlign-${hAlign}` : ""
$: vAlignClass = vAlign ? `vAlign-${vAlign}` : ""
$: sizeClass = size ? `size-${size}` : ""
$: gapClass = gap ? `gap-${gap}` : ""
$: classNames = [
directionClass,
hAlignClass,
vAlignClass,
sizeClass,
gapClass,
].join(" ")
</script>
<div
class={[directionClass, hAlignClass, vAlignClass, sizeClass].join(" ")}
use:styleable={$component.styles}
>
<div class={classNames} use:styleable={$component.styles}>
<slot />
</div>
@ -83,4 +89,14 @@
.direction-column.hAlign-stretch {
align-items: stretch;
}
.gap-S {
gap: 8px;
}
.gap-M {
gap: 16px;
}
.gap-L {
gap: 32px;
}
</style>