From 311df598903889f796f0e717dc76ce6b6332c679 Mon Sep 17 00:00:00 2001 From: Giulia Ghisini Date: Tue, 3 Dec 2024 11:58:29 +0100 Subject: [PATCH] fix: table styles in edit mode --- src/theme/_cms-ui.scss | 42 +++++++++++++++++++++++++++++++++++ src/theme/extras/_tables.scss | 25 ++++++++++----------- 2 files changed, 54 insertions(+), 13 deletions(-) diff --git a/src/theme/_cms-ui.scss b/src/theme/_cms-ui.scss index cf8f9b59a..7f3f0464b 100644 --- a/src/theme/_cms-ui.scss +++ b/src/theme/_cms-ui.scss @@ -74,6 +74,48 @@ body.cms-ui { .block.text { line-height: 1.555; } + + &.table { + @import 'bootstrap/scss/reboot'; + @import 'bootstrap/scss/tables'; + @import 'bootstrap-italia/src/scss/custom/tables'; + @import 'extras/tables'; + + .ui.table { + &.inverted { + th, + td { + border-color: inherit !important; + } + } + thead th { + font-weight: bold; + text-transform: unset; + color: var(--bs-table-color); + } + + &.very.basic { + &:not(.sortable):not(.striped) { + th:first-child, + td:first-child { + padding-left: 0.5rem; + } + thead tr:first-child th { + padding-top: 0.5rem; + } + td:last-child { + padding-right: 0.5rem; + } + } + } + + &.striped { + tbody tr:nth-child(2n) { + background-color: rgba(0, 0, 50, 0.02) !important; + } + } + } + } } &.contenttype-document, diff --git a/src/theme/extras/_tables.scss b/src/theme/extras/_tables.scss index d0cb834e5..17573f205 100644 --- a/src/theme/extras/_tables.scss +++ b/src/theme/extras/_tables.scss @@ -20,31 +20,30 @@ &.very.basic { border: none; - tbody > tr { + th, + td { &:first-of-type { - th, - td { - border-top: none; - } + border-left: none; } &:last-of-type { + border-right: none; + } + } + + tbody > tr { + &:first-of-type { th, td { - border-bottom: none; + border-top: none; } } th, td { - &:first-of-type { - border-left: none; - } - - &:last-of-type { - border-right: none; - } + border-bottom: none; } + border-width: 0; } }