Skip to content

Commit

Permalink
[designer approve] Remove complex CSS with low usage/visual benefit
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Aug 12, 2024
1 parent 389935b commit ea5830a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ export const euiFormControlLayoutSideNodeStyles = (
);

const buttons = '*:is(.euiButton, .euiButtonEmpty, .euiButtonIcon)';
// Note: `> *` selectors below account for buttons inside popover & tooltip wrappers

const text = '*:is(.euiFormLabel, .euiText)';

return {
Expand Down Expand Up @@ -136,6 +134,7 @@ export const euiFormControlLayoutSideNodeStyles = (
}
/* Account for button padding when spacing children */
/* Second > * selector accounts for buttons inside popover & tooltip wrappers */
&:not(:has(> ${buttons}:first-child, > *:first-child > ${buttons})) {
${logicalCSS('padding-left', euiTheme.size.s)}
Expand All @@ -144,44 +143,14 @@ export const euiFormControlLayoutSideNodeStyles = (
&:not(:has(> ${buttons}:last-child, > *:last-child > ${buttons})) {
${logicalCSS('padding-right', euiTheme.size.s)}
}
${text}:where(:has(+ ${buttons}, + * > ${buttons})) {
${logicalCSS('margin-right', `-${euiTheme.size.s}`)}
}
${text}:where(${buttons} + ${text}, *:has(${buttons}) + ${text}) {
${logicalCSS('margin-left', `-${euiTheme.size.s}`)}
}
`,
append: css`
${logicalCSS('border-top-right-radius', 'inherit')}
${logicalCSS('border-bottom-right-radius', 'inherit')}
& > ${buttons}, & > * > ${buttons} {
${logicalCSS('border-top-left-radius', 0)}
${logicalCSS('border-bottom-left-radius', 0)}
}
& > ${buttons}:not(:last-child),
& > *:not(:last-child) > ${buttons} {
${logicalCSS('border-top-right-radius', 0)}
${logicalCSS('border-bottom-right-radius', 0)}
}
`,
prepend: css`
${logicalCSS('border-top-left-radius', 'inherit')}
${logicalCSS('border-bottom-left-radius', 'inherit')}
& > ${buttons}, & > * > ${buttons} {
${logicalCSS('border-top-right-radius', 0)}
${logicalCSS('border-bottom-right-radius', 0)}
}
& > ${buttons}:not(:first-child),
& > *:not(:first-child) > ${buttons} {
${logicalCSS('border-top-left-radius', 0)}
${logicalCSS('border-bottom-left-radius', 0)}
}
`,
uncompressed: `
${text} {
Expand Down

0 comments on commit ea5830a

Please sign in to comment.