| 1 |
/** |
| 2 |
* TablePress Default CSS - Core CSS without DataTables styling. |
| 3 |
* |
| 4 |
* @package TablePress |
| 5 |
* @subpackage Frontend CSS |
| 6 |
* @author Tobias Bäthge |
| 7 |
* @since 1.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
/* Default toggle variable for LTR and RTL CSS. */ |
| 11 |
$direction: "ltr" !default; |
| 12 |
|
| 13 |
/* Default variables for the LTR CSS. */ |
| 14 |
$align-side: left; |
| 15 |
|
| 16 |
/* Variables for the RTL CSS. */ |
| 17 |
@if "rtl" == $direction { |
| 18 |
$align-side: right; |
| 19 |
} |
| 20 |
|
| 21 |
.tablepress { |
| 22 |
/* Custom properties. */ |
| 23 |
--text-color: #111111; |
| 24 |
--head-text-color: var(--text-color); |
| 25 |
--head-bg-color: #d9edf7; |
| 26 |
--odd-text-color: var(--text-color); |
| 27 |
--odd-bg-color: #ffffff; |
| 28 |
--even-text-color: var(--text-color); |
| 29 |
--even-bg-color: #f9f9f9; |
| 30 |
--hover-text-color: var(--text-color); |
| 31 |
--hover-bg-color: #f3f3f3; |
| 32 |
--border-color: #dddddd; |
| 33 |
--padding: 0.5rem; |
| 34 |
|
| 35 |
/* General table style. */ |
| 36 |
table-layout: auto; |
| 37 |
width: 100%; |
| 38 |
margin: 0 auto 1rem; |
| 39 |
clear: both; |
| 40 |
border-collapse: collapse; |
| 41 |
border-spacing: 0; |
| 42 |
border: none; |
| 43 |
|
| 44 |
/* General table cell style. */ |
| 45 |
> :not(caption) > * > * { |
| 46 |
padding: var(--padding); |
| 47 |
border: none; |
| 48 |
background: none; |
| 49 |
text-align: $align-side; |
| 50 |
vertical-align: top; |
| 51 |
float: none !important; /* Work around themes that set `float` on `.column-1` CSS classes and similar. */ |
| 52 |
box-sizing: border-box; |
| 53 |
} |
| 54 |
|
| 55 |
/* Horizontal borders, except for child rows in the tbody. */ |
| 56 |
> :where(thead) + tbody > :where(:not(.child)) > *, |
| 57 |
> tbody > * ~ :where(:not(.child)) > *, |
| 58 |
> tfoot > :where(:first-child) > * { |
| 59 |
border-top: 1px solid var(--border-color); |
| 60 |
} |
| 61 |
|
| 62 |
/* Row background colors. */ |
| 63 |
> :where(thead, tfoot) > tr > * { |
| 64 |
background-color: var(--head-bg-color); |
| 65 |
color: var(--head-text-color); |
| 66 |
font-weight: bold; |
| 67 |
word-break: normal; |
| 68 |
vertical-align: middle; |
| 69 |
} |
| 70 |
> :where(tbody) { |
| 71 |
> tr > * { |
| 72 |
color: var(--text-color); |
| 73 |
} |
| 74 |
} |
| 75 |
> :where(tbody.row-striping) { |
| 76 |
> :nth-child(odd of :where(:not(.child, .dtrg-group))) { /* Ignore child and group rows. */ |
| 77 |
> *, |
| 78 |
+ :where(.child) > * { /* Give child rows the same style. */ |
| 79 |
background-color: var(--odd-bg-color); |
| 80 |
color: var(--odd-text-color); |
| 81 |
} |
| 82 |
} |
| 83 |
> :nth-child(even of :where(:not(.child, .dtrg-group))) { /* Ignore child and group rows. */ |
| 84 |
> *, |
| 85 |
+ :where(.child) > * { /* Give child rows the same style. */ |
| 86 |
background-color: var(--even-bg-color); |
| 87 |
color: var(--even-text-color); |
| 88 |
} |
| 89 |
} |
| 90 |
} |
| 91 |
> .row-hover > tr { |
| 92 |
content-visibility: auto; /* Improve rendering performance for the :has(+ .child:hover) selector below. */ |
| 93 |
|
| 94 |
&:where(:not(.dtrg-group)):hover > *, /* Ignore group rows. */ |
| 95 |
&:hover + :where(.child) > *, /* Give child rows the same style. */ |
| 96 |
&:has(+ .child:hover) > * { /* Highlight the parent row when a child row is hovered. */ |
| 97 |
background-color: var(--hover-bg-color); |
| 98 |
color: var(--hover-text-color); |
| 99 |
} |
| 100 |
} |
| 101 |
|
| 102 |
/* Reset image layout in tables. */ |
| 103 |
img { |
| 104 |
margin: 0; |
| 105 |
padding: 0; |
| 106 |
border: none; |
| 107 |
max-width: none; |
| 108 |
} |
| 109 |
|
| 110 |
/* Table description. */ |
| 111 |
&-table-description { |
| 112 |
clear: both; |
| 113 |
display: block; |
| 114 |
} |
| 115 |
} |
| 116 |
|