Skip to content

Commit

Permalink
[Manual] Copied the outputs json version of Sass for easier consumpti…
Browse files Browse the repository at this point in the history
…on in docs rather that sass-loader
  • Loading branch information
cchaos committed Sep 29, 2021
1 parent 4e66fbc commit 082a756
Show file tree
Hide file tree
Showing 5 changed files with 3,145 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src-docs/src/views/theme/_json/_get_json_vars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { useContext } from 'react';

import lightColors from './eui_legacy_light.json';
import darkColors from './eui_legacy_dark.json';
import lightAmsterdamColors from './eui_theme_light.json';
import darkAmsterdamColors from './eui_theme_dark.json';
import { ThemeContext } from '../../../components';

export const useJsonVars = () => {
const themeContext = useContext(ThemeContext);

let palette;
switch (themeContext.theme) {
case 'light':
palette = lightColors;
break;
case 'dark':
palette = darkColors;
break;
case 'amsterdam-dark':
palette = darkAmsterdamColors;
break;
default:
palette = lightAmsterdamColors;
break;
}

return palette;
};
Loading

0 comments on commit 082a756

Please sign in to comment.