Skip to content

Commit

Permalink
feat: other styled props
Browse files Browse the repository at this point in the history
  • Loading branch information
mleralec committed Jul 2, 2022
1 parent 980cd95 commit e091250
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,14 @@ const Box = styled.div<System>(system)
| textAlign | text-align | |
| fontStyle | font-style | |
| textDecoration | text-decoration | |

### Other

| JSX Property | CSS property | Theme key |
| -------------- | --------------- | --------- |
| cusor | cursor | |
| float | float | |
| objectFit | object-fit | |
| objectPosition | object-position | |
| transform | transform | |
| visibility | visibility | |
24 changes: 24 additions & 0 deletions src/config/other.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type * as CSS from 'csstype'
import type { CSSObject } from 'styled-components'

import type { Props, ThemeProp } from '../types'

export type OtherProps = Props<{
cursor: CSS.Property.Cursor
float: CSS.Property.Float
objectFit: CSS.Property.ObjectFit
objectPosition: CSS.Property.ObjectPosition
transform: CSS.Property.Transform
visibility: CSS.Property.Visibility
}>

export const layout = (props: OtherProps & ThemeProp): CSSObject => {
return {
cursor: props.cursor,
float: props.float,
objectFit: props.objectFit,
objectPosition: props.objectPosition,
transform: props.transform,
visibility: props.visibility,
}
}

0 comments on commit e091250

Please sign in to comment.