Browse Source

Add more size options for paragraphs and headings

master
Andrew Kingston 5 years ago
parent
commit
c7687b6400
  1. 24
      packages/standard-components/manifest.json
  2. 13
      packages/standard-components/src/Text.svelte

24
packages/standard-components/manifest.json

@ -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"
}] }]
}, },
{ {

13
packages/standard-components/src/Text.svelte

@ -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;
} }

Loading…
Cancel
Save