Skip to content

Commit

Permalink
Improve the look of tables (#1299)
Browse files Browse the repository at this point in the history
* feat(css): remove table styling that overrides bootstrap

* feat(utils): style MD tables appropriately with bootstrap class
  • Loading branch information
ayan4m1 authored Jun 15, 2023
1 parent f2db901 commit 79f4009
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
24 changes: 0 additions & 24 deletions src/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,6 @@
overflow-x: auto;
}

.md-div table {
border-collapse: collapse;
width: 100%;
margin-bottom: 1rem;
border: 1px solid var(--dark);
}

.md-div table th,
.md-div table td {
padding: 0.3rem;
vertical-align: top;
border-top: 1px solid var(--dark);
border: 1px solid var(--dark);
}

.md-div table thead th {
vertical-align: bottom;
border-bottom: 2px solid var(--dark);
}

.md-div table tbody + tbody {
border-top: 2px solid var(--dark);
}

.vote-bar {
margin-top: -6.5px;
}
Expand Down
5 changes: 4 additions & 1 deletion src/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ function setupMarkdown() {
defs: emojiDefs,
})
.disable("image");
var defaultRenderer = md.renderer.rules.image;
const defaultRenderer = md.renderer.rules.image;
md.renderer.rules.image = function (
tokens: Token[],
idx: number,
Expand All @@ -758,6 +758,9 @@ function setupMarkdown() {
const alt_text = item.content;
return `<img class="icon icon-emoji" src="${src}" title="${title}" alt="${alt_text}"/>`;
};
md.renderer.rules.table_open = function () {
return '<table class="table">';
};
}

export function getEmojiMart(
Expand Down

0 comments on commit 79f4009

Please sign in to comment.