mirror of
https://github.com/zhigang1992/react.git
synced 2026-01-28 22:30:13 +08:00
* feat: added status prop to set color by states test: check status success, warning and error * docs: added playground example and API reference fix: replaced ´_´ as it's not recommended to use fix: removed redundant return refactor: renamed prop from status to type test: update test with the renamed prop * docs: update prop references from status to type fix: status prop not updated to type fix: missing return * fix(select): set icons and hover state to follow the theme * test(slider): update snapshots * chore: always use relative paths when import types Co-authored-by: unix <unix.bio@gmail.com>
31 lines
739 B
TypeScript
31 lines
739 B
TypeScript
import { GeistUIThemesPalette } from '../themes/presets'
|
|
|
|
export type BrowserColors = {
|
|
color: string
|
|
barBgColor: string
|
|
inputBgColor: string
|
|
borderColor: string
|
|
titleColor: string
|
|
}
|
|
|
|
export const getBrowserColors = (
|
|
invert: boolean,
|
|
palette: GeistUIThemesPalette,
|
|
): BrowserColors => {
|
|
return invert
|
|
? {
|
|
color: palette.background,
|
|
barBgColor: palette.foreground,
|
|
inputBgColor: palette.accents_8,
|
|
borderColor: palette.accents_7,
|
|
titleColor: palette.accents_2,
|
|
}
|
|
: {
|
|
color: palette.foreground,
|
|
barBgColor: palette.background,
|
|
inputBgColor: palette.accents_1,
|
|
borderColor: palette.border,
|
|
titleColor: palette.accents_5,
|
|
}
|
|
}
|