diff --git a/packages/eui/src-docs/src/views/app_context.js b/packages/eui/src-docs/src/views/app_context.js index 606ce277bb1..4259754211b 100644 --- a/packages/eui/src-docs/src/views/app_context.js +++ b/packages/eui/src-docs/src/views/app_context.js @@ -49,6 +49,10 @@ export const AppContext = ({ children }) => { const isLocalDev = window.location.host.includes('803'); setEuiDevProviderWarning(isLocalDev ? 'error' : 'warn'); // Note: this can't be in a useEffect, otherwise it fires too late for style memoization warnings to error on page reload + const overrides = JSON.parse( + localStorage.getItem('kbn-theme-overrides') || '{}' + ); + return ( { }} theme={EUI_THEMES.find((t) => t.value === theme)?.provider} colorMode={theme.includes('light') ? 'light' : 'dark'} + modify={overrides} > { <> + + { + const overridesJSON = JSON.stringify( + overrides || {}, + null, + 2 + ); + localStorage.setItem('kbn-theme-overrides', overridesJSON); + location.reload(); + }} + fill + iconType="copyClipboard" + > + Apply to local storage + + + + { + const overridesJSON = JSON.stringify({}, null, 2); + localStorage.setItem('kbn-theme-overrides', overridesJSON); + location.reload(); + }} + fill + iconType="copyClipboard" + > + Reset local storage + + {Object.keys(overrides).length > 0 && ( <>