Skip to content

Commit 350b018

Browse files
authored
Merge pull request #866 from peduarte/add-opacities-scale
Add `opacities` scale to CSS function
2 parents 31443b3 + f5d4b22 commit 350b018

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

packages/css/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const scales = {
5656
color: 'colors',
5757
backgroundColor: 'colors',
5858
borderColor: 'colors',
59+
opacity: 'opacities',
5960
margin: 'space',
6061
marginTop: 'space',
6162
marginRight: 'space',

packages/css/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ export interface Theme {
530530
colorStyles?: ObjectOrArray<SystemCssProperties>
531531
textStyles?: ObjectOrArray<SystemCssProperties>
532532
text?: ObjectOrArray<SystemCssProperties>
533+
opacities?: ObjectOrArray<CSS.OpacityProperty>
533534
/**
534535
* Enable/disable custom CSS properties/variables if lower browser
535536
* support is required (for eg. IE 11).

packages/css/test/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const theme: Theme = {
5252
radii: {
5353
small: 5,
5454
},
55+
opacities: [0, '50%'],
5556
}
5657

5758
test('returns a function', () => {
@@ -140,6 +141,7 @@ test('handles all core styled system props', () => {
140141
fontWeight: 'bold',
141142
color: 'primary',
142143
bg: 'secondary',
144+
opacity: 1,
143145
fontFamily: 'monospace',
144146
lineHeight: 'body',
145147
})({ theme })
@@ -153,6 +155,7 @@ test('handles all core styled system props', () => {
153155
paddingBottom: 32,
154156
color: 'tomato',
155157
backgroundColor: 'cyan',
158+
opacity: '50%',
156159
fontFamily: 'Menlo, monospace',
157160
fontSize: 24,
158161
fontWeight: 600,

0 commit comments

Comments
 (0)