Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade EUI to v43.1.1 #120935

Merged
merged 47 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3d27dde
eui to v43.0.0
thompsongl Dec 9, 2021
ae5276c
update themeprovider types
thompsongl Dec 9, 2021
c233f80
Merge branch 'main' into eui/43.0
thompsongl Dec 9, 2021
9e49e8f
update sass import location
thompsongl Dec 9, 2021
d73dbee
storyshots
thompsongl Dec 9, 2021
138ab58
snapshots
thompsongl Dec 9, 2021
72de6ee
jest
thompsongl Dec 9, 2021
4ef571f
jest
thompsongl Dec 9, 2021
8c67812
Merge branch 'main' into eui/43.0
thompsongl Dec 9, 2021
0a4c8ed
timepicker functional test helpers
thompsongl Dec 9, 2021
1460999
snapshots
thompsongl Dec 9, 2021
655ab86
timepicker functional test helpers
thompsongl Dec 9, 2021
af37e56
invert checked logic
thompsongl Dec 9, 2021
d97e9fd
Merge branch 'main' into eui/43.0
thompsongl Dec 9, 2021
7f85b10
fix i18n token
thompsongl Dec 9, 2021
5e4a764
snapshots
thompsongl Dec 9, 2021
f370b20
handle new refresh interval operations order
thompsongl Dec 13, 2021
25d8b6b
Merge branch 'main' into eui/43.0
thompsongl Dec 13, 2021
9b530e0
refactor refresh interval logic, test
thompsongl Dec 13, 2021
719c5a8
jest
thompsongl Dec 13, 2021
104ba53
Merge branch 'main' into eui/43.0
thompsongl Dec 13, 2021
4616bc7
timepicker popover order
thompsongl Dec 13, 2021
1e9a278
eui to v43.1.0
thompsongl Dec 13, 2021
3f10425
jest
thompsongl Dec 13, 2021
5d514cc
Merge branch 'main' into eui/43.0
thompsongl Dec 13, 2021
35705e1
jest
thompsongl Dec 13, 2021
3a33df2
jest
thompsongl Dec 13, 2021
0f0ffb3
Merge branch 'main' into eui/43.0
thompsongl Dec 13, 2021
0ea0e51
euicode selector
thompsongl Dec 14, 2021
04db019
jest
thompsongl Dec 14, 2021
253e475
Merge branch 'main' into eui/43.0
thompsongl Dec 14, 2021
2e555b5
functional tests
thompsongl Dec 14, 2021
c179517
Merge branch 'main' into eui/43.0
thompsongl Dec 14, 2021
d67dd95
functional tests
thompsongl Dec 14, 2021
cc0b540
Merge branch 'main' into eui/43.0
thompsongl Dec 14, 2021
b579d27
timepicker
thompsongl Dec 14, 2021
db050f0
bump timeout
thompsongl Dec 14, 2021
9d0a26e
Merge branch 'main' into eui/43.0
thompsongl Dec 15, 2021
07eee93
conditional click to close
thompsongl Dec 15, 2021
5083a50
clean up
thompsongl Dec 15, 2021
d5b68ce
eui to v43.1.1
thompsongl Dec 15, 2021
75f7ac4
Merge branch 'main' into eui/43.0
thompsongl Dec 15, 2021
dc71e80
clean up
thompsongl Dec 16, 2021
b582282
Merge branch 'main' into eui/43.0
thompsongl Dec 16, 2021
69a308a
loading background
thompsongl Dec 17, 2021
b4c2ab7
Merge branch 'main' into eui/43.0
thompsongl Dec 17, 2021
a280d69
Merge branch 'main' into eui/43.0
kibanamachine Dec 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.35",
"@elastic/ems-client": "8.0.0",
"@elastic/eui": "41.2.3",
"@elastic/eui": "43.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand Down
2 changes: 0 additions & 2 deletions packages/elastic-eslint-config-kibana/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ module.exports = {
...[
'@elastic/eui/dist/eui_theme_light.json',
'@elastic/eui/dist/eui_theme_dark.json',
'@elastic/eui/dist/eui_theme_amsterdam_light.json',
'@elastic/eui/dist/eui_theme_amsterdam_dark.json',
].map(from => ({
from,
to: false,
Expand Down
8 changes: 4 additions & 4 deletions packages/kbn-ui-shared-deps-npm/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ module.exports = (_, argv) => {
'@elastic/eui/dist/eui_charts_theme',
'@elastic/eui/lib/services',
'@elastic/eui/lib/services/format',
'@elastic/eui/dist/eui_theme_amsterdam_light.json',
'@elastic/eui/dist/eui_theme_amsterdam_dark.json',
'@elastic/eui/dist/eui_theme_light.json',
'@elastic/eui/dist/eui_theme_dark.json',
'@elastic/numeral',
'@emotion/react',
'classnames',
Expand All @@ -96,8 +96,8 @@ module.exports = (_, argv) => {
'styled-components',
'tslib',
],
'kbn-ui-shared-deps-npm.v8.dark': ['@elastic/eui/dist/eui_theme_amsterdam_dark.css'],
'kbn-ui-shared-deps-npm.v8.light': ['@elastic/eui/dist/eui_theme_amsterdam_light.css'],
'kbn-ui-shared-deps-npm.v8.dark': ['@elastic/eui/dist/eui_theme_dark.css'],
'kbn-ui-shared-deps-npm.v8.light': ['@elastic/eui/dist/eui_theme_light.css'],
},
context: __dirname,
devtool: 'cheap-source-map',
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-ui-shared-deps-src/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*/

/* eslint-disable-next-line @kbn/eslint/module_migration */
import { default as v8Light } from '@elastic/eui/dist/eui_theme_amsterdam_light.json';
import { default as v8Light } from '@elastic/eui/dist/eui_theme_light.json';
/* eslint-disable-next-line @kbn/eslint/module_migration */
import { default as v8Dark } from '@elastic/eui/dist/eui_theme_amsterdam_dark.json';
import { default as v8Dark } from '@elastic/eui/dist/eui_theme_dark.json';

const globals: any = typeof window === 'undefined' ? {} : window;

Expand Down
4 changes: 2 additions & 2 deletions src/core/public/core_app/styles/_globals_v8dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// prepended to all .scss imports (from JS, when v8dark theme selected)

@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_dark';
@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_globals';
@import '@elastic/eui/src/themes/amsterdam/colors_dark';
@import '@elastic/eui/src/themes/amsterdam/globals';

@import './mixins';

Expand Down
4 changes: 2 additions & 2 deletions src/core/public/core_app/styles/_globals_v8light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// prepended to all .scss imports (from JS, when v8light theme selected)

@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_light';
@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_globals';
@import '@elastic/eui/src/themes/amsterdam/colors_light';
@import '@elastic/eui/src/themes/amsterdam/globals';

@import './mixins';

Expand Down
142 changes: 90 additions & 52 deletions src/core/public/i18n/i18n_eui_mapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ export const getEuiContextMapping = (): EuiTokensObject => {
'euiAccordion.isLoading': i18n.translate('core.euiAccordion.isLoading', {
defaultMessage: 'Loading',
}),
'euiAutoRefresh.autoRefreshLabel': i18n.translate('core.euiAutoRefresh.autoRefreshLabel', {
defaultMessage: 'Auto refresh',
}),
'euiAutoRefresh.buttonLabelOff': i18n.translate('core.euiAutoRefresh.buttonLabelOff', {
defaultMessage: 'Auto refresh is off',
}),
'euiAutoRefresh.buttonLabelOn': ({ prettyInterval }: EuiValues) =>
i18n.translate('core.euiAutoRefresh.buttonLabelOn', {
defaultMessage: 'Auto refresh is on and set to {prettyInterval}',
values: { prettyInterval },
}),
'euiBasicTable.selectAllRows': i18n.translate('core.euiBasicTable.selectAllRows', {
defaultMessage: 'Select all rows',
description: 'ARIA and displayed label on a checkbox to select all table rows',
Expand Down Expand Up @@ -495,6 +506,42 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'Update needed: {title}',
values: { title },
}),
'euiDisplaySelector.buttonText': i18n.translate('core.euiDisplaySelector.buttonText', {
defaultMessage: 'Display options',
}),
'euiDisplaySelector.resetButtonText': i18n.translate(
'core.euiDisplaySelector.resetButtonText',
{
defaultMessage: 'Reset to default',
}
),
'euiDisplaySelector.densityLabel': i18n.translate('core.euiDisplaySelector.densityLabel', {
defaultMessage: 'Density',
}),
'euiDisplaySelector.labelCompact': i18n.translate('core.euiDisplaySelector.labelCompact', {
defaultMessage: 'Compact',
}),
'euiDisplaySelector.labelNormal': i18n.translate('core.euiDisplaySelector.labelNormal', {
defaultMessage: 'Normal',
}),
'euiDisplaySelector.labelExpanded': i18n.translate('core.euiDisplaySelector.labelExpanded', {
defaultMessage: 'Expanded',
}),
'euiDisplaySelector.labelSingle': i18n.translate('core.euiDisplaySelector.labelSingle', {
defaultMessage: 'Single',
}),
'euiDisplaySelector.labelAuto': i18n.translate('core.euiDisplaySelector.labelAuto', {
defaultMessage: 'Auto',
}),
'euiDisplaySelector.labelCustom': i18n.translate('core.euiDisplaySelector.labelCustom', {
defaultMessage: 'Custom',
}),
'euiDisplaySelector.rowHeightLabel': i18n.translate('core.euiDisplaySelector.rowHeightLabel', {
defaultMessage: 'Row height',
}),
'euiDisplaySelector.lineCountLabel': i18n.translate('core.euiDisplaySelector.lineCountLabel', {
defaultMessage: 'Lines per row',
}),
'euiFieldPassword.showPassword': i18n.translate('core.euiFieldPassword.showPassword', {
defaultMessage:
'Show password as plain text. Note: this will visually expose your password on the screen.',
Expand Down Expand Up @@ -708,32 +755,13 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'hide',
}
),
'euiPagination.nextPage': ({ page }: EuiValues) =>
i18n.translate('core.euiPagination.nextPage', {
defaultMessage: 'Next page, {page}',
values: { page },
}),
'euiPagination.pageOfTotalCompressed': ({ page, total }: EuiValues) => (
<FormattedMessage
id="core.euiPagination.pageOfTotalCompressed"
defaultMessage="{page} of {total}"
values={{ page, total }}
/>
),
'euiPagination.previousPage': ({ page }: EuiValues) =>
i18n.translate('core.euiPagination.previousPage', {
defaultMessage: 'Previous page, {page}',
values: { page },
}),
'euiPagination.disabledPreviousPage': i18n.translate(
'core.euiPagination.disabledPreviousPage',
{
defaultMessage: 'Previous page',
}
),
'euiPagination.disabledNextPage': i18n.translate('core.euiPagination.disabledNextPage', {
defaultMessage: 'Next page',
}),
'euiPagination.firstRangeAriaLabel': ({ lastPage }: EuiValues) =>
i18n.translate('core.euiPagination.firstRangeAriaLabel', {
defaultMessage: 'Skipping pages 2 to {lastPage}',
Expand All @@ -744,6 +772,21 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'Skipping pages {firstPage} to {lastPage}',
values: { firstPage, lastPage },
}),
'euiPagination.last': i18n.translate('core.euiPagination.last', {
defaultMessage: 'Last',
}),
'euiPagination.page': i18n.translate('core.euiPagination.page', {
defaultMessage: 'Page',
}),
'euiPagination.of': i18n.translate('core.euiPagination.of', {
defaultMessage: 'of',
}),
'euiPagination.collection': i18n.translate('core.euiPagination.collection', {
defaultMessage: 'collection',
}),
'euiPagination.fromEndLabel': i18n.translate('core.euiPagination.fromEndLabel', {
defaultMessage: 'from end',
}),
'euiPaginationButton.longPageString': ({ page, totalPages }: EuiValues) =>
i18n.translate('core.euiPaginationButton.longPageString', {
defaultMessage: 'Page {page} of {totalPages}',
Expand All @@ -756,6 +799,24 @@ export const getEuiContextMapping = (): EuiTokensObject => {
values: { page },
description: 'Text to describe the current page of a paginated section',
}),
'euiPaginationButtonArrow.nextPage': i18n.translate('core.euiPaginationButtonArrow.nextPage', {
defaultMessage: 'Next page',
}),
'euiPaginationButtonArrow.previousPage': i18n.translate(
'core.euiPaginationButtonArrow.previousPage',
{
defaultMessage: 'Previous page',
}
),
'euiPaginationButtonArrow.firstPage': i18n.translate(
'core.euiPaginationButtonArrow.firstPage',
{
defaultMessage: 'First page',
}
),
'euiPaginationButtonArrow.lastPage': i18n.translate('core.euiPaginationButtonArrow.lastPage', {
defaultMessage: 'Last page',
}),
'euiPinnableListGroup.pinExtraActionLabel': i18n.translate(
'core.euiPinnableListGroup.pinExtraActionLabel',
{
Expand Down Expand Up @@ -811,20 +872,19 @@ export const getEuiContextMapping = (): EuiTokensObject => {
'euiRecentlyUsed.legend': i18n.translate('core.euiRecentlyUsed.legend', {
defaultMessage: 'Recently used date ranges',
}),
'euiRefreshInterval.fullDescription': ({ optionValue, optionText }: EuiValues) =>
i18n.translate('core.euiRefreshInterval.fullDescription', {
defaultMessage: 'Refresh interval currently set to {optionValue} {optionText}.',
values: { optionValue, optionText },
}),
'euiRefreshInterval.legend': i18n.translate('core.euiRefreshInterval.legend', {
defaultMessage: 'Refresh every',
}),
'euiRefreshInterval.start': i18n.translate('core.euiRefreshInterval.start', {
defaultMessage: 'Start',
}),
'euiRefreshInterval.stop': i18n.translate('core.euiRefreshInterval.stop', {
defaultMessage: 'Stop',
}),
'euiRefreshInterval.fullDescriptionOff': ({ optionValue, optionText }: EuiValues) =>
i18n.translate('core.euiRefreshInterval.fullDescriptionOff', {
defaultMessage: 'Refresh is off, interval set to {optionValue} {optionText}.',
values: { optionValue, optionText },
}),
'euiRefreshInterval.fullDescriptionOn': ({ optionValue, optionText }: EuiValues) =>
i18n.translate('core.euiRefreshInterval.fullDescriptionOn', {
defaultMessage: 'Refresh is on, interval set to {optionValue} {optionText}.',
values: { optionValue, optionText },
}),
'euiRelativeTab.fullDescription': ({ unit }: EuiValues) =>
i18n.translate('core.euiRelativeTab.fullDescription', {
defaultMessage: 'The unit is changeable. Currently set to {unit}.',
Expand Down Expand Up @@ -1028,28 +1088,6 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'Step {number} is loading',
values: { number },
}),
'euiStyleSelector.buttonText': i18n.translate('core.euiStyleSelector.buttonText', {
defaultMessage: 'Density',
}),
'euiStyleSelector.buttonLegend': i18n.translate('core.euiStyleSelector.buttonLegend', {
defaultMessage: 'Select the display density for the data grid',
}),
'euiStyleSelector.labelExpanded': i18n.translate('core.euiStyleSelector.labelExpanded', {
defaultMessage: 'Expanded density',
}),
'euiStyleSelector.labelNormal': i18n.translate('core.euiStyleSelector.labelNormal', {
defaultMessage: 'Normal density',
}),
'euiStyleSelector.labelCompact': i18n.translate('core.euiStyleSelector.labelCompact', {
defaultMessage: 'Compact density',
}),
'euiSuperDatePicker.showDatesButtonLabel': i18n.translate(
'core.euiSuperDatePicker.showDatesButtonLabel',
{
defaultMessage: 'Show dates',
description: 'Displayed in a button that shows date picker',
}
),
'euiSuperSelect.screenReaderAnnouncement': i18n.translate(
'core.euiSuperSelect.screenReaderAnnouncement',
{
Expand Down
7 changes: 4 additions & 3 deletions src/core/public/theme/convert_core_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
* Side Public License, v 1.
*/

import type { EuiThemeSystem, EuiThemeColorMode } from '@elastic/eui';
import { COLOR_MODES_STANDARD } from '@elastic/eui';
import type { EuiThemeSystem, EuiThemeColorModeStandard } from '@elastic/eui';
import type { CoreTheme } from './types';

/** @internal */
export interface EuiTheme {
colorMode: EuiThemeColorMode;
colorMode: EuiThemeColorModeStandard;
euiThemeSystem?: EuiThemeSystem;
}

/** @internal */
export const convertCoreTheme = (coreTheme: CoreTheme): EuiTheme => {
const { darkMode } = coreTheme;
return {
colorMode: darkMode ? 'DARK' : 'LIGHT',
colorMode: darkMode ? COLOR_MODES_STANDARD.dark : COLOR_MODES_STANDARD.light,
Comment on lines 22 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks for that

};
};
3 changes: 2 additions & 1 deletion src/core/public/theme/core_theme_provider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import { act } from 'react-dom/test-utils';
import type { ReactWrapper } from 'enzyme';
import { of, BehaviorSubject } from 'rxjs';
import { useEuiTheme } from '@elastic/eui';
import type { UseEuiTheme } from '@elastic/eui';
import { mountWithIntl } from '@kbn/test/jest';
import { CoreThemeProvider } from './core_theme_provider';
import type { CoreTheme } from './types';

describe('CoreThemeProvider', () => {
let euiTheme: ReturnType<typeof useEuiTheme> | undefined;
let euiTheme: UseEuiTheme | undefined;

beforeEach(() => {
euiTheme = undefined;
Expand Down
20 changes: 16 additions & 4 deletions src/core/public/theme/core_theme_provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import React, { FC, useMemo } from 'react';
import { Observable } from 'rxjs';
import useObservable from 'react-use/lib/useObservable';
import { EuiThemeProvider } from '@elastic/eui';
import createCache from '@emotion/cache';
import { EuiProvider } from '@elastic/eui';
import { EUI_STYLES_GLOBAL } from '../../utils';
import { CoreTheme } from './types';
import { convertCoreTheme } from './convert_core_theme';

Expand All @@ -21,16 +23,26 @@ interface CoreThemeProviderProps {
theme$: Observable<CoreTheme>;
}

const emotionCache = createCache({
key: 'eui-styles',
container: document.querySelector(`meta[name="${EUI_STYLES_GLOBAL}"]`) as HTMLElement,
});
Comment on lines +26 to +29
Copy link
Contributor

@pgayvallet pgayvallet Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, shouldn't this also be used in the public version of the EuiProvider wrapper in src/plugins/kibana_react/public/theme/kibana_theme_provider.tsx ? (same for modify)

If that's the case, we'll have to expose this cache from core somehow, so that both version of the wrapper use the same cache instance?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the top-level theme provider needs the cache because it's the only provider that now also provides global styles. Those global styles only need to be included once and are the only styles that require the cache. Eventually, once EUI has converted all components to Emotion, the global style cache will be unnecessary and can be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, Just to be sure we're on the same page, this CoreThemeProvider component is not used only once.

It is used as a 'top level' provider for chrome's react tree, but is also used for internal core's components, such as toasts, flyout and modal, as all those components are their own distinct react tree / ReactDOM.render call.

Is it still fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is fine, thanks for clarifying. My main point was that a nested KibanaThemeProvider does not need to be aware of the cache.

I'll probably have a follow-up PR that ensures no duplication of the global styles from the various toasts, flyout and modal, etc. instances, but there will be no adverse affects in the meantime.


/**
* Wrapper around `EuiThemeProvider` converting (and exposing) core's theme to EUI theme.
* Wrapper around `EuiProvider` converting (and exposing) core's theme to EUI theme.
* @internal Only meant to be used within core for internal usages of EUI/React
*/
export const CoreThemeProvider: FC<CoreThemeProviderProps> = ({ theme$, children }) => {
const coreTheme = useObservable(theme$, defaultTheme);
const euiTheme = useMemo(() => convertCoreTheme(coreTheme), [coreTheme]);
return (
<EuiThemeProvider colorMode={euiTheme.colorMode} theme={euiTheme.euiThemeSystem}>
<EuiProvider
modify={{ LIGHT: { colors: { primary: '#FF0000' } } }}
Copy link
Contributor

@pgayvallet pgayvallet Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think declaring a const for this modify value outside of the component is slightly better for memory and rerendering triggers as it would not be recreated at each rerendering + only one instance will be used for all usages of CoreThemeProvider

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for flagging this. This was meant entirely to test the setup and will be removed before merging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will want to expand the API to pass modify to KibanaThemeProvider, but I don't see that as an immediate need.

colorMode={euiTheme.colorMode}
theme={euiTheme.euiThemeSystem}
cache={emotionCache}
>
{children}
</EuiThemeProvider>
</EuiProvider>
);
};
3 changes: 3 additions & 0 deletions src/core/server/rendering/views/template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import React, { FunctionComponent, createElement } from 'react';

import { EUI_STYLES_GLOBAL } from '../../../utils';
import { RenderingMetadata } from '../types';
import { Fonts } from './fonts';
import { Styles } from './styles';
Expand Down Expand Up @@ -42,6 +43,8 @@ export const Template: FunctionComponent<Props> = ({
<link rel="icon" type="image/svg+xml" href={`${uiPublicUrl}/favicons/favicon.svg`} />
<meta name="theme-color" content="#ffffff" />
<meta name="color-scheme" content="light dark" />
{/* Inject EUI reset and global styles before all other component styles */}
<meta name={EUI_STYLES_GLOBAL} />
<Styles darkMode={darkMode} stylesheetPaths={stylesheetPaths} />

{/* Inject stylesheets into the <head> before scripts so that KP plugins with bundled styles will override them */}
Expand Down
1 change: 1 addition & 0 deletions src/core/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

export { DEFAULT_APP_CATEGORIES } from './default_app_categories';
export { APP_WRAPPER_CLASS } from './app_wrapper_class';
export { EUI_STYLES_GLOBAL } from './meta';
9 changes: 9 additions & 0 deletions src/core/utils/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export const EUI_STYLES_GLOBAL = 'eui-styles-global';
2 changes: 1 addition & 1 deletion src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ export const LICENSE_OVERRIDES = {
'[email protected]': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts
'@mapbox/[email protected]': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'@elastic/[email protected]': ['Elastic License 2.0'],
'@elastic/eui@41.2.3': ['SSPL-1.0 OR Elastic License 2.0'],
'@elastic/eui@43.0.0': ['SSPL-1.0 OR Elastic License 2.0'],
'[email protected]': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry
};
Loading