mirror of
https://github.com/nostalgic-css/NES.css.git
synced 2025-08-31 17:51:46 +02:00
feat(table): add dark theme to tables
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
.table {
|
||||
display: block;
|
||||
table-layout: fixed;
|
||||
background-color: #fff;
|
||||
|
||||
&.is-centered th {
|
||||
text-align: center;
|
||||
}
|
||||
&.is-bordered {
|
||||
box-shadow: 4px 0 $base-color, 0 -4px $base-color, -4px 0 $base-color, 0 4px $base-color;
|
||||
|
||||
@mixin thsAndTdsBoxShadow($color) {
|
||||
th,
|
||||
td {
|
||||
padding: 0.5rem;
|
||||
@@ -16,14 +11,51 @@
|
||||
|
||||
tr {
|
||||
th + th {
|
||||
box-shadow: -4px 0 $base-color;
|
||||
box-shadow: -4px 0 $color;
|
||||
}
|
||||
td {
|
||||
box-shadow: 0 -4px $base-color;
|
||||
box-shadow: 0 -4px $color;
|
||||
}
|
||||
td:not(:first-child) {
|
||||
box-shadow: -4px 0 $base-color, 0 -4px $base-color;
|
||||
box-shadow: -4px 0 $color, 0 -4px $color;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.is-centered th {
|
||||
text-align: center;
|
||||
}
|
||||
&.is-bordered {
|
||||
box-shadow: 4px 0 $base-color, 0 -4px $base-color, -4px 0 $base-color, 0 4px $base-color;
|
||||
@include thsAndTdsBoxShadow($base-color);
|
||||
}
|
||||
&.is-dark {
|
||||
position: relative;
|
||||
color: $background-color;
|
||||
background-color: $base-color;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
content: "";
|
||||
}
|
||||
|
||||
&::before {
|
||||
top: 2px;
|
||||
right: 2px;
|
||||
bottom: 2px;
|
||||
left: 2px;
|
||||
background-color: $base-color;
|
||||
}
|
||||
|
||||
&::after {
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
border: 4px solid #fff;
|
||||
}
|
||||
@include thsAndTdsBoxShadow(#fff);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user