PluginProbe
TablePress – Tables in WordPress made easy / 3.0
TablePress – Tables in WordPress made easy v3.0
3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 2.4.4 All 44 releases
tablepress / css / _default-datatables.scss

_default-datatables.scss in TablePress – Tables in WordPress made easy 3.0, at css/_default-datatables.scss

251 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * TablePress Default CSS - DataTables-related code.
3 *
4 * Attention: Do not modify this file directly, but use the "Custom CSS" textarea
5 * on the "Plugin Options" screen of TablePress.
6 *
7 * @package TablePress
8 * @subpackage Frontend CSS
9 * @author Tobias Bäthge, Allan Jardine
10 * @since 1.0.0
11 */
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 /* Default variables for the LTR CSS. */
20 $align-side: left;
21 $align-side-opposite: right;
22
23 /* Variables for the RTL CSS. */
24 @if "rtl" == $direction {
25 $align-side: right;
26 $align-side-opposite: left;
27 }
28
29 /* Scrolling. */
30 .dt-scroll {
31 width: 100%;
32
33 /* Fix for wrong alignment and width. */
34 .tablepress {
35 width: 100% !important;
36 }
37 }
38
39 div.dt-scroll-body {
40 thead,
41 tfoot {
42 tr {
43 height: 0;
44
45 th {
46 height: 0 !important;
47 padding-top: 0 !important;
48 padding-bottom: 0 !important;
49 border-top-width: 0 !important;
50 border-bottom-width: 0 !important;
51
52 div.dt-scroll-sizing {
53 height: 0 !important;
54 overflow: hidden !important;
55 }
56 }
57 }
58 }
59 }
60
61 div.dt-scroll-body > table.dataTable > thead > tr > th {
62 overflow: hidden;
63 }
64
65 /* Sorting. */
66 .tablepress {
67 /* Custom properties */
68 --head-active-bg-color: #049cdb;
69 --head-active-text-color: var(--head-text-color);
70 --head-sort-arrow-color: var(--head-active-text-color);
71
72 thead {
73 th:active {
74 outline: none;
75 }
76
77 .dt-orderable-asc,
78 .dt-ordering-asc {
79 .dt-column-order:before {
80 position: absolute;
81 display: block;
82 bottom: 50%;
83 content: "\25b2" / "";
84 }
85 }
86
87 .dt-orderable-desc,
88 .dt-ordering-desc {
89 .dt-column-order:after {
90 position: absolute;
91 display: block;
92 top: 50%;
93 content: "\25bc" / "";
94 }
95 }
96
97 .dt-orderable-asc,
98 .dt-orderable-desc,
99 .dt-ordering-asc,
100 .dt-ordering-desc {
101 position: relative;
102 padding-#{$align-side-opposite}: 24px;
103
104 .dt-column-order {
105 position: absolute;
106 #{$align-side-opposite}: 6px;
107 top: 0;
108 bottom: 0;
109 width: 12px;
110 color: var(--head-sort-arrow-color);
111
112 &:before,
113 &:after {
114 opacity: 0.2;
115 line-height: 12px;
116 font-size: 12px;
117 font-family: sans-serif !important;
118 }
119 }
120 }
121
122 .dt-orderable-asc,
123 .dt-orderable-desc {
124 cursor: pointer;
125 outline-offset: -2px;
126
127 &:hover {
128 background-color: var(--head-active-bg-color);
129 color: var(--head-active-text-color);
130 }
131 }
132
133 .dt-ordering-asc,
134 .dt-ordering-desc {
135 background-color: var(--head-active-bg-color);
136 color: var(--head-active-text-color);
137 }
138
139 .dt-ordering-asc .dt-column-order:before,
140 .dt-ordering-desc .dt-column-order:after {
141 opacity: 0.8;
142 }
143 }
144 }
145
146 /* Automatic data type alignment. */
147 .tablepress:where(.auto-type-alignment) {
148 .dt-type-numeric,
149 .dt-type-date,
150 /* .dt-right is used for custom dates. */
151 .dt-right {
152 text-align: $align-side-opposite;
153 }
154 }
155
156 /* Element positioning. */
157 .dt-container {
158 position: relative;
159 clear: both;
160 margin-bottom: 1rem;
161
162 .tablepress {
163 margin-bottom: 0;
164 }
165
166 .dt-layout-row {
167 display: flex;
168 flex-wrap: wrap;
169 flex-direction: row;
170 justify-content: space-between;
171
172 &.dt-layout-table {
173 .dt-layout-cell {
174 display: block;
175 width: 100%;
176 }
177 }
178 }
179
180 .dt-layout-cell {
181 display: flex;
182 flex-wrap: wrap;
183 flex-direction: row;
184 gap: 1em;
185 padding: 5px 0;
186
187 &.dt-layout-full {
188 justify-content: space-between;
189 align-items: center;
190 width: 100%;
191
192 > *:only-child {
193 margin: auto;
194 }
195 }
196
197 &.dt-layout-start {
198 justify-content: flex-start;
199 align-items: center;
200 margin-right: auto;
201 }
202
203 &.dt-layout-end {
204 justify-content: flex-end;
205 align-items: center;
206 margin-left: auto;
207 }
208
209 &:empty {
210 display: none;
211 }
212 }
213
214 label {
215 display: inline;
216 }
217
218 /* Input and select fields. */
219 .dt-input {
220 display: inline;
221 padding: 5px;
222 width: auto;
223 font-size: inherit;
224 }
225
226 /* Search field. */
227 .dt-search {
228 display: flex;
229 flex-wrap: wrap;
230 justify-content: center;
231 align-items: center;
232 gap: 5px;
233 }
234
235 /* Pagination. */
236 @include default-datatables-pagination.dt-paging;
237 }
238
239 @media screen and (max-width: 767px) {
240 .dt-container {
241 .dt-layout-row {
242 flex-direction: column;
243 }
244
245 .dt-layout-cell {
246 flex-direction: column;
247 padding: 0.5em 0;
248 }
249 }
250 }
251