Skip to content

Commit

Permalink
Fix form border color and remove unnecessary borderDisabledColor
Browse files Browse the repository at this point in the history
- transparency is way not low enough right now, it needs to be `0.1` in order to not sit on top of the underline background linear gradient

- as a result we need to darken the heck out of the border color - still not a 1:1 migration as the old color was semi-ludicrous, but definitely close enough

+ add `border: none` CSS to make round out the shadow-related logic and replace static `1px` with a token
  • Loading branch information
cee-chen committed May 17, 2024
1 parent f7b6719 commit b03db7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/eui/src/components/form/form.styles.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ describe('euiFormVariables', () => {
"backgroundColor": "#f9fbfd",
"backgroundDisabledColor": "#eef1f7",
"backgroundReadOnlyColor": "#FFF",
"borderColor": "rgba(211,218,230,0.9)",
"borderDisabledColor": "rgba(211,218,230,0.9)",
"borderColor": "rgba(32,38,47,0.1)",
"controlBorderRadius": "6px",
"controlBoxShadow": "0 0 transparent",
"controlCompressedBorderRadius": "4px",
Expand Down
7 changes: 4 additions & 3 deletions packages/eui/src/components/form/form.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ export const euiFormVariables = (euiThemeContext: UseEuiTheme) => {
backgroundColor: backgroundColor,
backgroundDisabledColor: darken(euiTheme.colors.lightestShade, 0.05),
backgroundReadOnlyColor: euiTheme.colors.emptyShade,
borderColor: transparentize(euiTheme.border.color, 0.9),
borderDisabledColor: transparentize(euiTheme.border.color, 0.9),
borderColor: transparentize(darken(euiTheme.border.color, 4), 0.1),
controlDisabledColor: euiTheme.colors.mediumShade,
controlBoxShadow: '0 0 transparent',
controlPlaceholderText: makeHighContrastColor(euiTheme.colors.subduedText)(
Expand Down Expand Up @@ -181,7 +180,9 @@ export const euiFormControlDefaultShadow = (euiThemeContext: UseEuiTheme) => {
const form = euiFormVariables(euiThemeContext);

return `
box-shadow: inset 0 0 0 1px ${form.borderColor};
/* We use inset box-shadow instead of border to skip extra hight calculations */
border: none;
box-shadow: inset 0 0 0 ${euiTheme.border.width.thin} ${form.borderColor};
background-color: ${form.backgroundColor};
background-repeat: no-repeat;
Expand Down

0 comments on commit b03db7f

Please sign in to comment.