-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add types using polished and the renamed functions * run prettier
- Loading branch information
Allan Pope
committed
Feb 14, 2020
1 parent
702ad0c
commit 35f0b3b
Showing
5 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Type definitions for @theme-ui/color 0.3 | ||
// Project: https://github.com/system-ui/theme-ui | ||
// Definitions by: Allan Pope <https://github.com/allanpope> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 3.5 | ||
|
||
export * from 'polished'; | ||
// A few polished functions have been renamed in theme-ui | ||
// If these are updated in polished, then the code below can be deleted | ||
import { | ||
adjustHue as rotate, | ||
rgba as alpha, | ||
setHue as hue, | ||
setLightness as lightness, | ||
setSaturation as saturation, | ||
} from 'polished'; | ||
export { alpha, hue, lightness, rotate, saturation }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"polished": "^3.4.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { | ||
darken, | ||
lighten, | ||
rotate, | ||
hue, | ||
saturation, | ||
lightness, | ||
desaturate, | ||
saturate, | ||
shade, | ||
tint, | ||
transparentize, | ||
alpha, | ||
mix, | ||
complement, | ||
invert, | ||
grayscale, | ||
} from '@theme-ui/color'; | ||
|
||
darken(0.2, '#000'); | ||
lighten(0.2, '#000'); | ||
rotate(0.2, '#000'); | ||
hue(0.2, '#000'); | ||
saturation(0.2, '#000'); | ||
lightness(0.2, '#000'); | ||
desaturate(0.1, '#000'); | ||
saturate(0.1, '#000'); | ||
shade('20%', '#000'); | ||
tint('20%', '#000'); | ||
transparentize(0.2, '#000'); | ||
alpha('#000', 0.2); | ||
mix(0.25, '#000', '#FFF'); | ||
complement('#000'); | ||
complement('#000'); | ||
invert('#000'); | ||
grayscale('#000'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"compilerOptions": { | ||
"jsx": "preserve", | ||
"module": "commonjs", | ||
"lib": [ | ||
"es6" | ||
], | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"strictFunctionTypes": true, | ||
"strictNullChecks": true, | ||
"baseUrl": "../", | ||
"typeRoots": [ | ||
"../" | ||
], | ||
"paths": { | ||
"@theme-ui/color": ["theme-ui__color"] | ||
}, | ||
"types": [], | ||
"noEmit": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"files": [ | ||
"index.d.ts", | ||
"theme-ui__color-tests.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "dtslint/dt.json" } |