Skip to content

Commit

Permalink
[Docs] Fix Colors guidelines (elastic#5316)
Browse files Browse the repository at this point in the history
* use useJsonVars

* use variable
  • Loading branch information
thompsongl authored and ym committed Oct 29, 2021
1 parent d95b1da commit cff0a2f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src-docs/src/views/guidelines/colors/vis_palette.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { useSassVars } from '../_get_sass_vars';
import { useJsonVars } from '../../theme/_json/_get_json_vars.js';

import {
EuiFlexGroup,
Expand All @@ -10,11 +10,11 @@ import {
EuiText,
EuiPanel,
} from '../../../../../src/components';
import { rgbToHex } from '../../../../../src/services';

export const VisPalette = ({ variant }) => {
const visColors = useSassVars().euiPaletteColorBlind;
const visColorKeys = Object.keys(useSassVars().euiPaletteColorBlind);
const vars = useJsonVars();
const visColors = vars.euiPaletteColorBlind;
const visColorKeys = Object.keys(visColors);

function renderPaletteColor(palette, color, index, key) {
const hex = key ? palette[color][key] : palette[color];
Expand All @@ -30,7 +30,7 @@ export const VisPalette = ({ variant }) => {
onClick={copy}
size="xl"
type="stopFilled"
color={rgbToHex(hex.rgba)}
color={hex}
/>
)}
</EuiCopy>
Expand All @@ -43,7 +43,7 @@ export const VisPalette = ({ variant }) => {
<EuiFlexItem>
<EuiText size="s" color="subdued">
<p>
<code>{rgbToHex(hex.rgba).toUpperCase()}</code>
<code>{hex.toUpperCase()}</code>
</p>
</EuiText>
</EuiFlexItem>
Expand Down

0 comments on commit cff0a2f

Please sign in to comment.