Skip to content

Commit

Permalink
fix: remove size utility (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Jan 31, 2021
1 parent f980ddb commit 3fb9239
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 110 deletions.
30 changes: 0 additions & 30 deletions packages/system/src/styles/sizing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,34 +70,6 @@ export const height = style({
themeGet: getSize,
})

type SizeProp<T extends ITheme> = SystemProp<
SizeGetter<T> | (CSS.Property.Width & CSS.Property.Height),
T
>
export interface SizeProps<T extends ITheme = Theme> {
size?: SizeProp<T>
motionSafeSize?: SizeProp<T>
motionReduceSize?: SizeProp<T>
firstSize?: SizeProp<T>
lastSize?: SizeProp<T>
oddSize?: SizeProp<T>
evenSize?: SizeProp<T>
visitedSize?: SizeProp<T>
checkedSize?: SizeProp<T>
focusWithinSize?: SizeProp<T>
hoverSize?: SizeProp<T>
focusSize?: SizeProp<T>
focusVisibleSize?: SizeProp<T>
activeSize?: SizeProp<T>
disabledSize?: SizeProp<T>
placeholderSize?: SizeProp<T>
}
export const size = style({
prop: 'size',
cssProperty: ['width', 'height'],
themeGet: getSize,
})

type MaxWidthProp<T extends ITheme> = SystemProp<
SizeGetter<T> | CSS.Property.MaxWidth,
T
Expand Down Expand Up @@ -209,15 +181,13 @@ export const minHeight = style({
export interface SizingProps<T extends ITheme = Theme>
extends WidthProps<T>,
HeightProps<T>,
SizeProps<T>,
MaxWidthProps<T>,
MaxHeightProps<T>,
MinWidthProps<T>,
MinHeightProps<T> {}
export const sizing = compose(
width,
height,
size,
maxWidth,
maxHeight,
minWidth,
Expand Down
8 changes: 8 additions & 0 deletions website/pages/docs/getting-started/upgrade-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ To reduce conflict between image attributes `width` and `height`, only `w` and `

Replace it by `w` and `h`.

### No more `size` utility

To reduce conflict between [input attribute `size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-size), size .

- **If you use `size` in your project:**

Replace it by `w` + `h`.

### No more `forwardedAs`

Everything is now simplified, you don't have to worry about `forwardedAs` any more, `as` works everywhere.
Expand Down
80 changes: 0 additions & 80 deletions website/pages/docs/sizing/size.mdx

This file was deleted.

0 comments on commit 3fb9239

Please sign in to comment.