Skip to content

Commit

Permalink
Merge pull request #866 from peduarte/add-opacities-scale
Browse files Browse the repository at this point in the history
Add `opacities` scale to CSS function
  • Loading branch information
jxnblk committed May 5, 2020
2 parents 31443b3 + f5d4b22 commit 350b018
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/css/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const scales = {
color: 'colors',
backgroundColor: 'colors',
borderColor: 'colors',
opacity: 'opacities',
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 @@ -530,6 +530,7 @@ export interface Theme {
colorStyles?: ObjectOrArray<SystemCssProperties>
textStyles?: ObjectOrArray<SystemCssProperties>
text?: ObjectOrArray<SystemCssProperties>
opacities?: ObjectOrArray<CSS.OpacityProperty>
/**
* Enable/disable custom CSS properties/variables if lower browser
* support is required (for eg. IE 11).
Expand Down
3 changes: 3 additions & 0 deletions packages/css/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const theme: Theme = {
radii: {
small: 5,
},
opacities: [0, '50%'],
}

test('returns a function', () => {
Expand Down Expand Up @@ -140,6 +141,7 @@ test('handles all core styled system props', () => {
fontWeight: 'bold',
color: 'primary',
bg: 'secondary',
opacity: 1,
fontFamily: 'monospace',
lineHeight: 'body',
})({ theme })
Expand All @@ -153,6 +155,7 @@ test('handles all core styled system props', () => {
paddingBottom: 32,
color: 'tomato',
backgroundColor: 'cyan',
opacity: '50%',
fontFamily: 'Menlo, monospace',
fontSize: 24,
fontWeight: 600,
Expand Down

0 comments on commit 350b018

Please sign in to comment.