Skip to content

Commit

Permalink
[Visual Refresh] Update vis colors and palettes (elastic#8112)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgadewoll committed Jan 10, 2025
1 parent 4abac5e commit e5a7789
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 154 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
/* eslint-disable no-restricted-globals */
import React, { useState, useContext } from 'react';

import {
EuiThemeProvider,
useEuiTheme,
useIsWithinBreakpoints,
} from '../../../../src/services';
import { EuiThemeProvider, useEuiTheme } from '../../../../src/services';
import { EUI_THEME } from '../../../../src/themes';
import { AVAILABLE_THEMES } from '../with_theme/theme_context';

import { ThemeContext } from '../with_theme';
import {
Expand All @@ -19,6 +14,7 @@ import {
EuiSwitch,
EuiSwitchEvent,
} from '../../../../src/components';
import { AVAILABLE_THEMES } from '../with_theme/theme_context';

export const GuideThemeSelector = () => {
const context = useContext(ThemeContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ export class ThemeProvider extends React.Component<PropsWithChildren, State> {
colorMode
);

const colorMode =
(localStorage.getItem('colorMode') as EuiThemeColorModeStandard) ||
undefined;

const themeLanguage = this.getThemeLanguage();

this.state = {
Expand Down
7 changes: 0 additions & 7 deletions packages/eui/src-docs/src/theme_new_dark.scss

This file was deleted.

7 changes: 0 additions & 7 deletions packages/eui/src-docs/src/theme_new_light.scss

This file was deleted.

8 changes: 8 additions & 0 deletions packages/eui/src/components/avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ export const EuiAvatar: FunctionComponent<EuiAvatarProps> = ({
[euiTheme]
);

const { euiTheme } = useEuiTheme();

const visColors = useMemo(
() => euiPaletteColorBlindBehindText(),
// eslint-disable-next-line react-hooks/exhaustive-deps
[euiTheme]
);

const isPlain = color === 'plain';
const isSubdued = color === 'subdued';
const isNamedColor = isPlain || isSubdued || color === null;
Expand Down

0 comments on commit e5a7789

Please sign in to comment.