Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions packages/@react-spectrum/s2/style/spectrum-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,15 +687,19 @@ export const style = createTheme({
containIntrinsicWidth: createSpectrumSizingProperty('containIntrinsicWidth', width),
containIntrinsicHeight: createSpectrumSizingProperty('containIntrinsicHeight', height),
minHeight: createSpectrumSizingProperty('minHeight', height),
maxHeight: createSpectrumSizingProperty('maxHeight', {
...height,
none: 'none'
}),
maxHeight: createSpectrumSizingProperty('maxHeight', (() => {
// auto is not a valid value for maxHeight
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const {auto, ...rest} = height;
return {...rest, none: 'none'};
})()),
Comment on lines +690 to +695
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note this change in the theme, should be pretty minor

minWidth: createSpectrumSizingProperty('minWidth', width),
maxWidth: createSpectrumSizingProperty('maxWidth', {
...width,
none: 'none'
}),
maxWidth: createSpectrumSizingProperty('maxWidth', (() => {
// auto is not a valid value for maxWidth
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const {auto, ...rest} = width;
return {...rest, none: 'none'};
})()),
borderStartWidth: new MappedProperty('borderInlineStartWidth', borderWidth),
borderEndWidth: new MappedProperty('borderInlineEndWidth', borderWidth),
borderTopWidth: borderWidth,
Expand Down
10 changes: 2 additions & 8 deletions packages/dev/s2-docs/pages/s2/style-macro.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Layout} from '../../src/Layout';
import {InlineAlert, Heading, Content, Link} from '@react-spectrum/s2';
import {StyleMacroProperties} from '../../src/StyleMacroProperties';
import {getPropertyDefinitions, getShorthandDefinitions} from '../../src/styleProperties';
import {getPropertyDefinitions} from '../../src/styleProperties';
export default Layout;

export const section = 'Components';
Expand All @@ -24,7 +24,7 @@ All Spectrum 2 color tokens are available across color properties (e.g., `backgr

## Text

Spectrum 2 typography can be applied via the `font` [shorthand](#shorthands), which sets `fontFamily`, `fontSize`, `fontWeight`, `lineHeight`, and `color`. You can override any of these individually.
Spectrum 2 typography can be applied via the `font` shorthand, which sets `fontFamily`, `fontSize`, `fontWeight`, `lineHeight`, and `color`. You can override any of these individually.
Note that `font` should be applied on a per element basis rather than globally so as to properly conform with Spectrum designs.

```tsx
Expand Down Expand Up @@ -52,12 +52,6 @@ Note that `font` should be applied on a per element basis rather than globally s

<StyleMacroProperties properties={getPropertyDefinitions('misc')} />

## Shorthands

Shorthands apply their provided value to commonly grouped properties.

<StyleMacroProperties properties={getShorthandDefinitions('shorthand')} />

## Conditions

<StyleMacroProperties properties={getPropertyDefinitions('conditions')} />
2 changes: 1 addition & 1 deletion packages/dev/s2-docs/src/S2Colors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function ColorScale({scale}) {
));
}

function Color({name, className}) {
export function Color({name, className}) {
return (
<div className={style({display: 'flex', gap: 8, marginBottom: 4, font: 'ui', alignItems: 'center', breakInside: 'avoid'})}>
<div className={typeof className === 'function' ? className({}) : className} />
Expand Down
Loading