Skip to content

Commit

Permalink
[EuiSteps] Remove chroma transparency warning, misc cleanup (#7454)
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen authored Jan 9, 2024
1 parent 6b32005 commit 01f5bd5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
3 changes: 3 additions & 0 deletions changelogs/upcoming/7454.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

- Fixed a color console warning being generated by disabled `EuiStep`s
37 changes: 13 additions & 24 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, makeHighContrastColor } from '../../services';
import { UseEuiTheme } from '../../services';
import { euiStepVariables } from './step.styles';
import { euiButtonFillColor } from '../../themes/amsterdam/global_styling/mixins';

Expand Down Expand Up @@ -67,54 +67,39 @@ export const euiStepNumberStyles = (euiThemeContext: UseEuiTheme) => {
border: ${euiTheme.border.thick};
`,
disabled: css`
background-color: ${euiButtonFillColor(euiThemeContext, 'disabled')
.backgroundColor};
color: ${makeHighContrastColor(euiTheme.colors.disabledText)(
euiButtonFillColor(euiThemeContext, 'disabled').backgroundColor
)};
${euiButtonFillColor(euiThemeContext, 'disabled')}
`,
loading: css`
background: transparent;
`,
warning: css`
color: ${euiButtonFillColor(euiThemeContext, 'warning').color};
background-color: ${euiButtonFillColor(euiThemeContext, 'warning')
.backgroundColor};
${euiButtonFillColor(euiThemeContext, 'warning')}
${euiCanAnimate} {
animation: ${euiAnimScale} ${euiTheme.animation.fast}
${euiTheme.animation.bounce};
}
`,
danger: css`
color: ${euiButtonFillColor(euiThemeContext, 'danger').color};
background-color: ${euiButtonFillColor(euiThemeContext, 'danger')
.backgroundColor};
${euiButtonFillColor(euiThemeContext, 'danger')}
${euiCanAnimate} {
animation: ${euiAnimScale} ${euiTheme.animation.fast}
${euiTheme.animation.bounce};
}
`,
complete: css`
color: ${euiButtonFillColor(euiThemeContext, 'success').color};
background-color: ${euiButtonFillColor(euiThemeContext, 'success')
.backgroundColor};
${euiButtonFillColor(euiThemeContext, 'success')}
${euiCanAnimate} {
animation: ${euiAnimScale} ${euiTheme.animation.fast}
${euiTheme.animation.bounce};
}
`,
current: css`
border: 2px solid ${euiTheme.colors.body};
box-shadow: 0 0 0 2px ${euiTheme.colors.primary};
.euiStepNumber__number {
/* Transform the step number so it appears in the center of the step circle */
display: inline-block;
transform: translateY(-2px);
}
border: ${euiTheme.border.width.thick} solid ${euiTheme.colors.body};
box-shadow: 0 0 0 ${euiTheme.border.width.thick}
${euiTheme.colors.primary};
`,
};
};
Expand Down Expand Up @@ -151,6 +136,10 @@ export const euiStepNumberContentStyles = ({ euiTheme }: UseEuiTheme) => {
`,
loading: css``,
disabled: css``,
current: css``,
current: css`
/* Transform the step number so it appears in the center of the step circle */
display: inline-block;
transform: translateY(-${euiTheme.border.width.thick});
`,
};
};

0 comments on commit 01f5bd5

Please sign in to comment.