| 1 |
/** |
| 2 |
* TablePress Default CSS - DataTables-related code. |
| 3 |
* |
| 4 |
* @package TablePress |
| 5 |
* @subpackage Frontend CSS |
| 6 |
* @author Tobias Bäthge, Allan Jardine |
| 7 |
* @since 1.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
// Load the Sass string module, for use in the `unicode` function. |
| 11 |
@use "sass:string"; |
| 12 |
|
| 13 |
/* Default toggle variable for LTR and RTL CSS. */ |
| 14 |
$direction: "ltr" !default; |
| 15 |
|
| 16 |
/* Import DataTables pagination code. */ |
| 17 |
@use "default-datatables-pagination" with ($direction: $direction); |
| 18 |
|
| 19 |
// Ensure that Unicode characters are embedded in ASCII-encoded form. |
| 20 |
@function unicode($str) { |
| 21 |
@return string.unquote("\"") + string.unquote(string.insert($str, "\\", 1)) + string.unquote("\""); |
| 22 |
} |
| 23 |
|
| 24 |
/* Default variables for the LTR CSS. */ |
| 25 |
$align-side: left; |
| 26 |
$align-side-opposite: right; |
| 27 |
|
| 28 |
/* Variables for the RTL CSS. */ |
| 29 |
@if "rtl" == $direction { |
| 30 |
$align-side: right; |
| 31 |
$align-side-opposite: left; |
| 32 |
} |
| 33 |
|
| 34 |
/* Scrolling. */ |
| 35 |
.dt-scroll { |
| 36 |
width: 100%; |
| 37 |
|
| 38 |
/* Fix for wrong alignment and width. */ |
| 39 |
.tablepress { |
| 40 |
width: 100% !important; |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
div.dt-scroll-body { |
| 45 |
thead, |
| 46 |
tfoot { |
| 47 |
tr { |
| 48 |
height: 0; |
| 49 |
|
| 50 |
th, |
| 51 |
td { |
| 52 |
height: 0 !important; |
| 53 |
padding-top: 0 !important; |
| 54 |
padding-bottom: 0 !important; |
| 55 |
border-top-width: 0 !important; |
| 56 |
border-bottom-width: 0 !important; |
| 57 |
|
| 58 |
div.dt-scroll-sizing { |
| 59 |
height: 0 !important; |
| 60 |
overflow: hidden !important; |
| 61 |
} |
| 62 |
} |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
> table.dataTable > thead > tr { |
| 67 |
> th, |
| 68 |
> td { |
| 69 |
overflow: hidden; |
| 70 |
} |
| 71 |
} |
| 72 |
} |
| 73 |
|
| 74 |
/* Sorting. */ |
| 75 |
.tablepress { |
| 76 |
/* Custom properties. */ |
| 77 |
--head-active-bg-color: #049cdb; |
| 78 |
--head-active-text-color: var(--head-text-color); |
| 79 |
--head-sort-arrow-color: var(--head-active-text-color); |
| 80 |
|
| 81 |
thead { |
| 82 |
th:active { |
| 83 |
outline: none; |
| 84 |
} |
| 85 |
|
| 86 |
.dt-orderable-asc, |
| 87 |
.dt-ordering-asc { |
| 88 |
.dt-column-order:before { |
| 89 |
position: absolute; |
| 90 |
display: block; |
| 91 |
bottom: 50%; |
| 92 |
content: unicode("25b2"); |
| 93 |
content: unicode("25b2") / ""; |
| 94 |
} |
| 95 |
} |
| 96 |
|
| 97 |
.dt-orderable-desc, |
| 98 |
.dt-ordering-desc { |
| 99 |
.dt-column-order:after { |
| 100 |
position: absolute; |
| 101 |
display: block; |
| 102 |
top: 50%; |
| 103 |
content: unicode("25bc"); |
| 104 |
content: unicode("25bc") / ""; |
| 105 |
} |
| 106 |
} |
| 107 |
|
| 108 |
.dt-orderable-asc, |
| 109 |
.dt-orderable-desc, |
| 110 |
.dt-ordering-asc, |
| 111 |
.dt-ordering-desc { |
| 112 |
.dt-column-order { |
| 113 |
position: relative; |
| 114 |
width: 12px; |
| 115 |
height: 24px; |
| 116 |
color: var(--head-sort-arrow-color); |
| 117 |
line-height: 12px; |
| 118 |
font-size: 14px; |
| 119 |
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif !important; |
| 120 |
|
| 121 |
&:before, |
| 122 |
&:after { |
| 123 |
opacity: 0.2; |
| 124 |
} |
| 125 |
} |
| 126 |
} |
| 127 |
|
| 128 |
.dt-orderable-asc, |
| 129 |
.dt-orderable-desc { |
| 130 |
cursor: pointer; |
| 131 |
outline-offset: -2px; |
| 132 |
|
| 133 |
&:hover { |
| 134 |
background-color: var(--head-active-bg-color); |
| 135 |
color: var(--head-active-text-color); |
| 136 |
} |
| 137 |
} |
| 138 |
|
| 139 |
.dt-ordering-asc, |
| 140 |
.dt-ordering-desc { |
| 141 |
background-color: var(--head-active-bg-color); |
| 142 |
color: var(--head-active-text-color); |
| 143 |
} |
| 144 |
|
| 145 |
.dt-ordering-asc .dt-column-order:before, |
| 146 |
.dt-ordering-desc .dt-column-order:after { |
| 147 |
opacity: 0.8; |
| 148 |
} |
| 149 |
} |
| 150 |
|
| 151 |
thead, |
| 152 |
tfoot { |
| 153 |
> tr > * { |
| 154 |
.dt-column-header, |
| 155 |
.dt-column-footer { |
| 156 |
display: flex; |
| 157 |
justify-content: space-between; |
| 158 |
align-items: center; |
| 159 |
gap: 4px; |
| 160 |
|
| 161 |
.dt-column-title { |
| 162 |
flex-grow: 1; |
| 163 |
|
| 164 |
&:empty { |
| 165 |
display: none; |
| 166 |
} |
| 167 |
} |
| 168 |
} |
| 169 |
} |
| 170 |
} |
| 171 |
} |
| 172 |
|
| 173 |
/* Automatic data type alignment. */ |
| 174 |
.tablepress:where(.auto-type-alignment) { |
| 175 |
.dt-type-numeric, |
| 176 |
.dt-type-date, |
| 177 |
/* .dt-right is used for custom dates. */ |
| 178 |
.dt-right { |
| 179 |
text-align: $align-side-opposite; |
| 180 |
|
| 181 |
.dt-column-header, |
| 182 |
.dt-column-footer { |
| 183 |
flex-direction: row-reverse; |
| 184 |
} |
| 185 |
} |
| 186 |
} |
| 187 |
|
| 188 |
/* Element positioning. */ |
| 189 |
.dt-container { |
| 190 |
position: relative; |
| 191 |
clear: both; |
| 192 |
margin-bottom: 1rem; |
| 193 |
|
| 194 |
table.tablepress { |
| 195 |
margin-bottom: 0; |
| 196 |
|
| 197 |
} |
| 198 |
|
| 199 |
.dt-layout-row { |
| 200 |
display: flex; |
| 201 |
flex-wrap: wrap; |
| 202 |
flex-direction: row; |
| 203 |
justify-content: space-between; |
| 204 |
|
| 205 |
&.dt-layout-table { |
| 206 |
.dt-layout-cell { |
| 207 |
display: block; |
| 208 |
width: 100%; |
| 209 |
} |
| 210 |
} |
| 211 |
} |
| 212 |
|
| 213 |
.dt-layout-cell { |
| 214 |
display: flex; |
| 215 |
flex-wrap: wrap; |
| 216 |
flex-direction: row; |
| 217 |
gap: 1em; |
| 218 |
padding: 5px 0; |
| 219 |
|
| 220 |
&.dt-layout-full { |
| 221 |
justify-content: space-between; |
| 222 |
align-items: center; |
| 223 |
width: 100%; |
| 224 |
|
| 225 |
> *:only-child { |
| 226 |
margin: auto; |
| 227 |
} |
| 228 |
} |
| 229 |
|
| 230 |
&.dt-layout-start { |
| 231 |
justify-content: flex-start; |
| 232 |
align-items: center; |
| 233 |
margin-right: auto; |
| 234 |
} |
| 235 |
|
| 236 |
&.dt-layout-end { |
| 237 |
justify-content: flex-end; |
| 238 |
align-items: center; |
| 239 |
margin-left: auto; |
| 240 |
} |
| 241 |
|
| 242 |
&:empty { |
| 243 |
display: none; |
| 244 |
} |
| 245 |
} |
| 246 |
|
| 247 |
label { |
| 248 |
display: inline; |
| 249 |
width: auto; |
| 250 |
} |
| 251 |
|
| 252 |
/* Input and select fields. */ |
| 253 |
.dt-input { |
| 254 |
display: inline; |
| 255 |
padding: 5px; |
| 256 |
width: auto; |
| 257 |
font-size: inherit; |
| 258 |
} |
| 259 |
|
| 260 |
/* Search and Length Change fields. */ |
| 261 |
.dt-search, |
| 262 |
.dt-length { |
| 263 |
display: flex; |
| 264 |
flex-wrap: wrap; |
| 265 |
justify-content: center; |
| 266 |
align-items: center; |
| 267 |
gap: 5px; |
| 268 |
} |
| 269 |
|
| 270 |
/* Pagination. */ |
| 271 |
@include default-datatables-pagination.dt-paging; |
| 272 |
} |
| 273 |
|
| 274 |
@media screen and (max-width: 767px) { |
| 275 |
.dt-container { |
| 276 |
.dt-layout-row { |
| 277 |
flex-direction: column; |
| 278 |
} |
| 279 |
|
| 280 |
.dt-layout-cell { |
| 281 |
flex-direction: column; |
| 282 |
padding: 0.5em 0; |
| 283 |
} |
| 284 |
} |
| 285 |
} |
| 286 |
|