Skip to content

Commit

Permalink
update(tooltip): Make inverted text readable in dark mode (#386)
Browse files Browse the repository at this point in the history
* update(tooltip): Make inverted text readable in dark mode

* lint

* dont use the blackest of black

* mode -> baseInverse
  • Loading branch information
Xapphire13 authored Jul 2, 2020
1 parent bfb933c commit c218858
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/components/Tooltip/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const styleSheetTooltip: StyleSheet = ({ unit, color, pattern, ui }) => (
},

content_inverted: {
backgroundColor: color.accent.blackout,
backgroundColor: color.baseInverse,
},

popover: {
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/themes/buildTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import toRGBA from '../utils/toRGBA';

export type Options = {
base: string;
baseInverse: string;
borderRadius?: number;
boxShadow?: [number, number];
boxShadowColor?: string;
Expand All @@ -24,6 +25,7 @@ export default function buildTheme(
): Theme {
const {
base,
baseInverse,
borderRadius = 4,
boxShadow = [2, 4],
boxShadowColor = base,
Expand Down Expand Up @@ -71,6 +73,7 @@ export default function buildTheme(
color: {
accent,
base,
baseInverse,
brand,
core: color,
clear: 'transparent',
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/themes/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const color: Theme['color']['core'] = {
export default (fontFamily: string) =>
buildTheme({
base: '#181818',
baseInverse: '#FFF',
boxShadowColor: '#000',
brand,
color,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/themes/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const color: Theme['color']['core'] = {
export default (fontFamily: string) =>
buildTheme({
base: '#fff',
baseInverse: '#181818',
boxShadowColor: color.neutral[6],
brand,
color,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export type Theme = {
textError: Hexcode;
};
base: Hexcode;
baseInverse: Hexcode;
brand: {
luxury: ColorRange;
plus: ColorRange;
Expand Down

0 comments on commit c218858

Please sign in to comment.