Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[EuiSteps] Remove chroma transparency warning, misc cleanup #7454

Merged
merged 4 commits into from
Jan 9, 2024
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
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});
`,
};
};
Loading