diff options
author | Oscar Najera <hi@oscarnajera.com> | 2025-05-02 19:54:37 +0200 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2025-05-02 19:54:37 +0200 |
commit | 992194bdb793ca7a98563aee23ea452a71330d13 (patch) | |
tree | eb3fa610a30f1f6351a0d2e8f10b5de9f69aca0c | |
parent | 9deaf6143846049e6b3d1c3d1d3ea830132a82c2 (diff) | |
download | hugo-minimalist-theme-992194bdb793ca7a98563aee23ea452a71330d13.tar.gz hugo-minimalist-theme-992194bdb793ca7a98563aee23ea452a71330d13.tar.bz2 hugo-minimalist-theme-992194bdb793ca7a98563aee23ea452a71330d13.zip |
CSS for tables
-rw-r--r-- | assets/css/input.css | 19 | ||||
-rw-r--r-- | assets/css/tailwind.css | 47 |
2 files changed, 66 insertions, 0 deletions
diff --git a/assets/css/input.css b/assets/css/input.css index 9f03d8d..102ccd1 100644 --- a/assets/css/input.css +++ b/assets/css/input.css @@ -165,6 +165,25 @@ } } + /* Tables */ + .table-caption:has(+ table) { + @apply text-center block; + } + + table:not(.u-legend) { + @apply w-full whitespace-nowrap py-2 border-b border-gray-500; + thead { + @apply bg-lime-100; + } + tbody tr { + @apply even:bg-gray-50; + } + th, + td { + @apply px-3 py-2; + } + } + /* https://lubna.dev/articles/create-css-only-image-gallery/ */ .gallery { --max-img-width: 72rem; diff --git a/assets/css/tailwind.css b/assets/css/tailwind.css index fbae38f..bbe27cb 100644 --- a/assets/css/tailwind.css +++ b/assets/css/tailwind.css @@ -971,6 +971,41 @@ h6 { } } +/* Tables */ + +.table-caption:has(+ table) { + display: block; + text-align: center; +} + +table:not(.u-legend) { + width: 100%; + white-space: nowrap; + border-bottom-width: 1px; + --tw-border-opacity: 1; + border-color: rgb(107 114 128 / var(--tw-border-opacity, 1)); + padding-top: 0.5rem; + padding-bottom: 0.5rem; + thead { + --tw-bg-opacity: 1; + background-color: rgb(236 252 203 / var(--tw-bg-opacity, 1)); + } + tbody tr:nth-child(even) { + --tw-bg-opacity: 1; + background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1)); + } + th, + td { + padding-left: 0.75rem; + padding-right: 0.75rem; + } + th, + td { + padding-top: 0.5rem; + padding-bottom: 0.5rem; + } +} + /* https://lubna.dev/articles/create-css-only-image-gallery/ */ .gallery { @@ -1119,6 +1154,18 @@ h6 { display: flex; } +.table { + display: table; +} + +.table-caption { + display: table-caption; +} + +.grid { + display: grid; +} + .contents { display: contents; } |