You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TODO: decide what to do with Spacing/Sizing since they are pretty much rolled up into Dimensions?
25
+
## Dimensions
32
26
33
27
Spacing props like `margin` and `padding` accept values on a **4px grid**. These are specified in `px` and get converted to `rem`. In addition to numbers, these named options are available:
34
28
@@ -37,8 +31,6 @@ Spacing props like `margin` and `padding` accept values on a **4px grid**. These
37
31
-`text-to-control` – default spacing between text and a control (e.g., label and input). Scales with font size.
38
32
-`text-to-visual` – default spacing between text and a visual element (e.g., icon). Scales with font size.
39
33
40
-
## Sizing
41
-
42
34
Size props like `width` and `height` accept arbitrary pixel values. Values are converted to `rem` and multiplied by 1.25x on touch devices to increase hit targets.
@@ -47,7 +39,7 @@ Size props like `width` and `height` accept arbitrary pixel values. Values are c
47
39
48
40
// TODO: edit copy
49
41
50
-
Spectrum 2 typography is applied via the `font` shorthand, which sets `fontFamily`, `fontSize`, `fontWeight`, `lineHeight`, and `color`. You can override any of these individually.
42
+
Spectrum 2 typography can be applied via the `font`[shorthand](#shorthand), which sets `fontFamily`, `fontSize`, `fontWeight`, `lineHeight`, and `color`. You can override any of these individually.
51
43
52
44
```tsx
53
45
<main>
@@ -75,7 +67,6 @@ Type scales include: UI, Body, Heading, Title, Detail, and Code. Each scale has
@@ -695,6 +696,64 @@ function TemplateLiteral({elements}: TTemplate) {
695
696
);
696
697
}
697
698
699
+
conststyleMacroTypeLinks={
700
+
'baseColors': {
701
+
// TODO: will need to have this link work somehow
702
+
description: 'A base set of colors defined by Spectrum. Contains a various global and semantic colors as well as high contrast color values for accessibility high contrast mode. See [above](#colors) for more info.'
703
+
},
704
+
'baseSpacing': {
705
+
description: 'Base spacing values in pixels, following a 4px grid. Will be converted to rem.',
description: <>A CSS length value with percentage or viewport units. e.g. <codeclassName={codeStyle}>'50%'</code>, <codeclassName={codeStyle}>'100vw'</code>, <codeclassName={codeStyle}>'50vh'</code></>
732
+
},
733
+
'number': {
734
+
description: <>A numeric value in pixels e.g. <codeclassName={codeStyle}>20</code>. Will be converted to rem and scaled on touch devices.</>
A base set of colors defined by Spectrum. See the global and semantic colors in the color reference above.
746
-
</p>
747
-
)}
748
-
{typeName==='LengthPercentage'&&(
749
-
<pclassName={style({font: 'body'})}>
750
-
A CSS length value with percentage or viewport units. Examples: <codeclassName={codeStyle}>'50%'</code>, <codeclassName={codeStyle}>'100vw'</code>, <codeclassName={codeStyle}>'50vh'</code>
751
-
</p>
752
-
)}
753
-
{typeName==='number'&&(
754
-
<pclassName={style({font: 'body'})}>
755
-
A numeric value in pixels. Will be converted to rem and scaled on touch devices.
@@ -767,3 +813,13 @@ export function StyleMacroProperties({properties}: StyleMacroPropertiesProps) {
767
813
</Table>
768
814
);
769
815
}
816
+
817
+
818
+
// TODO: for the below, will need to figure out how to get the same kind of mdx styling in the popover
819
+
// TODO: for the baseColors, either link up or expose a type that displays the visual colors in the popover
820
+
// for some reason trying to render the S2 colors example into the popover crashes the build?
821
+
// same for spacing, perhaps do the type that contains the same explaination, and remove the text blob
822
+
// TODO: add to the table a description col span 2 to describe what things like aspectRatio and such accept (aka This takes a). this exists in the Prop table so look there
823
+
824
+
// TODO: For the Shorthands, have a column for Name, value (what values it accepts), and mapping where mapping is what properties it maps to
0 commit comments