From b576a15a30e4465082c87ba780e794a571aa0d16 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Mon, 5 Aug 2024 23:10:36 +0200 Subject: [PATCH] Add CSS for tables - h/t Luiz Amaral --- themes/hugo-theme-ipng/assets/styles.scss | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/themes/hugo-theme-ipng/assets/styles.scss b/themes/hugo-theme-ipng/assets/styles.scss index 52a5b2b..30c3873 100644 --- a/themes/hugo-theme-ipng/assets/styles.scss +++ b/themes/hugo-theme-ipng/assets/styles.scss @@ -21,6 +21,8 @@ $code-text: #f8f8f2; $ipng-orange: #f46524; $ipng-darkorange: #8c1919; $ipng-lightorange: #fb8c00; +$table-header-background: #ffdcca; +$table-cell-background: #fafafa; // Breakpoints $bp-mini: 28em; // 288px @@ -746,3 +748,28 @@ cite { text-decoration: none; cursor: pointer; } + +table { + margin-bottom: 1em; + width: 100%; + text-align: left; + border-collapse: separate; + border-radius: 1em; + border: 2px solid $ipng-orange; + tr { + &:nth-child(even) { + background-color: darken($table-cell-background, 10%); + } + } + th, td { + padding: 0.15em 0.5em; + } + th { + color: $ipng-orange; + background-color: lighten($table-header-background, 3%); + border-bottom: 3px solid $ipng-orange; + font-weight: bold; + } + td { + } +}