diff --git a/STYLEGUIDE.mdx b/STYLEGUIDE.mdx index 13d8e1b96b3d7..64278c56ffda5 100644 --- a/STYLEGUIDE.mdx +++ b/STYLEGUIDE.mdx @@ -623,7 +623,7 @@ by your code until the circular dependencies on these have been solved. When writing a new component, create a sibling SASS file of the same name and import directly into the **top** of the JS/TS component file. Doing so ensures the styles are never separated or lost on import and allows for better modularization (smaller individual plugin asset footprint). -All SASS (.scss) files will automatically build with the [EUI](https://elastic.github.io/eui/#/guidelines/sass) & Kibana invisibles (SASS variables, mixins, functions) from the [`globals_[theme].scss` file](src/core/public/core_app/styles/_globals_v7light.scss). +All SASS (.scss) files will automatically build with the [EUI](https://elastic.github.io/eui/#/guidelines/sass) & Kibana invisibles (SASS variables, mixins, functions) from the [`globals_[theme].scss` file](src/core/public/core_app/styles/_globals_v8light.scss). While the styles for this component will only be loaded if the component exists on the page, the styles **will** be global and so it is recommended to use a three letter prefix on your diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index f2da704760f3b..56b7eb09252ed 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -189,7 +189,7 @@ Set to `true` to enable a dark mode for the {kib} UI. You must refresh the page to apply the setting. [[theme-version]]`theme:version`:: -Specifies the {kib} theme. If you change the setting, refresh the page to apply the setting. +Kibana only ships with the v8 theme now, so this setting can no longer be edited. [[timepicker-quickranges]]`timepicker:quickRanges`:: The list of ranges to show in the Quick section of the time filter. This should diff --git a/packages/kbn-optimizer/README.md b/packages/kbn-optimizer/README.md index 3fdf915e84c21..337b729edf440 100644 --- a/packages/kbn-optimizer/README.md +++ b/packages/kbn-optimizer/README.md @@ -44,19 +44,16 @@ Any import in a bundle which resolves into another bundles "context" directory, ## Themes -SASS imports in bundles are automatically converted to CSS for one or more themes. In development we build the `v7light` and `v7dark` themes by default to improve build performance. When producing distributable bundles the default shifts to `*` so that the distributable bundles will include all themes, preventing the bundles from needing to be rebuilt when users change the active theme in Kibana's advanced settings. +SASS imports in bundles are automatically converted to CSS for one or more themes. In development we build the `v8light` and `v8dark` themes by default to improve build performance. When producing distributable bundles the default shifts to `*` so that the distributable bundles will include all themes, preventing the bundles from needing to be rebuilt when users change the active theme in Kibana's advanced settings. To customize the themes that are built for development you can specify the `KBN_OPTIMIZER_THEMES` environment variable to one or more theme tags, or use `*` to build styles for all themes. Unfortunately building more than one theme significantly impacts build performance, so try to be strategic about which themes you build. -Currently supported theme tags: `v7light`, `v7dark`, `v8light`, `v8dark` +Currently supported theme tags: `v8light`, `v8dark` Examples: ```sh # start Kibana with only a single theme -KBN_OPTIMIZER_THEMES=v7light yarn start - -# start Kibana with dark themes for version 7 and 8 -KBN_OPTIMIZER_THEMES=v7dark,v8dark yarn start +KBN_OPTIMIZER_THEMES=v8light yarn start # start Kibana with all the themes KBN_OPTIMIZER_THEMES=* yarn start diff --git a/packages/kbn-optimizer/src/common/theme_tags.test.ts b/packages/kbn-optimizer/src/common/theme_tags.test.ts index 126d1b1833873..bbc7f2831e83f 100644 --- a/packages/kbn-optimizer/src/common/theme_tags.test.ts +++ b/packages/kbn-optimizer/src/common/theme_tags.test.ts @@ -20,8 +20,6 @@ it('returns default tags when passed undefined', () => { it('returns all tags when passed *', () => { expect(parseThemeTags('*')).toMatchInlineSnapshot(` Array [ - "v7dark", - "v7light", "v8dark", "v8light", ] @@ -37,38 +35,37 @@ it('returns specific tag when passed a single value', () => { }); it('returns specific tags when passed a comma separated list', () => { - expect(parseThemeTags('v8light, v7dark,v7light')).toMatchInlineSnapshot(` + expect(parseThemeTags('v8light,v8dark')).toMatchInlineSnapshot(` Array [ - "v7dark", - "v7light", + "v8dark", "v8light", ] `); }); it('returns specific tags when passed an array', () => { - expect(parseThemeTags(['v8light', 'v7light'])).toMatchInlineSnapshot(` + expect(parseThemeTags(['v8light', 'v8dark'])).toMatchInlineSnapshot(` Array [ - "v7light", + "v8dark", "v8light", ] `); }); it('throws when an invalid tag is in the array', () => { - expect(() => parseThemeTags(['v8light', 'v7light', 'bar'])).toThrowErrorMatchingInlineSnapshot( - `"Invalid theme tags [bar], options: [v7dark, v7light, v8dark, v8light]"` + expect(() => parseThemeTags(['v8light', 'v7light'])).toThrowErrorMatchingInlineSnapshot( + `"Invalid theme tags [v7light], options: [v8dark, v8light]"` ); }); it('throws when an invalid tags in comma separated list', () => { - expect(() => parseThemeTags('v8light ,v7light,bar,box ')).toThrowErrorMatchingInlineSnapshot( - `"Invalid theme tags [bar, box], options: [v7dark, v7light, v8dark, v8light]"` + expect(() => parseThemeTags('v8light ,v7light')).toThrowErrorMatchingInlineSnapshot( + `"Invalid theme tags [v7light], options: [v8dark, v8light]"` ); }); it('returns tags in alphabetical order', () => { - const tags = parseThemeTags(['v7light', 'v8light']); + const tags = parseThemeTags(['v8dark', 'v8light']); expect(tags).toEqual(tags.slice().sort((a, b) => a.localeCompare(b))); }); diff --git a/packages/kbn-optimizer/src/common/theme_tags.ts b/packages/kbn-optimizer/src/common/theme_tags.ts index de95bbdcbcfea..15366c1d0fbba 100644 --- a/packages/kbn-optimizer/src/common/theme_tags.ts +++ b/packages/kbn-optimizer/src/common/theme_tags.ts @@ -16,9 +16,9 @@ const isArrayOfStrings = (input: unknown): input is string[] => Array.isArray(input) && input.every((v) => typeof v === 'string'); export type ThemeTags = readonly ThemeTag[]; -export type ThemeTag = 'v7light' | 'v7dark' | 'v8light' | 'v8dark'; +export type ThemeTag = 'v8light' | 'v8dark'; export const DEFAULT_THEMES = tags('v8light', 'v8dark'); -export const ALL_THEMES = tags('v7light', 'v7dark', 'v8light', 'v8dark'); +export const ALL_THEMES = tags('v8light', 'v8dark'); export function parseThemeTags(input?: any): ThemeTags { if (!input) { diff --git a/packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap b/packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap index 8067ee2ce6c0b..3ca65769a18e1 100644 --- a/packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap +++ b/packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap @@ -156,7 +156,7 @@ OptimizerConfig { } `; -exports[`prepares assets for distribution: bar bundle 1`] = `"!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&n&&\\"string\\"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\\"a\\",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p=\\"\\",t(t.s=3)}([function(e,n,t){\\"use strict\\";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(n){if(void 0===e[n]){var t=document.querySelector(n);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[n]=t}return e[n]}}(),a=[];function c(e){for(var n=-1,t=0;t (tag.includes('v7') ? 7 : 8); +const getVersion = (tag: ThemeTag) => 8; const getIsDark = (tag: ThemeTag) => tag.includes('dark'); const compare = (a: ThemeTag, b: ThemeTag) => (getVersion(a) === getVersion(b) ? 1 : 0) + (getIsDark(a) === getIsDark(b) ? 1 : 0); diff --git a/packages/kbn-storybook/src/lib/theme_switcher.tsx b/packages/kbn-storybook/src/lib/theme_switcher.tsx index 24ddec1fdf51c..fd3e36b4cc306 100644 --- a/packages/kbn-storybook/src/lib/theme_switcher.tsx +++ b/packages/kbn-storybook/src/lib/theme_switcher.tsx @@ -25,14 +25,12 @@ export function ThemeSwitcher() { const links: Link[] = [ { id: 'v8.light', - title: 'Amsterdam: Light', + title: 'Light', }, { id: 'v8.dark', - title: 'Amsterdam: Dark', + title: 'Dark', }, - { id: 'v7.light', title: 'Light' }, - { id: 'v7.dark', title: 'Dark' }, ].map((link) => ({ ...link, onClick: (_event, item) => { diff --git a/packages/kbn-storybook/src/webpack.config.ts b/packages/kbn-storybook/src/webpack.config.ts index f77207b803355..27e887eda65ce 100644 --- a/packages/kbn-storybook/src/webpack.config.ts +++ b/packages/kbn-storybook/src/webpack.config.ts @@ -58,7 +58,7 @@ export default function ({ config: storybookConfig }: { config: Configuration }) additionalData(content: string, loaderContext: any) { return `@import ${stringifyRequest( loaderContext, - resolve(REPO_ROOT, 'src/core/public/core_app/styles/_globals_v7light.scss') + resolve(REPO_ROOT, 'src/core/public/core_app/styles/_globals_v8light.scss') )};\n${content}`; }, implementation: require('node-sass'), diff --git a/packages/kbn-ui-shared-deps-npm/src/index.js b/packages/kbn-ui-shared-deps-npm/src/index.js index 435371049e46b..678e7c845e6a5 100644 --- a/packages/kbn-ui-shared-deps-npm/src/index.js +++ b/packages/kbn-ui-shared-deps-npm/src/index.js @@ -6,6 +6,10 @@ * Side Public License, v 1. */ +/** + * @typedef {'v8'} ThemeVersion + */ + const Path = require('path'); /** @@ -25,23 +29,27 @@ exports.dllFilename = 'kbn-ui-shared-deps-npm.dll.js'; /** * Filename of the light-theme css file in the distributable directory + * @param {ThemeVersion} themeVersion */ -exports.lightCssDistFilename = 'kbn-ui-shared-deps-npm.v7.light.css'; +exports.lightCssDistFilename = (themeVersion) => { + if (themeVersion !== 'v8') { + throw new Error(`unsupported theme version [${themeVersion}]`); + } -/** - * Filename of the light-theme css file in the distributable directory - */ -exports.lightV8CssDistFilename = 'kbn-ui-shared-deps-npm.v8.light.css'; + return 'kbn-ui-shared-deps-npm.v8.light.css'; +}; /** * Filename of the dark-theme css file in the distributable directory + * @param {ThemeVersion} themeVersion */ -exports.darkCssDistFilename = 'kbn-ui-shared-deps-npm.v7.dark.css'; +exports.darkCssDistFilename = (themeVersion) => { + if (themeVersion !== 'v8') { + throw new Error(`unsupported theme version [${themeVersion}]`); + } -/** - * Filename of the dark-theme css file in the distributable directory - */ -exports.darkV8CssDistFilename = 'kbn-ui-shared-deps-npm.v8.dark.css'; + return 'kbn-ui-shared-deps-npm.v8.dark.css'; +}; /** * Webpack loader for configuring the public path lookup from `window.__kbnPublicPath__`. diff --git a/packages/kbn-ui-shared-deps-npm/webpack.config.js b/packages/kbn-ui-shared-deps-npm/webpack.config.js index 6b572dc3ea208..fab4eac1403ca 100644 --- a/packages/kbn-ui-shared-deps-npm/webpack.config.js +++ b/packages/kbn-ui-shared-deps-npm/webpack.config.js @@ -44,8 +44,6 @@ module.exports = (_, argv) => { '@elastic/eui/dist/eui_charts_theme', '@elastic/eui/lib/services', '@elastic/eui/lib/services/format', - '@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', '@elastic/numeral', @@ -71,8 +69,6 @@ module.exports = (_, argv) => { 'styled-components', 'tslib', ], - 'kbn-ui-shared-deps-npm.v7.dark': ['@elastic/eui/dist/eui_theme_dark.css'], - 'kbn-ui-shared-deps-npm.v7.light': ['@elastic/eui/dist/eui_theme_light.css'], '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'], }, diff --git a/packages/kbn-ui-shared-deps-src/src/theme.ts b/packages/kbn-ui-shared-deps-src/src/theme.ts index 05c2210042ac6..f058913cdeeab 100644 --- a/packages/kbn-ui-shared-deps-src/src/theme.ts +++ b/packages/kbn-ui-shared-deps-src/src/theme.ts @@ -6,30 +6,21 @@ * Side Public License, v 1. */ -import { default as v7Light } from '@elastic/eui/dist/eui_theme_light.json'; -import { default as v7Dark } from '@elastic/eui/dist/eui_theme_dark.json'; import { default as v8Light } from '@elastic/eui/dist/eui_theme_amsterdam_light.json'; import { default as v8Dark } from '@elastic/eui/dist/eui_theme_amsterdam_dark.json'; const globals: any = typeof window === 'undefined' ? {} : window; -export type Theme = typeof v7Light | typeof v8Light; +export type Theme = typeof v8Light; // in the Kibana app we can rely on this global being defined, but in // some cases (like jest) the global is undefined -export const tag: string = globals.__kbnThemeTag__ || 'v7light'; -export const version = tag.startsWith('v7') ? 7 : 8; +export const tag: string = globals.__kbnThemeTag__ || 'v8light'; +export const version = 8; export const darkMode = tag.endsWith('dark'); -export let euiLightVars: Theme; -export let euiDarkVars: Theme; -if (version === 7) { - euiLightVars = v7Light; - euiDarkVars = v7Dark; -} else { - euiLightVars = v8Light; - euiDarkVars = v8Dark; -} +export const euiLightVars: Theme = v8Light; +export const euiDarkVars: Theme = v8Dark; /** * EUI Theme vars that automatically adjust to light/dark theme diff --git a/src/core/public/core_app/styles/_globals_v7dark.scss b/src/core/public/core_app/styles/_globals_v7dark.scss deleted file mode 100644 index 9341601089737..0000000000000 --- a/src/core/public/core_app/styles/_globals_v7dark.scss +++ /dev/null @@ -1,10 +0,0 @@ -// v7dark global scope -// -// prepended to all .scss imports (from JS, when v7dark theme selected) - -@import '@elastic/eui/src/themes/eui/eui_colors_dark'; -@import '@elastic/eui/src/themes/eui/eui_globals'; - -@import './mixins'; - -$kbnThemeVersion: 'v7dark'; diff --git a/src/core/public/core_app/styles/_globals_v7light.scss b/src/core/public/core_app/styles/_globals_v7light.scss deleted file mode 100644 index e1ff6ec70aab5..0000000000000 --- a/src/core/public/core_app/styles/_globals_v7light.scss +++ /dev/null @@ -1,10 +0,0 @@ -// v7light global scope -// -// prepended to all .scss imports (from JS, when v7light theme selected) - -@import '@elastic/eui/src/themes/eui/eui_colors_light'; -@import '@elastic/eui/src/themes/eui/eui_globals'; - -@import './mixins'; - -$kbnThemeVersion: 'v7light'; diff --git a/src/core/public/core_app/styles/_mixins.scss b/src/core/public/core_app/styles/_mixins.scss index b2adbdb691bb6..d088a47144f33 100644 --- a/src/core/public/core_app/styles/_mixins.scss +++ b/src/core/public/core_app/styles/_mixins.scss @@ -120,31 +120,3 @@ } } } - -@mixin kbnThemeStyle($theme, $mode: 'both') { - $themes: 'v7', 'v8'; - @if (index($themes, $theme)) { - @if ($mode == 'both') { - $themeLight: $theme + 'light'; - $themeDark: $theme + 'dark'; - // $kbnThemeVersion comes from the active theme's globals file (e.g. _globals_v8light.scss) - @if ($kbnThemeVersion == $themeLight or $kbnThemeVersion == $themeDark) { - @content; - } - } @else if ($mode == 'light') { - $themeLight: $theme + 'light'; - @if ($kbnThemeVersion == $themeLight) { - @content; - } - } @else if ($mode == 'dark') { - $themeDark: $theme + 'dark'; - @if ($kbnThemeVersion == $themeDark) { - @content; - } - } @else { - @warn 'The second parameter must be a valid mode (light, dark, or both) -- got #{$mode}'; - } - } @else { - @warn 'Invalid $theme. Valid options are: #{$themes}. Got #{$theme} instead'; - } -} diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Black.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Black.woff deleted file mode 100644 index 908f1912ba552..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Black.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Black.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Black.woff2 deleted file mode 100644 index bd14f008977ef..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Black.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BlackItalic.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BlackItalic.woff deleted file mode 100644 index cab336ca9ae9d..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BlackItalic.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BlackItalic.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BlackItalic.woff2 deleted file mode 100644 index 1740872acb112..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BlackItalic.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Bold.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Bold.woff deleted file mode 100644 index c4d9824070d68..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Bold.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Bold.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Bold.woff2 deleted file mode 100644 index 70e5f00662461..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Bold.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BoldItalic.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BoldItalic.woff deleted file mode 100644 index 94aeeee923a44..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BoldItalic.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BoldItalic.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BoldItalic.woff2 deleted file mode 100644 index 18ed561d025bf..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-BoldItalic.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBold.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBold.woff deleted file mode 100644 index 6f50a9ee83471..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBold.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBold.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBold.woff2 deleted file mode 100644 index 4c9e0b718d94f..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBold.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBoldItalic.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBoldItalic.woff deleted file mode 100644 index ede913914485a..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBoldItalic.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBoldItalic.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBoldItalic.woff2 deleted file mode 100644 index af7822f92a0b0..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraBoldItalic.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLight-BETA.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLight-BETA.woff deleted file mode 100644 index dc7eefc252506..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLight-BETA.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLight-BETA.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLight-BETA.woff2 deleted file mode 100644 index 5508e70a63846..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLight-BETA.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLightItalic-BETA.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLightItalic-BETA.woff deleted file mode 100644 index 37c434af76526..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLightItalic-BETA.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLightItalic-BETA.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLightItalic-BETA.woff2 deleted file mode 100644 index 6dcfeac7b4fe8..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ExtraLightItalic-BETA.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Italic.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Italic.woff deleted file mode 100644 index 4932f1e26e1af..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Italic.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Italic.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Italic.woff2 deleted file mode 100644 index dbbd89279287e..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Italic.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Light-BETA.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Light-BETA.woff deleted file mode 100644 index 56c3defcde214..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Light-BETA.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Light-BETA.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Light-BETA.woff2 deleted file mode 100644 index f23481625b23b..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Light-BETA.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-LightItalic-BETA.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-LightItalic-BETA.woff deleted file mode 100644 index 94ceeda8f5313..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-LightItalic-BETA.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-LightItalic-BETA.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-LightItalic-BETA.woff2 deleted file mode 100644 index a99ed19507a6c..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-LightItalic-BETA.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Medium.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Medium.woff deleted file mode 100644 index d18a8170133a3..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Medium.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Medium.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Medium.woff2 deleted file mode 100644 index 3896022f3d1ea..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Medium.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-MediumItalic.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-MediumItalic.woff deleted file mode 100644 index 863ddc75a4e62..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-MediumItalic.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-MediumItalic.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-MediumItalic.woff2 deleted file mode 100644 index b9e43541e4fa6..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-MediumItalic.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Regular.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Regular.woff deleted file mode 100644 index aef2367d7fd47..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Regular.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Regular.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Regular.woff2 deleted file mode 100644 index e75fb707b9d37..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Regular.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBold.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBold.woff deleted file mode 100644 index 27e3d0b568c10..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBold.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBold.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBold.woff2 deleted file mode 100644 index f21699d9ff0f8..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBold.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBoldItalic.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBoldItalic.woff deleted file mode 100644 index 3859942772a90..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBoldItalic.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBoldItalic.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBoldItalic.woff2 deleted file mode 100644 index 7b556d72d3b70..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-SemiBoldItalic.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Thin-BETA.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Thin-BETA.woff deleted file mode 100644 index 296e229b0778e..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Thin-BETA.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Thin-BETA.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Thin-BETA.woff2 deleted file mode 100644 index eba73d06fd399..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-Thin-BETA.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ThinItalic-BETA.woff b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ThinItalic-BETA.woff deleted file mode 100644 index aae25d7b57aa1..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ThinItalic-BETA.woff and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ThinItalic-BETA.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ThinItalic-BETA.woff2 deleted file mode 100644 index df5e5f86f5304..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-ThinItalic-BETA.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-italic.var.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-italic.var.woff2 deleted file mode 100644 index 7aff5c010865b..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-italic.var.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-upright.var.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-upright.var.woff2 deleted file mode 100644 index 16b6adaa660a9..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI-upright.var.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI.var.woff2 b/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI.var.woff2 deleted file mode 100644 index 132600df3a278..0000000000000 Binary files a/src/core/server/core_app/assets/fonts/inter_ui/Inter-UI.var.woff2 and /dev/null differ diff --git a/src/core/server/core_app/assets/fonts/inter_ui/LICENSE.txt b/src/core/server/core_app/assets/fonts/inter_ui/LICENSE.txt deleted file mode 100644 index da64fc78e7e8a..0000000000000 --- a/src/core/server/core_app/assets/fonts/inter_ui/LICENSE.txt +++ /dev/null @@ -1,92 +0,0 @@ -Copyright (c) 2016-2018 The Inter UI Project Authors (me@rsms.me) - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION AND CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/src/core/server/rendering/bootstrap/__snapshots__/render_template.test.ts.snap b/src/core/server/rendering/bootstrap/__snapshots__/render_template.test.ts.snap index fde12088b7735..83aacda2b599a 100644 --- a/src/core/server/rendering/bootstrap/__snapshots__/render_template.test.ts.snap +++ b/src/core/server/rendering/bootstrap/__snapshots__/render_template.test.ts.snap @@ -33,7 +33,7 @@ function kbnBundlesLoader() { var kbnCsp = JSON.parse(document.querySelector('kbn-csp').getAttribute('data')); window.__kbnStrictCsp__ = kbnCsp.strictCsp; -window.__kbnThemeTag__ = \\"v7\\"; +window.__kbnThemeTag__ = \\"v8light\\"; window.__kbnPublicPath__ = {\\"foo\\": \\"bar\\"}; window.__kbnBundles__ = kbnBundlesLoader(); diff --git a/src/core/server/rendering/bootstrap/bootstrap_renderer.test.ts b/src/core/server/rendering/bootstrap/bootstrap_renderer.test.ts index 36551def5eef0..efa47d810c273 100644 --- a/src/core/server/rendering/bootstrap/bootstrap_renderer.test.ts +++ b/src/core/server/rendering/bootstrap/bootstrap_renderer.test.ts @@ -85,15 +85,12 @@ describe('bootstrapRenderer', () => { uiSettingsClient, }); - expect(uiSettingsClient.get).toHaveBeenCalledTimes(2); + expect(uiSettingsClient.get).toHaveBeenCalledTimes(1); expect(uiSettingsClient.get).toHaveBeenCalledWith('theme:darkMode'); - expect(uiSettingsClient.get).toHaveBeenCalledWith('theme:version'); }); it('calls getThemeTag with the correct parameters', async () => { - uiSettingsClient.get.mockImplementation((settingName) => { - return Promise.resolve(settingName === 'theme:darkMode' ? true : 'v8'); - }); + uiSettingsClient.get.mockResolvedValue(true); const request = httpServerMock.createKibanaRequest(); @@ -126,15 +123,12 @@ describe('bootstrapRenderer', () => { uiSettingsClient, }); - expect(uiSettingsClient.get).toHaveBeenCalledTimes(2); + expect(uiSettingsClient.get).toHaveBeenCalledTimes(1); expect(uiSettingsClient.get).toHaveBeenCalledWith('theme:darkMode'); - expect(uiSettingsClient.get).toHaveBeenCalledWith('theme:version'); }); it('calls getThemeTag with the correct parameters', async () => { - uiSettingsClient.get.mockImplementation((settingName) => { - return Promise.resolve(settingName === 'theme:darkMode' ? true : 'v8'); - }); + uiSettingsClient.get.mockResolvedValue(true); const request = httpServerMock.createKibanaRequest(); diff --git a/src/core/server/rendering/bootstrap/bootstrap_renderer.ts b/src/core/server/rendering/bootstrap/bootstrap_renderer.ts index c1268d49d2b7d..fb4db50e2e34c 100644 --- a/src/core/server/rendering/bootstrap/bootstrap_renderer.ts +++ b/src/core/server/rendering/bootstrap/bootstrap_renderer.ts @@ -8,6 +8,7 @@ import { createHash } from 'crypto'; import { PackageInfo } from '@kbn/config'; +import { ThemeVersion } from '@kbn/ui-shared-deps-npm'; import { UiPlugins } from '../../plugins'; import { IUiSettingsClient } from '../../ui_settings'; import { HttpAuth, KibanaRequest } from '../../http'; @@ -50,12 +51,11 @@ export const bootstrapRendererFactory: BootstrapRendererFactory = ({ return async function bootstrapRenderer({ uiSettingsClient, request }) { let darkMode = false; - let themeVersion = 'v8'; + const themeVersion: ThemeVersion = 'v8'; try { const authenticated = isAuthenticated(request); darkMode = authenticated ? await uiSettingsClient.get('theme:darkMode') : false; - themeVersion = authenticated ? await uiSettingsClient.get('theme:version') : 'v8'; } catch (e) { // just use the default values in case of connectivity issues with ES } diff --git a/src/core/server/rendering/bootstrap/get_theme_tag.test.ts b/src/core/server/rendering/bootstrap/get_theme_tag.test.ts index 6fe56d425c13d..3bc782707f5ad 100644 --- a/src/core/server/rendering/bootstrap/get_theme_tag.test.ts +++ b/src/core/server/rendering/bootstrap/get_theme_tag.test.ts @@ -9,22 +9,6 @@ import { getThemeTag } from './get_theme_tag'; describe('getThemeTag', () => { - it('returns the correct value for version:v7 and darkMode:false', () => { - expect( - getThemeTag({ - themeVersion: 'v7', - darkMode: false, - }) - ).toEqual('v7light'); - }); - it('returns the correct value for version:v7 and darkMode:true', () => { - expect( - getThemeTag({ - themeVersion: 'v7', - darkMode: true, - }) - ).toEqual('v7dark'); - }); it('returns the correct value for version:v8 and darkMode:false', () => { expect( getThemeTag({ diff --git a/src/core/server/rendering/bootstrap/get_theme_tag.ts b/src/core/server/rendering/bootstrap/get_theme_tag.ts index f722de6f971f3..058e5dd9e1c1a 100644 --- a/src/core/server/rendering/bootstrap/get_theme_tag.ts +++ b/src/core/server/rendering/bootstrap/get_theme_tag.ts @@ -6,6 +6,8 @@ * Side Public License, v 1. */ +import type { ThemeVersion } from '@kbn/ui-shared-deps-npm'; + /** * Computes the themeTag that will be used on the client-side as `__kbnThemeTag__` * @see `packages/kbn-ui-shared-deps-src/theme.ts` @@ -14,8 +16,8 @@ export const getThemeTag = ({ themeVersion, darkMode, }: { - themeVersion: string; + themeVersion: ThemeVersion; darkMode: boolean; }) => { - return `${themeVersion === 'v7' ? 'v7' : 'v8'}${darkMode ? 'dark' : 'light'}`; + return `${themeVersion}${darkMode ? 'dark' : 'light'}`; }; diff --git a/src/core/server/rendering/bootstrap/render_template.test.ts b/src/core/server/rendering/bootstrap/render_template.test.ts index b061e8c31065c..7aeee9c9c075b 100644 --- a/src/core/server/rendering/bootstrap/render_template.test.ts +++ b/src/core/server/rendering/bootstrap/render_template.test.ts @@ -10,7 +10,7 @@ import { renderTemplate } from './render_template'; function mockParams() { return { - themeTag: 'v7', + themeTag: 'v8light', jsDependencyPaths: ['/js-1', '/js-2'], styleSheetPaths: ['/style-1', '/style-2'], publicPathMap: '{"foo": "bar"}', diff --git a/src/core/server/rendering/render_utils.test.ts b/src/core/server/rendering/render_utils.test.ts index 1eb7db5edd8df..c8ebd6de4f854 100644 --- a/src/core/server/rendering/render_utils.test.ts +++ b/src/core/server/rendering/render_utils.test.ts @@ -10,25 +10,6 @@ import { getStylesheetPaths } from './render_utils'; describe('getStylesheetPaths', () => { describe('when darkMode is `true`', () => { - describe('when themeVersion is `v7`', () => { - it('returns the correct list', () => { - expect( - getStylesheetPaths({ - darkMode: true, - themeVersion: 'v7', - basePath: '/base-path', - buildNum: 9000, - }) - ).toMatchInlineSnapshot(` - Array [ - "/base-path/9000/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.v7.dark.css", - "/base-path/9000/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.css", - "/base-path/node_modules/@kbn/ui-framework/dist/kui_dark.css", - "/base-path/ui/legacy_dark_theme.css", - ] - `); - }); - }); describe('when themeVersion is `v8`', () => { it('returns the correct list', () => { expect( @@ -50,25 +31,6 @@ describe('getStylesheetPaths', () => { }); }); describe('when darkMode is `false`', () => { - describe('when themeVersion is `v7`', () => { - it('returns the correct list', () => { - expect( - getStylesheetPaths({ - darkMode: false, - themeVersion: 'v7', - basePath: '/base-path', - buildNum: 42, - }) - ).toMatchInlineSnapshot(` - Array [ - "/base-path/42/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.v7.light.css", - "/base-path/42/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.css", - "/base-path/node_modules/@kbn/ui-framework/dist/kui_light.css", - "/base-path/ui/legacy_light_theme.css", - ] - `); - }); - }); describe('when themeVersion is `v8`', () => { it('returns the correct list', () => { expect( diff --git a/src/core/server/rendering/render_utils.ts b/src/core/server/rendering/render_utils.ts index c3d27a1aa25fe..65cedda7ad489 100644 --- a/src/core/server/rendering/render_utils.ts +++ b/src/core/server/rendering/render_utils.ts @@ -28,7 +28,7 @@ export const getStylesheetPaths = ({ basePath, buildNum, }: { - themeVersion: string; + themeVersion: UiSharedDepsNpm.ThemeVersion; darkMode: boolean; buildNum: number; basePath: string; @@ -37,17 +37,17 @@ export const getStylesheetPaths = ({ return [ ...(darkMode ? [ - themeVersion === 'v7' - ? `${regularBundlePath}/kbn-ui-shared-deps-npm/${UiSharedDepsNpm.darkCssDistFilename}` - : `${regularBundlePath}/kbn-ui-shared-deps-npm/${UiSharedDepsNpm.darkV8CssDistFilename}`, + `${regularBundlePath}/kbn-ui-shared-deps-npm/${UiSharedDepsNpm.darkCssDistFilename( + themeVersion + )}`, `${regularBundlePath}/kbn-ui-shared-deps-src/${UiSharedDepsSrc.cssDistFilename}`, `${basePath}/node_modules/@kbn/ui-framework/dist/kui_dark.css`, `${basePath}/ui/legacy_dark_theme.css`, ] : [ - themeVersion === 'v7' - ? `${regularBundlePath}/kbn-ui-shared-deps-npm/${UiSharedDepsNpm.lightCssDistFilename}` - : `${regularBundlePath}/kbn-ui-shared-deps-npm/${UiSharedDepsNpm.lightV8CssDistFilename}`, + `${regularBundlePath}/kbn-ui-shared-deps-npm/${UiSharedDepsNpm.lightCssDistFilename( + themeVersion + )}`, `${regularBundlePath}/kbn-ui-shared-deps-src/${UiSharedDepsSrc.cssDistFilename}`, `${basePath}/node_modules/@kbn/ui-framework/dist/kui_light.css`, `${basePath}/ui/legacy_light_theme.css`, diff --git a/src/core/server/rendering/rendering_service.test.ts b/src/core/server/rendering/rendering_service.test.ts index f75d405fe8bf9..c989e75285077 100644 --- a/src/core/server/rendering/rendering_service.test.ts +++ b/src/core/server/rendering/rendering_service.test.ts @@ -112,9 +112,6 @@ function renderTestCases( if (settingName === 'theme:darkMode') { return true; } - if (settingName === 'theme:version') { - return 'v8'; - } return settingName; }); diff --git a/src/core/server/rendering/rendering_service.tsx b/src/core/server/rendering/rendering_service.tsx index f8b99686ff557..b1c6971d3c42b 100644 --- a/src/core/server/rendering/rendering_service.tsx +++ b/src/core/server/rendering/rendering_service.tsx @@ -10,6 +10,7 @@ import React from 'react'; import { renderToStaticMarkup } from 'react-dom/server'; import { take } from 'rxjs/operators'; import { i18n } from '@kbn/i18n'; +import type { ThemeVersion } from '@kbn/ui-shared-deps-npm'; import { UiPlugins } from '../plugins'; import { CoreContext } from '../core_context'; @@ -93,7 +94,7 @@ export class RenderingService { }; const darkMode = getSettingValue('theme:darkMode', settings, Boolean); - const themeVersion = getSettingValue('theme:version', settings, String); + const themeVersion: ThemeVersion = 'v8'; const stylesheetPaths = getStylesheetPaths({ darkMode, @@ -109,8 +110,8 @@ export class RenderingService { i18n: i18n.translate, locale: i18n.getLocale(), darkMode, - stylesheetPaths, themeVersion, + stylesheetPaths, injectedMetadata: { version: env.packageInfo.version, buildNumber: env.packageInfo.buildNum, diff --git a/src/core/server/rendering/types.ts b/src/core/server/rendering/types.ts index 8089878ccefd0..ca6bab0dff1f8 100644 --- a/src/core/server/rendering/types.ts +++ b/src/core/server/rendering/types.ts @@ -7,6 +7,7 @@ */ import { i18n } from '@kbn/i18n'; +import type { ThemeVersion } from '@kbn/ui-shared-deps-npm'; import { EnvironmentMode, PackageInfo } from '../config'; import { ICspConfig } from '../csp'; @@ -24,7 +25,7 @@ export interface RenderingMetadata { i18n: typeof i18n.translate; locale: string; darkMode: boolean; - themeVersion?: string; + themeVersion: ThemeVersion; stylesheetPaths: string[]; injectedMetadata: { version: string; diff --git a/src/core/server/rendering/views/fonts.tsx b/src/core/server/rendering/views/fonts.tsx index 93de5184bb357..44030620454e7 100644 --- a/src/core/server/rendering/views/fonts.tsx +++ b/src/core/server/rendering/views/fonts.tsx @@ -14,7 +14,6 @@ import { RenderingMetadata } from '../types'; interface Props { url: RenderingMetadata['uiPublicUrl']; - themeVersion?: string; } interface FontFace { @@ -165,158 +164,6 @@ const getInter = (url: string): FontFace => { }; }; -const getInterUi = (url: string): FontFace => { - return { - family: 'Inter UI', - variants: [ - { - style: 'normal', - weight: 100, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-Thin-BETA.woff2`, - `${url}/fonts/inter_ui/Inter-UI-Thin-BETA.woff`, - ], - }, - { - style: 'italic', - weight: 100, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-ThinItalic-BETA.woff2`, - `${url}/fonts/inter_ui/Inter-UI-ThinItalic-BETA.woff`, - ], - }, - { - style: 'normal', - weight: 200, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-ExtraLight-BETA.woff2`, - `${url}/fonts/inter_ui/Inter-UI-ExtraLight-BETA.woff`, - ], - }, - { - style: 'italic', - weight: 200, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-ExtraLightItalic-BETA.woff2`, - `${url}/fonts/inter_ui/Inter-UI-ExtraLightItalic-BETA.woff`, - ], - }, - { - style: 'normal', - weight: 300, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-Light-BETA.woff2`, - `${url}/fonts/inter_ui/Inter-UI-Light-BETA.woff`, - ], - }, - { - style: 'italic', - weight: 300, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-LightItalic-BETA.woff2`, - `${url}/fonts/inter_ui/Inter-UI-LightItalic-BETA.woff`, - ], - }, - { - style: 'normal', - weight: 400, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-Regular.woff2`, - `${url}/fonts/inter_ui/Inter-UI-Regular.woff`, - ], - }, - { - style: 'italic', - weight: 400, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-Italic.woff2`, - `${url}/fonts/inter_ui/Inter-UI-Italic.woff`, - ], - }, - { - style: 'normal', - weight: 500, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-Medium.woff2`, - `${url}/fonts/inter_ui/Inter-UI-Medium.woff`, - ], - }, - { - style: 'italic', - weight: 500, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-MediumItalic.woff2`, - `${url}/fonts/inter_ui/Inter-UI-MediumItalic.woff`, - ], - }, - { - style: 'normal', - weight: 600, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-SemiBold.woff2`, - `${url}/fonts/inter_ui/Inter-UI-SemiBold.woff`, - ], - }, - { - style: 'italic', - weight: 600, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-SemiBoldItalic.woff2`, - `${url}/fonts/inter_ui/Inter-UI-SemiBoldItalic.woff`, - ], - }, - { - style: 'normal', - weight: 700, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-Bold.woff2`, - `${url}/fonts/inter_ui/Inter-UI-Bold.woff`, - ], - }, - { - style: 'italic', - weight: 700, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-BoldItalic.woff2`, - `${url}/fonts/inter_ui/Inter-UI-BoldItalic.woff`, - ], - }, - { - style: 'normal', - weight: 800, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-ExtraBold.woff2`, - `${url}/fonts/inter_ui/Inter-UI-ExtraBold.woff`, - ], - }, - { - style: 'italic', - weight: 800, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-ExtraBoldItalic.woff2`, - `${url}/fonts/inter_ui/Inter-UI-ExtraBoldItalic.woff`, - ], - }, - { - style: 'normal', - weight: 900, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-Black.woff2`, - `${url}/fonts/inter_ui/Inter-UI-Black.woff`, - ], - }, - { - style: 'italic', - weight: 900, - sources: [ - `${url}/fonts/inter_ui/Inter-UI-BlackItalic.woff2`, - `${url}/fonts/inter_ui/Inter-UI-BlackItalic.woff`, - ], - }, - ], - }; -}; - const getRoboto = (url: string): FontFace => { return { family: 'Roboto Mono', @@ -372,11 +219,8 @@ const getRoboto = (url: string): FontFace => { }; }; -export const Fonts: FunctionComponent = ({ url, themeVersion }) => { - /** - * If `themeVersion` is not provided, we want to fallback to the newest font family `Inter` - */ - const sansFont = themeVersion === 'v7' ? getInterUi(url) : getInter(url); +export const Fonts: FunctionComponent = ({ url }) => { + const sansFont = getInter(url); const codeFont = getRoboto(url); return ( diff --git a/src/core/server/rendering/views/template.tsx b/src/core/server/rendering/views/template.tsx index e1a9a8a8c3f1d..971a9e22e4fcc 100644 --- a/src/core/server/rendering/views/template.tsx +++ b/src/core/server/rendering/views/template.tsx @@ -22,7 +22,6 @@ export const Template: FunctionComponent = ({ uiPublicUrl, locale, darkMode, - themeVersion, stylesheetPaths, injectedMetadata, i18n, @@ -37,7 +36,7 @@ export const Template: FunctionComponent = ({ Elastic - + {/* The alternate icon is a fallback for Safari which does not yet support SVG favicons */} diff --git a/src/core/server/ui_settings/saved_objects/migrations.test.ts b/src/core/server/ui_settings/saved_objects/migrations.test.ts index 2d374b0c98424..e89811790060a 100644 --- a/src/core/server/ui_settings/saved_objects/migrations.test.ts +++ b/src/core/server/ui_settings/saved_objects/migrations.test.ts @@ -186,4 +186,28 @@ describe('ui_settings 8.0.0 migrations', () => { migrationVersion: {}, }); }); + test('removes custom theme:version setting', () => { + const doc = { + type: 'config', + id: '8.0.0', + attributes: { + buildNum: 9007199254740991, + 'theme:version': 'v7', + }, + references: [], + updated_at: '2020-06-09T20:18:20.349Z', + migrationVersion: {}, + }; + + expect(migration(doc)).toEqual({ + type: 'config', + id: '8.0.0', + attributes: { + buildNum: 9007199254740991, + }, + references: [], + updated_at: '2020-06-09T20:18:20.349Z', + migrationVersion: {}, + }); + }); }); diff --git a/src/core/server/ui_settings/saved_objects/migrations.ts b/src/core/server/ui_settings/saved_objects/migrations.ts index 88632923e5514..91666146655c6 100644 --- a/src/core/server/ui_settings/saved_objects/migrations.ts +++ b/src/core/server/ui_settings/saved_objects/migrations.ts @@ -88,6 +88,7 @@ export const migrations = { // owner: Team:Core 'telemetry:optIn', 'xPackMonitoring:allowReport', + 'theme:version', ].includes(key) ? { ...acc, diff --git a/src/core/server/ui_settings/settings/theme.test.ts b/src/core/server/ui_settings/settings/theme.test.ts index 58cbffb255b53..839ece4eaf8d0 100644 --- a/src/core/server/ui_settings/settings/theme.test.ts +++ b/src/core/server/ui_settings/settings/theme.test.ts @@ -29,72 +29,28 @@ describe('theme settings', () => { ); }); }); - - describe('theme:version', () => { - const validate = getValidationFn(themeSettings['theme:version']); - - it('should only accept valid values', () => { - expect(() => validate('v7')).not.toThrow(); - expect(() => validate('v8')).not.toThrow(); - expect(() => validate('v12')).toThrowErrorMatchingInlineSnapshot(` -"types that failed validation: -- [0]: expected value to equal [v7] -- [1]: expected value to equal [v8]" -`); - }); - }); }); describe('process.env.KBN_OPTIMIZER_THEMES handling', () => { - it('provides valid options based on tags', () => { - process.env.KBN_OPTIMIZER_THEMES = 'v7light,v8dark'; - let settings = getThemeSettings({ isDist: false }); - expect(settings['theme:version'].options).toEqual(['v7', 'v8']); - - process.env.KBN_OPTIMIZER_THEMES = 'v8dark,v7light'; - settings = getThemeSettings({ isDist: false }); - expect(settings['theme:version'].options).toEqual(['v7', 'v8']); - - process.env.KBN_OPTIMIZER_THEMES = 'v8dark,v7light,v7dark,v8light'; - settings = getThemeSettings({ isDist: false }); - expect(settings['theme:version'].options).toEqual(['v7', 'v8']); - - process.env.KBN_OPTIMIZER_THEMES = '*'; - settings = getThemeSettings({ isDist: false }); - expect(settings['theme:version'].options).toEqual(['v7', 'v8']); - - process.env.KBN_OPTIMIZER_THEMES = 'v7light'; - settings = getThemeSettings({ isDist: false }); - expect(settings['theme:version'].options).toEqual(['v7']); - - process.env.KBN_OPTIMIZER_THEMES = 'v8light'; - settings = getThemeSettings({ isDist: false }); - expect(settings['theme:version'].options).toEqual(['v8']); - }); - it('defaults to properties of first tag', () => { - process.env.KBN_OPTIMIZER_THEMES = 'v8dark,v7light'; + process.env.KBN_OPTIMIZER_THEMES = 'v8dark,v8light'; let settings = getThemeSettings({ isDist: false }); expect(settings['theme:darkMode'].value).toBe(true); - expect(settings['theme:version'].value).toBe('v8'); - process.env.KBN_OPTIMIZER_THEMES = 'v7light,v8dark'; + process.env.KBN_OPTIMIZER_THEMES = 'v8light,v8dark'; settings = getThemeSettings({ isDist: false }); expect(settings['theme:darkMode'].value).toBe(false); - expect(settings['theme:version'].value).toBe('v7'); }); it('ignores the value when isDist is undefined', () => { - process.env.KBN_OPTIMIZER_THEMES = 'v7light'; + process.env.KBN_OPTIMIZER_THEMES = 'v8dark'; const settings = getThemeSettings({ isDist: undefined }); expect(settings['theme:darkMode'].value).toBe(false); - expect(settings['theme:version'].options).toEqual(['v7', 'v8']); }); it('ignores the value when isDist is true', () => { - process.env.KBN_OPTIMIZER_THEMES = 'v7light'; + process.env.KBN_OPTIMIZER_THEMES = 'v8dark'; const settings = getThemeSettings({ isDist: true }); expect(settings['theme:darkMode'].value).toBe(false); - expect(settings['theme:version'].options).toEqual(['v7', 'v8']); }); }); diff --git a/src/core/server/ui_settings/settings/theme.ts b/src/core/server/ui_settings/settings/theme.ts index 4d2c45a9c84b0..1c34314839916 100644 --- a/src/core/server/ui_settings/settings/theme.ts +++ b/src/core/server/ui_settings/settings/theme.ts @@ -6,19 +6,16 @@ * Side Public License, v 1. */ -import { schema, Type } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { i18n } from '@kbn/i18n'; +import type { ThemeVersion } from '@kbn/ui-shared-deps-npm'; import { UiSettingsParams } from '../../../types'; function parseThemeTags() { - if (!process.env.KBN_OPTIMIZER_THEMES) { + if (!process.env.KBN_OPTIMIZER_THEMES || process.env.KBN_OPTIMIZER_THEMES === '*') { return ['v8light', 'v8dark']; } - if (process.env.KBN_OPTIMIZER_THEMES === '*') { - return ['v8light', 'v8dark', 'v7light', 'v7dark']; - } - return process.env.KBN_OPTIMIZER_THEMES.split(',').map((t) => t.trim()); } @@ -26,16 +23,12 @@ function getThemeInfo(options: GetThemeSettingsOptions) { if (options?.isDist ?? true) { return { defaultDarkMode: false, - defaultVersion: 'v8', - availableVersions: ['v7', 'v8'], }; } const themeTags = parseThemeTags(); return { defaultDarkMode: themeTags[0].endsWith('dark'), - defaultVersion: themeTags[0].slice(0, 2), - availableVersions: ['v7', 'v8'].filter((v) => themeTags.some((t) => t.startsWith(v))), }; } @@ -46,9 +39,7 @@ interface GetThemeSettingsOptions { export const getThemeSettings = ( options: GetThemeSettingsOptions = {} ): Record => { - const { availableVersions, defaultDarkMode, defaultVersion } = getThemeInfo(options); - - const onlyOneThemeAvailable = !options?.isDist && availableVersions.length === 1; + const { defaultDarkMode } = getThemeInfo(options); return { 'theme:darkMode': { @@ -62,29 +53,17 @@ export const getThemeSettings = ( requiresPageReload: true, schema: schema.boolean(), }, + /** + * Theme is sticking around as there are still a number of places reading it and + * we might use it again in the future. + */ 'theme:version': { name: i18n.translate('core.ui_settings.params.themeVersionTitle', { defaultMessage: 'Theme version', }), - value: defaultVersion, - type: 'select', - options: availableVersions, - description: i18n.translate('core.ui_settings.params.themeVersionText', { - defaultMessage: - 'Switch between the theme used for the current and next version of Kibana. A page refresh is required for the setting to be applied. {lessOptions}', - values: { - lessOptions: onlyOneThemeAvailable - ? '

There is only one theme available, set KBN_OPTIMIZER_THEMES=v7light,v7dark,v8light,v8dark to get more options.' - : undefined, - }, - }), - requiresPageReload: true, - schema: schema.oneOf(availableVersions.map((v) => schema.literal(v)) as [Type]), - optionLabels: onlyOneThemeAvailable - ? { - [availableVersions[0]]: `${availableVersions[0]} (only)`, - } - : undefined, + value: 'v8' as ThemeVersion, + readonly: true, + schema: schema.literal('v8'), }, }; }; diff --git a/src/plugins/data/public/ui/query_string_input/_query_bar.scss b/src/plugins/data/public/ui/query_string_input/_query_bar.scss index 479414c458466..f8c2f067d9ec5 100644 --- a/src/plugins/data/public/ui/query_string_input/_query_bar.scss +++ b/src/plugins/data/public/ui/query_string_input/_query_bar.scss @@ -14,19 +14,17 @@ display: flex; flex: 1 1 100%; position: relative; + background-color: $euiFormBackgroundColor; + border-radius: $euiFormControlBorderRadius; - @include kbnThemeStyle('v8') { - background-color: $euiFormBackgroundColor; - border-radius: $euiFormControlBorderRadius; + &.kbnQueryBar__textareaWrap--hasPrepend { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } - &.kbnQueryBar__textareaWrap--hasPrepend { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - } - &.kbnQueryBar__textareaWrap--hasAppend { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } + &.kbnQueryBar__textareaWrap--hasAppend { + border-top-right-radius: 0; + border-bottom-right-radius: 0; } } @@ -39,24 +37,17 @@ // shadow to line up correctly. padding: $euiSizeS; box-shadow: 0 0 0 1px $euiFormBorderColor; + padding-bottom: $euiSizeS + 1px; + // Firefox adds margin to textarea + margin: 0; - @include kbnThemeStyle('v7') { - padding-top: $euiSizeS + 2px; + &.kbnQueryBar__textarea--hasPrepend { + border-top-left-radius: 0; + border-bottom-left-radius: 0; } - - @include kbnThemeStyle('v8') { - padding-bottom: $euiSizeS + 1px; - // Firefox adds margin to textarea - margin: 0; - - &.kbnQueryBar__textarea--hasPrepend { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - } - &.kbnQueryBar__textarea--hasAppend { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } + &.kbnQueryBar__textarea--hasAppend { + border-top-right-radius: 0; + border-bottom-right-radius: 0; } &:not(.kbnQueryBar__textarea--autoHeight):not(:invalid) { diff --git a/src/plugins/kibana_react/public/toolbar_button/toolbar_button.scss b/src/plugins/kibana_react/public/toolbar_button/toolbar_button.scss index 0b5152bd99bbf..f5cc1e53f24f9 100644 --- a/src/plugins/kibana_react/public/toolbar_button/toolbar_button.scss +++ b/src/plugins/kibana_react/public/toolbar_button/toolbar_button.scss @@ -5,10 +5,8 @@ // todo: once issue https://github.com/elastic/eui/issues/4730 is merged, this code might be safe to remove // Some toolbar buttons are just icons, but EuiButton comes with margin and min-width that need to be removed min-width: 0; - @include kbnThemeStyle('v8') { - border-width: $euiBorderWidthThin; - border-style: solid; - } + border-width: $euiBorderWidthThin; + border-style: solid; &[class*='--text'] { // Lighten the border color for all states diff --git a/src/plugins/navigation/public/top_nav_menu/_index.scss b/src/plugins/navigation/public/top_nav_menu/_index.scss index 9af1bb5434bb1..c0d5ee5a7593d 100644 --- a/src/plugins/navigation/public/top_nav_menu/_index.scss +++ b/src/plugins/navigation/public/top_nav_menu/_index.scss @@ -1,12 +1,6 @@ .kbnTopNavMenu { - @include kbnThemeStyle('v7') { - margin-right: $euiSizeXS; - } - - @include kbnThemeStyle('v8') { - button:last-child { - margin-right: 0; - } + button:last-child { + margin-right: 0; } } diff --git a/src/plugins/presentation_util/public/components/solution_toolbar/items/button.scss b/src/plugins/presentation_util/public/components/solution_toolbar/items/button.scss index a1e5b4e141765..4283813f1d0b7 100644 --- a/src/plugins/presentation_util/public/components/solution_toolbar/items/button.scss +++ b/src/plugins/presentation_util/public/components/solution_toolbar/items/button.scss @@ -5,10 +5,8 @@ // Lighten the border color for all states border-color: $euiBorderColor !important; // sass-lint:disable-line no-important - @include kbnThemeStyle('v8') { - &[class*='--text'] { - border-width: $euiBorderWidthThin; - border-style: solid; - } + &[class*='--text'] { + border-width: $euiBorderWidthThin; + border-style: solid; } } diff --git a/src/plugins/presentation_util/public/components/solution_toolbar/items/quick_group.scss b/src/plugins/presentation_util/public/components/solution_toolbar/items/quick_group.scss index 535570a51d777..434f06b69a684 100644 --- a/src/plugins/presentation_util/public/components/solution_toolbar/items/quick_group.scss +++ b/src/plugins/presentation_util/public/components/solution_toolbar/items/quick_group.scss @@ -1,11 +1,9 @@ .quickButtonGroup { .quickButtonGroup__button { background-color: $euiColorEmptyShade; - @include kbnThemeStyle('v8') { - // sass-lint:disable-block no-important - border-width: $euiBorderWidthThin !important; - border-style: solid !important; - border-color: $euiBorderColor !important; - } + // sass-lint:disable-block no-important + border-width: $euiBorderWidthThin !important; + border-style: solid !important; + border-color: $euiBorderColor !important; } } diff --git a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js index dc516060ea360..dee608fcf0702 100644 --- a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js +++ b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js @@ -150,7 +150,7 @@ module.exports = { additionalData(content, loaderContext) { return `@import ${stringifyRequest( loaderContext, - path.resolve(KIBANA_ROOT, 'src/core/public/core_app/styles/_globals_v7light.scss') + path.resolve(KIBANA_ROOT, 'src/core/public/core_app/styles/_globals_v8light.scss') )};\n${content}`; }, implementation: require('node-sass'), diff --git a/x-pack/plugins/lens/public/_mixins.scss b/x-pack/plugins/lens/public/_mixins.scss index 7282de214636c..1ac02039faf42 100644 --- a/x-pack/plugins/lens/public/_mixins.scss +++ b/x-pack/plugins/lens/public/_mixins.scss @@ -50,16 +50,10 @@ // Removes EUI focus ring @mixin removeEuiFocusRing { - @include kbnThemeStyle('v7') { - animation: none !important; // sass-lint:disable-line no-important - } - - @include kbnThemeStyle('v8') { - outline: none; + outline: none; - &:focus-visible { - outline-style: none; - } + &:focus-visible { + outline-style: none; } } @@ -69,23 +63,14 @@ #{$target} { @include euiFocusBackground; - - @include kbnThemeStyle('v7') { - @include euiFocusRing; - } - - @include kbnThemeStyle('v8') { - outline: $euiFocusRingSize solid currentColor; // Safari & Firefox - } + outline: $euiFocusRingSize solid currentColor; // Safari & Firefox } - @include kbnThemeStyle('v8') { - &:focus-visible #{$target} { - outline-style: auto; // Chrome - } + &:focus-visible #{$target} { + outline-style: auto; // Chrome + } - &:not(:focus-visible) #{$target} { - outline: none; - } + &:not(:focus-visible) #{$target} { + outline: none; } -} \ No newline at end of file +} diff --git a/x-pack/plugins/lens/public/drag_drop/drag_drop.scss b/x-pack/plugins/lens/public/drag_drop/drag_drop.scss index 5522b65fca261..814640ba515eb 100644 --- a/x-pack/plugins/lens/public/drag_drop/drag_drop.scss +++ b/x-pack/plugins/lens/public/drag_drop/drag_drop.scss @@ -20,15 +20,8 @@ transform: translate(-12px, 8px); z-index: $lnsZLevel3; pointer-events: none; - - @include kbnThemeStyle('v7') { - box-shadow: 0 0 0 $euiFocusRingSize $euiFocusRingColor; - } - - @include kbnThemeStyle('v8') { - outline: $euiFocusRingSize solid currentColor; // Safari & Firefox - outline-style: auto; // Chrome - } + outline: $euiFocusRingSize solid currentColor; // Safari & Firefox + outline-style: auto; // Chrome } // Draggable item @@ -211,4 +204,4 @@ &.lnsDragDrop-incompatibleExtraDrop { color: $euiColorWarningText; } -} \ No newline at end of file +} diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.scss b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.scss index 4c699ff899bba..343cd746ba2ac 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.scss +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.scss @@ -104,10 +104,6 @@ min-height: $euiSizeXXL - 2; word-break: break-word; font-weight: $euiFontWeightRegular; - - @include kbnThemeStyle('v7') { - font-size: $euiFontSizeS; - } } .lnsLayerPanel__triggerTextLabel { @@ -152,4 +148,4 @@ @include passDownFocusRing('.lnsLayerPanel__triggerTextLabel'); background-color: transparent; } -} \ No newline at end of file +} diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel_wrapper.scss b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel_wrapper.scss index e57455e5bd5ab..9a87f1ba46e94 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel_wrapper.scss +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel_wrapper.scss @@ -10,6 +10,7 @@ height: 100%; .lnsWorkspacePanelWrapper__pageContentBody { + @include euiBottomShadowMedium; @include euiScrollBar; flex-grow: 1; display: flex; @@ -19,14 +20,6 @@ background: $euiColorEmptyShade; height: 100%; - @include kbnThemeStyle('v7') { - @include euiBottomShadowSmall; - } - - @include kbnThemeStyle('v8') { - @include euiBottomShadowMedium; - } - > * { flex: 1 1 100%; display: flex; @@ -42,13 +35,7 @@ } .lnsWorkspacePanel__dragDrop { - @include kbnThemeStyle('v7') { - border: $euiBorderThin; - } - - @include kbnThemeStyle('v8') { - border: $euiBorderWidthThin solid transparent; - } + border: $euiBorderWidthThin solid transparent; &.lnsDragDrop-isDropTarget { @include lnsDroppable; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss index 8b509e9c39b7b..d4c91f80317fd 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss @@ -54,9 +54,3 @@ padding-top: 0; padding-bottom: 0; } - -.lnsIndexPatternDimensionEditor__warning { - @include kbnThemeStyle('v7') { - border: none; - } -} diff --git a/x-pack/plugins/maps/public/_mixins.scss b/x-pack/plugins/maps/public/_mixins.scss index 914bc23c1163c..135d90b3a4c56 100644 --- a/x-pack/plugins/maps/public/_mixins.scss +++ b/x-pack/plugins/maps/public/_mixins.scss @@ -1,11 +1,4 @@ @mixin mapToolbarButtonGroupBorderRadius { - @include kbnThemeStyle($theme: 'v7') { - border-radius: $euiBorderRadius; - } - - @include kbnThemeStyle($theme: 'v8') { - border-radius: $euiBorderRadiusSmall; - } - + border-radius: $euiBorderRadiusSmall; overflow: hidden; } diff --git a/x-pack/plugins/maps/public/connected_components/toolbar_overlay/_toolbar_overlay.scss b/x-pack/plugins/maps/public/connected_components/toolbar_overlay/_toolbar_overlay.scss index 511de91e964b9..b929582c2479e 100644 --- a/x-pack/plugins/maps/public/connected_components/toolbar_overlay/_toolbar_overlay.scss +++ b/x-pack/plugins/maps/public/connected_components/toolbar_overlay/_toolbar_overlay.scss @@ -10,17 +10,6 @@ position: relative; transition: transform $euiAnimSpeedNormal ease-in-out, background $euiAnimSpeedNormal ease-in-out; - @include kbnThemeStyle($theme: 'v7') { - // Overrides the .euiPanel default border - // sass-lint:disable-block no-important - border: none !important; - - // Overrides the .euiPanel--hasShadow - &.euiPanel.euiPanel--hasShadow { - @include euiBottomShadowLarge; - } - } - .euiButtonIcon:not(.euiButtonIcon--fill) { color: $euiTextColor !important; } diff --git a/x-pack/plugins/security/server/__snapshots__/prompt_page.test.tsx.snap b/x-pack/plugins/security/server/__snapshots__/prompt_page.test.tsx.snap index 5ab79e72d7274..8e2b2a9a1f222 100644 --- a/x-pack/plugins/security/server/__snapshots__/prompt_page.test.tsx.snap +++ b/x-pack/plugins/security/server/__snapshots__/prompt_page.test.tsx.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PromptPage renders as expected with additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; +exports[`PromptPage renders as expected with additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; -exports[`PromptPage renders as expected without additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; +exports[`PromptPage renders as expected without additional scripts 1`] = `"ElasticMockedFonts

Some Title

Some Body
Action#1
Action#2
"`; diff --git a/x-pack/plugins/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap b/x-pack/plugins/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap index 8e6d6a2677787..62200cb288e09 100644 --- a/x-pack/plugins/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap +++ b/x-pack/plugins/security/server/authentication/__snapshots__/unauthenticated_page.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`UnauthenticatedPage renders as expected 1`] = `"ElasticMockedFonts

We couldn't log you in

We hit an authentication error. Please check your credentials and try again. If you still can't log in, contact your system administrator.

"`; +exports[`UnauthenticatedPage renders as expected 1`] = `"ElasticMockedFonts

We couldn't log you in

We hit an authentication error. Please check your credentials and try again. If you still can't log in, contact your system administrator.

"`; diff --git a/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap b/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap index 97cfcd47ade8d..8b882c9a6b442 100644 --- a/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap +++ b/x-pack/plugins/security/server/authorization/__snapshots__/reset_session_page.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ResetSessionPage renders as expected 1`] = `"ElasticMockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; +exports[`ResetSessionPage renders as expected 1`] = `"ElasticMockedFonts

You do not have permission to access the requested page

Either go back to the previous page or log in as a different user.

"`; diff --git a/x-pack/plugins/security/server/prompt_page.tsx b/x-pack/plugins/security/server/prompt_page.tsx index eb26e1a4380ae..853ef723ddb98 100644 --- a/x-pack/plugins/security/server/prompt_page.tsx +++ b/x-pack/plugins/security/server/prompt_page.tsx @@ -53,7 +53,7 @@ export function PromptPage({ const regularBundlePath = `${basePath.serverBasePath}/${buildNumber}/bundles`; const styleSheetPaths = [ `${regularBundlePath}/kbn-ui-shared-deps-src/${UiSharedDepsSrc.cssDistFilename}`, - `${regularBundlePath}/kbn-ui-shared-deps-npm/${UiSharedDepsNpm.lightCssDistFilename}`, + `${regularBundlePath}/kbn-ui-shared-deps-npm/${UiSharedDepsNpm.lightCssDistFilename('v8')}`, `${basePath.serverBasePath}/node_modules/@kbn/ui-framework/dist/kui_light.css`, `${basePath.serverBasePath}/ui/legacy_light_theme.css`, ];