Skip to content

Commit

Permalink
Merge pull request #1272 from atanasster/transitions-scale
Browse files Browse the repository at this point in the history
feat: add support for transitions token
  • Loading branch information
hasparus authored Nov 20, 2020
2 parents 4861bae + fad5286 commit a70ffdd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## v0.4.0 UNRELEASED

-- Add support for transitions token. issue: #1079
## v0.4.0-rc.12 2020-11-18

- Use correct version of @theme-ui/components in theme-ui package.
Expand Down
1 change: 1 addition & 0 deletions packages/css/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const scales = {
caretColor: 'colors',
columnRuleColor: 'colors',
opacity: 'opacities',
transition: 'transitions',
margin: 'space',
marginTop: 'space',
marginRight: 'space',
Expand Down
1 change: 1 addition & 0 deletions packages/css/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ export interface Theme {
colorStyles?: Scale<ThemeUICSSProperties>
textStyles?: Scale<ThemeUICSSProperties>
opacities?: Scale<CSS.OpacityProperty>
transitions?: Scale<CSS.TransitionProperty>

/**
* Enable/disable custom CSS properties/variables if lower browser
Expand Down
5 changes: 5 additions & 0 deletions packages/css/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const theme: Theme = {
small: 5,
},
opacities: [0, '50%'],
transitions: {
standard: '0.3s ease-in-out'
}
}

test('returns a function', () => {
Expand Down Expand Up @@ -150,6 +153,7 @@ test('handles all core styled system props', () => {
color: 'primary',
bg: 'secondary',
opacity: 1,
transition: 'standard',
fontFamily: 'monospace',
lineHeight: 'body',
})({ theme })
Expand All @@ -167,6 +171,7 @@ test('handles all core styled system props', () => {
color: 'tomato',
backgroundColor: 'cyan',
opacity: '50%',
transition: '0.3s ease-in-out',
fontFamily: 'Menlo, monospace',
fontSize: 24,
fontWeight: 600,
Expand Down
2 changes: 2 additions & 0 deletions packages/docs/src/pages/sx-prop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Property | Theme Key
`letterSpacing` | `letterSpacings`
`color` | `colors`
`backgroundColor`, `bg` | `colors`
`opacity` | `opacities`
`transition` | `transitions`
`margin`, `m` | `space`
`marginTop`, `mt` | `space`
`marginRight`, `mr` | `space`
Expand Down

0 comments on commit a70ffdd

Please sign in to comment.