Skip to content

Commit

Permalink
Merge pull request #35 from prezly/fix/mt-5190-table-looks-bad-in-mar…
Browse files Browse the repository at this point in the history
…cel-theme

[MT-5190] Fix - Table looks bad in marcel theme
  • Loading branch information
e1himself authored Jul 25, 2022
2 parents aac739b + 4b22ec4 commit 4ce7a95
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
18 changes: 11 additions & 7 deletions src/elements/Table/Table.scss
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
@import "styles/variables";

.prezly-table {
.prezly-slate-table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;

&--withBorders {
.prezly-table-row,
.prezly-table-cell {
.prezly-slate-table-row,
.prezly-slate-table-cell {
border: 1px solid $color-grey-300;
}
}
}

.prezly-table-row {
.prezly-slate-table-row {
color: $color-grey-700;
font-size: $font-size-s;
}

.prezly-table-cell {
.prezly-slate-table-cell {
min-width: 40px;
min-height: 40px;
padding: $spacing-1-5;
outline: none !important;

> p {
margin: 0;
> *:first-child {
margin-top: 0;
}

> *:last-child {
margin-bottom: 0;
}

&--header {
Expand Down
4 changes: 2 additions & 2 deletions src/elements/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export function Table({ children, node }: Props) {
return (
<TableContextProvider table={node}>
<table
className={classNames('prezly-table', {
['prezly-table--withBorders']: node.border,
className={classNames('prezly-slate-table', {
['prezly-slate-table--withBorders']: node.border,
})}
>
<tbody>{children}</tbody>
Expand Down
4 changes: 2 additions & 2 deletions src/elements/Table/TableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export function TableCell({ children, node }: Props) {

return (
<Cell
className={classNames('prezly-table-cell', {
['prezly-table-cell--header']: isHeaderCell,
className={classNames('prezly-slate-table-cell', {
['prezly-slate-table-cell--header']: isHeaderCell,
})}
colSpan={node.colspan}
rowSpan={node.rowspan}
Expand Down
2 changes: 1 addition & 1 deletion src/elements/Table/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ interface Props extends HTMLAttributes<HTMLTableCellElement> {
}

export function TableRow({ children }: Props) {
return <tr className="prezly-table-row">{children}</tr>;
return <tr className="prezly-slate-table-row">{children}</tr>;
}

0 comments on commit 4ce7a95

Please sign in to comment.