diff --git a/packages/apps-config/src/ui/general/index.ts b/packages/apps-config/src/ui/general/index.ts index 191c47de75..08238464cc 100644 --- a/packages/apps-config/src/ui/general/index.ts +++ b/packages/apps-config/src/ui/general/index.ts @@ -4,7 +4,7 @@ // defaults const defaultColor = undefined; // '#f19135' -const emptyColor = '#999'; +const emptyColor = '#99999'; // based on chain name // alphabetical @@ -13,7 +13,7 @@ const chainCrust = '#ff8812'; const chainKulupu = '#003366'; const chainPhala = '#4dc56a'; const chainPolkadot = '#e6007a'; -const chainKusama = '#000'; // '#d32e79'; +const chainKusama = '#000000'; const chainRocco = '#6f36dc'; const chainRoccoAcala = '#173DC9'; const chainRoccoDarwinia = '#7C30DD'; diff --git a/packages/apps/src/Menu/ChainInfo.tsx b/packages/apps/src/Menu/ChainInfo.tsx index eb3a3cab00..0512564bdb 100644 --- a/packages/apps/src/Menu/ChainInfo.tsx +++ b/packages/apps/src/Menu/ChainInfo.tsx @@ -28,7 +28,7 @@ function ChainInfo ({ className }: Props): React.ReactElement { return (
diff --git a/packages/apps/src/Menu/Grouping.tsx b/packages/apps/src/Menu/Grouping.tsx index 0a8e540676..c78c6fd0c8 100644 --- a/packages/apps/src/Menu/Grouping.tsx +++ b/packages/apps/src/Menu/Grouping.tsx @@ -29,7 +29,7 @@ function Grouping ({ className = '', name, routes }: Props): React.ReactElement< return (
  • -
    +
    {name}
    @@ -78,11 +78,10 @@ export default React.memo(styled(Grouping)` } &:hover { - color: #4e4e4e; - .groupHdr, .groupMenu li { background: #fff; + color: #4e4e4e; } .groupHdr { diff --git a/packages/apps/src/Menu/Item.tsx b/packages/apps/src/Menu/Item.tsx index 22936210e3..df30b85cb3 100644 --- a/packages/apps/src/Menu/Item.tsx +++ b/packages/apps/src/Menu/Item.tsx @@ -22,7 +22,7 @@ function Item ({ className = '', isToplevel, route: { Modal, href, icon, name, t const count = useCounter(); return ( -
  • +
  • { const { api, isApiReady } = useApi(); return ( -
    +
    {isApiReady && (
      diff --git a/packages/apps/src/Menu/index.tsx b/packages/apps/src/Menu/index.tsx index acdd99b37c..b12c079f0f 100644 --- a/packages/apps/src/Menu/index.tsx +++ b/packages/apps/src/Menu/index.tsx @@ -161,14 +161,13 @@ function Menu ({ className = '' }: Props): React.ReactElement { export default React.memo(styled(Menu)` align-items: center; - color: #f5f3f1; display: flex; justify-content: space-between; padding: 0; z-index: 220; &.isLoading { - background: #888 !important; + background: #999 !important; &:before { filter: grayscale(1); diff --git a/packages/react-components/src/Badge.tsx b/packages/react-components/src/Badge.tsx index 6edfb24291..0ef36f268b 100644 --- a/packages/react-components/src/Badge.tsx +++ b/packages/react-components/src/Badge.tsx @@ -34,7 +34,7 @@ function Badge ({ className = '', color = 'normal', hover, icon, info, isSmall, return (
    {info || (icon && )} @@ -102,10 +102,6 @@ export default React.memo(styled(Badge)` vertical-align: middle; } - &.counterInvertColor { - background: #eeedec; - } - &.grayColor { background: #eeedec !important; color: #aaa9a8; diff --git a/packages/react-components/src/styles/index.ts b/packages/react-components/src/styles/index.ts index a3d7995104..bd2baa2e4a 100644 --- a/packages/react-components/src/styles/index.ts +++ b/packages/react-components/src/styles/index.ts @@ -15,10 +15,24 @@ interface Props { uiHighlight?: string; } -const defaultHighlight = '#f19135'; // #999 +const BRIGHTNESS = 128 + 32; +const FACTORS = [0.2126, 0.7152, 0.0722]; +const PARTS = [0, 2, 4]; -const getHighlight = (props: Props): string => - (props.uiHighlight || defaultHighlight); +const defaultHighlight = '#f19135'; // '#f19135'; // #999 + +function getHighlight (props: Props): string { + return (props.uiHighlight || defaultHighlight); +} + +function getContrast (props: Props): string { + const hc = getHighlight(props).replace('#', '').toLowerCase(); + const brightness = PARTS.reduce((b, p, index) => b + (parseInt(hc.substr(p, 2), 16) * FACTORS[index]), 0); + + return brightness > BRIGHTNESS + ? 'rgba(47, 45, 43, 0.9)' + : 'rgba(247, 245, 243, 0.9)'; +} export default createGlobalStyle` .highlight--all { @@ -39,6 +53,10 @@ export default createGlobalStyle` background: ${getHighlight} !important; } + .highlight--bg-contrast { + background: ${getContrast}; + } + .highlight--bg-faint, .highlight--bg-light { background: white; @@ -72,6 +90,10 @@ export default createGlobalStyle` color: ${getHighlight} !important; } + .highlight--color-contrast { + color: ${getContrast}; + } + .highlight--fill { fill: ${getHighlight} !important; } @@ -107,7 +129,7 @@ export default createGlobalStyle` &.withoutLink:not(.isDisabled) { .ui--Icon { background: ${getHighlight}; - color: #f5f5f4; + color: ${getContrast}; } } @@ -128,7 +150,7 @@ export default createGlobalStyle` &:hover:not(.isDisabled):not(.isReadOnly), &.isSelected { background: ${getHighlight}; - color: #f5f5f4; + color: ${getContrast}; text-shadow: none; &:not(.isIcon), @@ -145,7 +167,7 @@ export default createGlobalStyle` &.withoutLink:not(.isDisabled) { &:hover { .ui--Icon { - color: #f5f5f4; + color: ${getContrast}; } }