mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[HCM] High contrast mode style adjustments (#216964)
## Summary This PR adds a couple of style fixes to ensure improved visual output in high contrast mode. The updates focus on borders, mainly removing duplicate borders due to nested `EuiPanel` usages and ensuring custom borders are correctly applied and receive a high contrast color. ### Changes | Solution | Before | After | |--------|-----|-----| | discover |  |  | | dashboard |  |  | | dashboard |  |  | | elasticsearch |  |  | | observability |  |  | | security |  |  | ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
6ab8808d72
commit
0f4361d05d
9 changed files with 62 additions and 26 deletions
|
@ -45,7 +45,7 @@ export const OverviewPanel: FC<PropsWithChildren<OverviewPanelProps>> = ({
|
|||
<EuiFlexGroup alignItems="flexStart" gutterSize="xl">
|
||||
{leftPanelContent && <EuiFlexItem grow={6}>{leftPanelContent}</EuiFlexItem>}
|
||||
<EuiFlexItem grow={4}>
|
||||
<EuiPanel paddingSize="none" color="subdued" {...overviewPanelProps}>
|
||||
<EuiPanel paddingSize="none" color="transparent" {...overviewPanelProps}>
|
||||
<EuiTitle size="s">
|
||||
<h2>{title}</h2>
|
||||
</EuiTitle>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.serverlessSearchSelectClientPanelSelectedBorder {
|
||||
.serverlessSearchSelectClientPanelSelectedBorder::before {
|
||||
border: 1px solid $euiColorPrimary;
|
||||
}
|
||||
.serverlessSearchSelectClientPanelBorder {
|
||||
.serverlessSearchSelectClientPanelBorder::before {
|
||||
border: 1px solid $euiColorLightShade;
|
||||
}
|
||||
|
|
|
@ -7,13 +7,14 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import { useEuiTheme } from '@elastic/eui';
|
||||
import { useEuiTheme, highContrastModeStyles } from '@elastic/eui';
|
||||
import { css } from '@emotion/react';
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export const useHoverActionStyles = (isEditMode: boolean, showBorder?: boolean) => {
|
||||
const { euiTheme } = useEuiTheme();
|
||||
const euiThemeContext = useEuiTheme();
|
||||
const { euiTheme } = euiThemeContext;
|
||||
|
||||
const containerStyles = useMemo(() => {
|
||||
const editModeOutline = `${euiTheme.border.width.thin} dashed ${euiTheme.colors.borderBaseFormsControl}`;
|
||||
|
@ -39,6 +40,12 @@ export const useHoverActionStyles = (isEditMode: boolean, showBorder?: boolean)
|
|||
? css`
|
||||
.embPanel {
|
||||
outline: var(--internalBorderStyle);
|
||||
|
||||
${highContrastModeStyles(euiThemeContext, {
|
||||
preferred: `
|
||||
border: none;
|
||||
`,
|
||||
})},
|
||||
}
|
||||
`
|
||||
: css`
|
||||
|
@ -51,10 +58,20 @@ export const useHoverActionStyles = (isEditMode: boolean, showBorder?: boolean)
|
|||
transition-delay: ${euiTheme.animation.fast};
|
||||
}
|
||||
|
||||
&:hover .embPanel {
|
||||
outline: var(--internalBorderStyle);
|
||||
z-index: ${euiTheme.levels.menu};
|
||||
transition: none; // apply transition on hover out only
|
||||
&:hover {
|
||||
.embPanel {
|
||||
z-index: ${euiTheme.levels.menu};
|
||||
transition: none; // apply transition on hover out only
|
||||
|
||||
${highContrastModeStyles(euiThemeContext, {
|
||||
none: `
|
||||
outline: var(--internalBorderStyle);
|
||||
`,
|
||||
preferred: `
|
||||
border: var(--internalBorderStyle);
|
||||
`,
|
||||
})},
|
||||
}
|
||||
}
|
||||
`}
|
||||
|
||||
|
@ -87,7 +104,7 @@ export const useHoverActionStyles = (isEditMode: boolean, showBorder?: boolean)
|
|||
}
|
||||
}
|
||||
`;
|
||||
}, [euiTheme, showBorder, isEditMode]);
|
||||
}, [euiTheme, showBorder, isEditMode, euiThemeContext]);
|
||||
|
||||
const hoverActionStyles = useMemo(() => {
|
||||
const singleWrapperStyles = css`
|
||||
|
|
|
@ -175,7 +175,12 @@ export const ToolbarSelector: React.FC<ToolbarSelectorProps> = ({
|
|||
{(list, search) => (
|
||||
<>
|
||||
{search && (
|
||||
<EuiPanel paddingSize="s" hasShadow={false} css={{ paddingBottom: 0 }}>
|
||||
<EuiPanel
|
||||
color="transparent"
|
||||
paddingSize="s"
|
||||
hasShadow={false}
|
||||
css={{ paddingBottom: 0 }}
|
||||
>
|
||||
{search}
|
||||
</EuiPanel>
|
||||
)}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { EuiFlexGrid, EuiFlexItem, EuiSpacer } from '@elastic/eui';
|
||||
import { EuiFlexGrid, EuiFlexItem, EuiSpacer, useEuiTheme } from '@elastic/eui';
|
||||
import React, { useContext } from 'react';
|
||||
import { ThemeContext } from 'styled-components';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
@ -21,6 +21,7 @@ export function EmptySections() {
|
|||
const { http, serverless: isServerless } = useKibana().services;
|
||||
const theme = useContext(ThemeContext);
|
||||
const { hasDataMap } = useHasData();
|
||||
const { euiTheme } = useEuiTheme();
|
||||
|
||||
const appEmptySections = getEmptySections({ http }).filter(({ id, showInServerless }) => {
|
||||
const app = hasDataMap[id];
|
||||
|
@ -47,6 +48,7 @@ export function EmptySections() {
|
|||
key={app.id}
|
||||
style={{
|
||||
border: `${theme.eui.euiBorderEditable}`,
|
||||
borderColor: euiTheme.border.color,
|
||||
borderRadius: `${theme.eui.euiBorderRadius}`,
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.chooseEmbeddingModelSelectedBorder {
|
||||
.chooseEmbeddingModelSelectedBorder::before {
|
||||
border: 1px solid $euiColorPrimary;
|
||||
}
|
||||
.chooseEmbeddingModelBorder {
|
||||
.chooseEmbeddingModelBorder::before {
|
||||
border: 1px solid $euiColorLightShade;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ export const GettingStarted: React.FC<GettingStartedProps> = ({
|
|||
kibanaRunApiInConsole: docLinks.consoleGuide,
|
||||
}}
|
||||
isPanelLeft={isPanelLeft}
|
||||
overviewPanelProps={{ color: 'plain', hasShadow: false }}
|
||||
overviewPanelProps={{ hasShadow: false }}
|
||||
application={services.application}
|
||||
sharePlugin={services.share}
|
||||
consolePlugin={services.console}
|
||||
|
@ -101,7 +101,7 @@ export const GettingStarted: React.FC<GettingStartedProps> = ({
|
|||
application={services.application}
|
||||
sharePlugin={services.share}
|
||||
isPanelLeft={isPanelLeft}
|
||||
overviewPanelProps={{ color: 'plain', hasShadow: false }}
|
||||
overviewPanelProps={{ hasShadow: false }}
|
||||
/>
|
||||
|
||||
<OverviewPanel
|
||||
|
@ -129,14 +129,14 @@ export const GettingStarted: React.FC<GettingStartedProps> = ({
|
|||
defaultMessage: 'Generate an API key',
|
||||
}
|
||||
)}
|
||||
overviewPanelProps={{ color: 'plain', hasShadow: false }}
|
||||
overviewPanelProps={{ hasShadow: false }}
|
||||
/>
|
||||
|
||||
<CloudDetailsPanel
|
||||
cloudId={codeArgs.cloudId}
|
||||
elasticsearchUrl={codeArgs.url}
|
||||
isPanelLeft={isPanelLeft}
|
||||
overviewPanelProps={{ color: 'plain', hasShadow: false }}
|
||||
overviewPanelProps={{ hasShadow: false }}
|
||||
/>
|
||||
|
||||
<OverviewPanel
|
||||
|
@ -173,7 +173,7 @@ export const GettingStarted: React.FC<GettingStartedProps> = ({
|
|||
defaultMessage: 'Configure your client',
|
||||
}
|
||||
)}
|
||||
overviewPanelProps={{ color: 'plain', hasShadow: false }}
|
||||
overviewPanelProps={{ hasShadow: false }}
|
||||
/>
|
||||
|
||||
<OverviewPanel
|
||||
|
@ -211,7 +211,7 @@ export const GettingStarted: React.FC<GettingStartedProps> = ({
|
|||
defaultMessage: 'Test your connection',
|
||||
}
|
||||
)}
|
||||
overviewPanelProps={{ color: 'plain', hasShadow: false }}
|
||||
overviewPanelProps={{ hasShadow: false }}
|
||||
/>
|
||||
<OverviewPanel
|
||||
description={i18n.translate(
|
||||
|
@ -244,7 +244,7 @@ export const GettingStarted: React.FC<GettingStartedProps> = ({
|
|||
title={i18n.translate('xpack.enterpriseSearch.overview.gettingStarted.ingestData.title', {
|
||||
defaultMessage: 'Ingest Data',
|
||||
})}
|
||||
overviewPanelProps={{ color: 'plain', hasShadow: false }}
|
||||
overviewPanelProps={{ hasShadow: false }}
|
||||
/>
|
||||
|
||||
<OverviewPanel
|
||||
|
@ -279,7 +279,7 @@ export const GettingStarted: React.FC<GettingStartedProps> = ({
|
|||
title={i18n.translate('xpack.enterpriseSearch.overview.gettingStarted.searchQuery.title', {
|
||||
defaultMessage: 'Build your first search query',
|
||||
})}
|
||||
overviewPanelProps={{ color: 'plain', hasShadow: false }}
|
||||
overviewPanelProps={{ hasShadow: false }}
|
||||
/>
|
||||
{showPipelinesPanel && (
|
||||
<OverviewPanel
|
||||
|
@ -326,7 +326,7 @@ export const GettingStarted: React.FC<GettingStartedProps> = ({
|
|||
}
|
||||
leftPanelContent={<GettingStartedPipelinePanel />}
|
||||
links={[]}
|
||||
overviewPanelProps={{ color: 'plain', hasShadow: false }}
|
||||
overviewPanelProps={{ hasShadow: false }}
|
||||
title={i18n.translate('xpack.enterpriseSearch.pipeline.title', {
|
||||
defaultMessage: 'Transform and enrich your data',
|
||||
})}
|
||||
|
|
|
@ -16,8 +16,20 @@ export const OnboardingCardContentPanel = React.memo<PropsWithChildren<EuiPanelP
|
|||
const nestedClassName = classnames(NESTED_PANEL_CLASS_NAME, className);
|
||||
|
||||
return (
|
||||
<EuiPanel paddingSize="m" hasShadow={false} hasBorder={false} className={panelClassName}>
|
||||
<EuiPanel hasShadow={false} paddingSize="l" {...panelProps} className={nestedClassName}>
|
||||
<EuiPanel
|
||||
color="transparent"
|
||||
paddingSize="m"
|
||||
hasShadow={false}
|
||||
hasBorder={false}
|
||||
className={panelClassName}
|
||||
>
|
||||
<EuiPanel
|
||||
color="transparent"
|
||||
hasShadow={false}
|
||||
paddingSize="l"
|
||||
{...panelProps}
|
||||
className={nestedClassName}
|
||||
>
|
||||
{children}
|
||||
</EuiPanel>
|
||||
</EuiPanel>
|
||||
|
|
|
@ -16,7 +16,7 @@ interface MissingAIConnectorCalloutProps {
|
|||
|
||||
export const MissingAIConnectorCallout = React.memo<MissingAIConnectorCalloutProps>(
|
||||
({ onExpandAiConnectorsCard }) => (
|
||||
<EuiPanel hasShadow={false} paddingSize="none">
|
||||
<EuiPanel color="transparent" hasShadow={false} paddingSize="none">
|
||||
<CardCallOut
|
||||
color="warning"
|
||||
text={i18n.START_MIGRATION_CARD_CONNECTOR_MISSING_TEXT}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue