Skip to content

Commit 457c59a

Browse files
committed
testing sizing properties
1 parent 28eb788 commit 457c59a

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

packages/dev/s2-docs/pages/s2/Reference.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ Spacing props like `margin` and `padding` accept values on a **4px grid**. These
3333

3434
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.
3535

36-
### top
37-
38-
<StyleMacroProperties properties={getPropertyDefinitions(['top'])} />
36+
<StyleMacroProperties properties={getPropertyDefinitions(['top', 'height'])} />
3937

4038
## Text
4139

@@ -62,8 +60,6 @@ Type scales include: UI, Body, Heading, Title, Detail, and Code. Each scale has
6260

6361
## Layout
6462

65-
### display
66-
6763
<StyleMacroProperties properties={getPropertyDefinitions(['display'])} />
6864

6965

packages/dev/s2-docs/src/styleProperties.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,12 @@ const sizingProperties = new Set([
3131
'flexBasis', 'containIntrinsicWidth', 'containIntrinsicHeight'
3232
]);
3333

34-
// Manually defined property values from spectrum-theme.ts
35-
// These are extracted from the theme definition
34+
// manually defined
3635
const propertyValues: {[key: string]: string[]} = {
3736
display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'grid', 'inline-grid', 'contents', 'list-item', 'none'],
37+
// TODO: this doesn't actually seem to reflect the actual usage?
3838
top: ['0', '2', '4', '8', '12', '16', '20', '24', '28', '32', '36', '40', '44', '48', '56', '64', '80', '96', '-2', '-4', '-8', '-12', '-16', '-20', '-24', '-28', '-32', '-36', '-40', '-44', '-48', '-56', '-64', '-80', '-96', 'auto', 'full'],
39-
position: ['absolute', 'fixed', 'relative', 'sticky', 'static'],
40-
width: ['auto', 'full', 'min', 'max', 'fit', 'screen'],
41-
height: ['auto', 'full', 'min', 'max', 'fit', 'screen'],
42-
minWidth: ['auto', 'full', 'min', 'max', 'fit', 'screen'],
43-
minHeight: ['auto', 'full', 'min', 'max', 'fit', 'screen'],
44-
maxWidth: ['auto', 'full', 'min', 'max', 'fit', 'screen', 'none'],
45-
maxHeight: ['auto', 'full', 'min', 'max', 'fit', 'screen', 'none'],
46-
flexDirection: ['row', 'column', 'row-reverse', 'column-reverse'],
47-
justifyContent: ['normal', 'start', 'end', 'center', 'space-between', 'space-around', 'space-evenly', 'stretch'],
48-
alignItems: ['start', 'end', 'center', 'baseline', 'stretch'],
49-
gap: ['0', '2', '4', '8', '12', '16', '20', '24', '28', '32', '36', '40', '44', '48', '56', '64', '80', '96', 'text-to-control', 'text-to-visual', 'edge-to-text', 'pill']
39+
height: ['auto', 'full', 'min', 'max', 'fit', 'screen']
5040
};
5141

5242
export function getPropertyDefinition(propertyName: string): StyleMacroPropertyDefinition {

0 commit comments

Comments
 (0)