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

Convert cell styles to Emotion (row cells, header/footer cells, & cell checkboxes) #7631

Merged
merged 15 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ exports[`sorting renders a button with onSort 1`] = `
scope="col"
>
<button
class="euiTableHeaderButton euiTableHeaderButton-isSorted"
class="euiTableHeaderButton euiTableHeaderButton-isSorted emotion-euiTableHeaderCell__button"
data-test-subj="tableHeaderSortButton"
type="button"
>
Expand Down
27 changes: 0 additions & 27 deletions src/components/table/_table.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
.euiTableHeaderButton {
@include euiFontSizeS;
color: inherit;
width: 100%;

&:hover,
&:focus {
.euiTableCellContent__text {
text-decoration: underline;
color: $euiColorPrimary;
}

.euiTableSortIcon {
fill: $euiColorPrimary;
}
}
}

.euiTableSortIcon {
JasonStoltz marked this conversation as resolved.
Show resolved Hide resolved
margin-left: $euiSizeXS;
flex-shrink: 0; // makes sure the icon doesn't change size because the text is long

.euiTableHeaderButton-isSorted & {
fill: $euiTitleColor;
}
}

.euiTableRow-isExpandedRow {
&.euiTableRow-isSelectable .euiTableCellContent {
padding-left: $euiTableCellCheckboxWidth + $euiTableCellContentPadding;
Expand Down
13 changes: 13 additions & 0 deletions src/components/table/table_cells_shared.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ export const euiTableHeaderFooterCellStyles = (
gap: ${euiTheme.size.xs};
}
`,
euiTableHeaderCell__button: css`
${logicalCSS('width', '100%')}
font-weight: inherit;

&:hover,
&:focus {
color: ${euiTheme.colors.primaryText};

.euiTableCellContent__text {
text-decoration: underline;
}
}
`,
euiTableFooterCell: css`
${sharedStyles}
background-color: ${euiTheme.colors.lightestShade};
Expand Down
1 change: 1 addition & 0 deletions src/components/table/table_header_cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export const EuiTableHeaderCell: FunctionComponent<EuiTableHeaderCellProps> = ({
{onSort && !readOnly ? (
<button
type="button"
css={styles.euiTableHeaderCell__button}
className={buttonClasses}
onClick={onSort}
data-test-subj="tableHeaderSortButton"
Expand Down