feat(scss): add table style

Style taken from: https://github.com/lepture/yue.css

closes: https://github.com/CaiJimmy/hugo-theme-stack/issues/3
This commit is contained in:
Jimmy Cai 2020-09-08 12:48:34 +02:00
parent fd816ca9ef
commit 0e0f5edbec
No known key found for this signature in database
GPG key ID: 3EA408E527F37B18
2 changed files with 31 additions and 0 deletions

View file

@ -287,4 +287,29 @@
box-shadow: 0px -10px 0px rgba(var(--link-background-color), var(--link-background-opacity-hover)) inset;
}
}
table {
margin: 0 var(--content-padding);
width: 100%;
max-width: calc(100% - var(--content-padding) * 2);
border-collapse: collapse;
border-spacing: 0;
margin-bottom: 1.5em;
font-size: 0.96em;
}
th,
td {
text-align: left;
padding: 4px 8px 4px 10px;
border: 1px solid var(--table-border-color);
}
td {
vertical-align: top;
}
tr:nth-child(even) {
background-color: var(--tr-even-background-color);
}
}

View file

@ -79,6 +79,9 @@ $on-desktop-large: 1920px;
--code-background-color: rgba(0, 0, 0, 0.12);
--code-text-color: #808080;
--table-border-color: #dadada;
--tr-even-background-color: #efefee;
}
@media (prefers-color-scheme: dark) {
@ -99,5 +102,8 @@ $on-desktop-large: 1920px;
--code-background-color: #272822;
--code-text-color: rgba(255, 255, 255, 0.9);
--table-border-color: #717171;
--tr-even-background-color: #545454;
}
}