Add more size options for paragraphs and headings

This commit is contained in:
Andrew Kingston 2021-08-13 12:07:45 +01:00
parent 5990b050e0
commit cc65aff391
2 changed files with 27 additions and 10 deletions

View File

@ -595,6 +595,9 @@
"showInBar": true, "showInBar": true,
"barStyle": "picker", "barStyle": "picker",
"options": [{ "options": [{
"label": "Extra Small",
"value": "XS"
}, {
"label": "Small", "label": "Small",
"value": "S" "value": "S"
}, { }, {
@ -603,6 +606,15 @@
}, { }, {
"label": "Large", "label": "Large",
"value": "L" "value": "L"
}, {
"label": "Extra Large",
"value": "XL"
}, {
"label": "2XL",
"value": "XXL"
}, {
"label": "3XL",
"value": "XXXL"
}] }]
}, },
{ {
@ -689,6 +701,9 @@
"showInBar": true, "showInBar": true,
"barStyle": "picker", "barStyle": "picker",
"options": [{ "options": [{
"label": "Extra Small",
"value": "XS"
}, {
"label": "Small", "label": "Small",
"value": "S" "value": "S"
}, { }, {
@ -697,6 +712,15 @@
}, { }, {
"label": "Large", "label": "Large",
"value": "L" "value": "L"
}, {
"label": "Extra Large",
"value": "XL"
}, {
"label": "2XL",
"value": "XXL"
}, {
"label": "3XL",
"value": "XXXL"
}] }]
}, },
{ {

View File

@ -16,6 +16,8 @@
$: componentText = $builderStore.inBuilder $: componentText = $builderStore.inBuilder
? text || $component.name || "Placeholder text" ? text || $component.name || "Placeholder text"
: text || "" : text || ""
$: sizeClass = `spectrum-Body--size${size || "M"}`
$: alignClass = `align--${align || "left"}`
// Add color styles to main styles object, otherwise the styleable helper // Add color styles to main styles object, otherwise the styleable helper
// overrides the color when it's passed as inline style. // overrides the color when it's passed as inline style.
@ -41,7 +43,7 @@
class:bold class:bold
class:italic class:italic
class:underline class:underline
class="align--{align || 'left'} size--{size || 'M'}" class="spectrum-Body {sizeClass} {alignClass}"
> >
{componentText} {componentText}
</p> </p>
@ -65,15 +67,6 @@
.underline { .underline {
text-decoration: underline; text-decoration: underline;
} }
.size--S {
font-size: 14px;
}
.size--M {
font-size: 16px;
}
.size--L {
font-size: 18px;
}
.align--left { .align--left {
text-align: left; text-align: left;
} }