-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(theme): add sizes and colors objects to the theme
- Loading branch information
Showing
9 changed files
with
47 additions
and
19 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
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
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
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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// @flow | ||
|
||
export { COLORS, PALETTE } from './colors'; | ||
export { SIZES } from './sizes'; | ||
export { defaultTheme } from './defaultTheme'; | ||
export { resetGlobal } from './resetGlobal'; |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// @flow | ||
|
||
import { injectGlobal } from 'emotion'; | ||
|
||
const resetGlobal = () => injectGlobal` | ||
|
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,9 @@ | ||
// @flow | ||
|
||
const SIZES = { | ||
MAIN_BORDER_RADIUS: '.5rem', | ||
}; | ||
|
||
export { | ||
SIZES, | ||
}; |
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,11 @@ | ||
// @flow | ||
|
||
const Z_INDEX = { | ||
MODAL: 10000, | ||
FIXED_NAV: 1000, | ||
}; | ||
|
||
export { | ||
Z_INDEX, | ||
}; | ||
|
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
// @flow | ||
import { COLORS } from '../theme/colors'; | ||
import { SIZES } from '../theme/sizes'; | ||
import { Z_INDEX } from '../theme/zIndex'; | ||
|
||
const createTheme = <T: Object>(name: string, theme: ((typeof COLORS) => T) | T): { [string]: T } => ({ | ||
[name]: typeof theme === 'function' ? theme(COLORS) : theme, | ||
const createTheme = <T: Object>(name: string, theme: ((typeof COLORS, typeof SIZES, typeof Z_INDEX) => T) | T): { [string]: T } => ({ | ||
[name]: typeof theme === 'function' ? theme(COLORS, SIZES, Z_INDEX) : theme, | ||
}); | ||
|
||
export { createTheme }; |