Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions src-docs/src/views/steps/status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ export default () => {
);
}

let disabledButton;
if (status !== 'disabled') {
disabledButton = (
<EuiButton color="accent" onClick={() => setStatus('disabled')}>
Disabled
</EuiButton>
);
} else {
disabledButton = (
<EuiButton color="accent" onClick={() => setStatus('incomplete')}>
Reset
</EuiButton>
);
}

const firstSetOfSteps = [
{
title: 'Normal step',
Expand All @@ -75,6 +90,7 @@ export default () => {
<EuiFlexItem grow={false}> {completeButton} </EuiFlexItem>
<EuiFlexItem grow={false}> {warningButton} </EuiFlexItem>
<EuiFlexItem grow={false}> {dangerButton} </EuiFlexItem>
<EuiFlexItem grow={false}> {disabledButton} </EuiFlexItem>
</EuiFlexGroup>
</>
),
Expand Down
6 changes: 4 additions & 2 deletions src/components/steps/step.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { css } from '@emotion/react';
import { UseEuiTheme } from '../../services';
import { UseEuiTheme, makeHighContrastColor } from '../../services';
import { mathWithUnits, logicalCSS } from '../../global_styling';

export const euiStepVariables = (euiTheme: UseEuiTheme['euiTheme']) => {
Expand Down Expand Up @@ -132,7 +132,9 @@ export const euiStepTitleStyles = (euiThemeContext: UseEuiTheme) => {
`,
euiStep__title: css``,
isDisabled: css`
color: ${euiTheme.colors.disabledText};
color: ${makeHighContrastColor(euiTheme.colors.disabledText)(
euiTheme.colors.body
)};
`,
// Sizes
m: css``,
Expand Down
6 changes: 4 additions & 2 deletions src/components/steps/step_horizontal.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { css } from '@emotion/react';
import { UseEuiTheme } from '../../services';
import { UseEuiTheme, makeHighContrastColor } from '../../services';
import {
euiBreakpoint,
logicalShorthandCSS,
Expand Down Expand Up @@ -135,7 +135,9 @@ export const euiStepHorizontalTitleStyles = (euiThemeContext: UseEuiTheme) => {
}
`,
disabled: css`
color: ${euiTheme.colors.disabledText};
color: ${makeHighContrastColor(euiTheme.colors.disabledText)(
euiTheme.colors.body
)};
`,
};
};
6 changes: 4 additions & 2 deletions src/components/steps/step_number.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
euiCanAnimate,
euiAnimScale,
} from '../../global_styling';
import { UseEuiTheme } from '../../services';
import { UseEuiTheme, makeHighContrastColor } from '../../services';
import { euiStepVariables } from './step.styles';
import { euiButtonFillColor } from '../../themes/amsterdam/global_styling/mixins';

Expand Down Expand Up @@ -67,9 +67,11 @@ export const euiStepNumberStyles = (euiThemeContext: UseEuiTheme) => {
border: ${euiTheme.border.thick};
`,
disabled: css`
color: ${euiButtonFillColor(euiThemeContext, 'disabled').color};
background-color: ${euiButtonFillColor(euiThemeContext, 'disabled')
.backgroundColor};
color: ${makeHighContrastColor(euiTheme.colors.disabledText)(
euiButtonFillColor(euiThemeContext, 'disabled').backgroundColor
)};
`,
loading: css`
background: transparent;
Expand Down
1 change: 1 addition & 0 deletions upcoming_changelogs/7032.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Improved the contrast ratio of disabled titles within `EuiSteps` and `EuiStepsHorizontal` to meet WCAG AA guidelines.