| @@ -6,8 +6,26 @@ | ||
| 6 | 6 | * @author Tobias Bäthge |
| 7 | 7 | * @since 1.0.0 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | +// Load the Sass string module, for use in the `unicode` function. | |
| 11 | +@use "sass:string"; | |
| 12 | + | |
| 13 | +/* Load WordPress color schemes, which normally are only loaded on WP admin screens that use the block editor. This and the dependency in package.json are only needed for WP < 6.9. */ | |
| 14 | +@use "~@wordpress/base-styles/colors"; | |
| 15 | +@use "~@wordpress/base-styles/mixins"; | |
| 16 | +@include mixins.wordpress-admin-schemes(); | |
| 17 | + | |
| 18 | +// Ensure that Unicode characters are embedded in ASCII-encoded form. | |
| 19 | +@function unicode($str) { | |
| 20 | + @return string.unquote("\"") + string.unquote(string.insert($str, "\\", 1)) + string.unquote("\""); | |
| 21 | +} | |
| 22 | + | |
| 23 | +/* Hour glass cursor, while waiting for AJAX requests. */ | |
| 24 | +body.wait * { | |
| 25 | + cursor: wait !important; | |
| 26 | +} | |
| 27 | + | |
| 10 | 28 | /* Move down the header when the Screen Options or Help tabs are opened. */ |
| 11 | 29 | #screen-meta[style$="block;"] ~ #tablepress-page { |
| 12 | 30 | margin-top: 40px; |
| 13 | 31 | } |
| @@ -21,15 +39,15 @@ | ||
| 21 | 39 | |
| 22 | 40 | #tablepress-page { |
| 23 | 41 | margin: 0 0 0 -20px; |
| 24 | 42 | |
| 25 | - /* Add space between WP core update nag and header navigation. */ | |
| 26 | - .update-nag ~ & { | |
| 27 | - margin-top: 25px; | |
| 43 | + #tablepress-body { | |
| 44 | + padding: 0 20px; | |
| 28 | 45 | } |
| 29 | 46 | |
| 30 | - #tablepress-body { | |
| 31 | - padding: 0 20px; | |
| 47 | + /* Metabox titles should have the same height, with and without the "?" button. */ | |
| 48 | + .postbox-header h2 { | |
| 49 | + line-height: 24px; | |
| 32 | 50 | } |
| 33 | 51 | |
| 34 | 52 | .header { |
| 35 | 53 | background: #ffffff; |
| @@ -40,15 +58,10 @@ | ||
| 40 | 58 | padding-right: 260px; /* Space for the screen meta links. */ |
| 41 | 59 | |
| 42 | 60 | .name { |
| 43 | 61 | border-right: 1px solid #dedae6; |
| 44 | - padding: 12px 24px 6px; | |
| 45 | - | |
| 46 | - img { | |
| 47 | - vertical-align: middle; | |
| 48 | - margin: 0 12px 6px 0; | |
| 49 | - height: 32px; | |
| 50 | - } | |
| 62 | + padding: 7px 20px; | |
| 63 | + line-height: 0; | |
| 51 | 64 | } |
| 52 | 65 | } |
| 53 | 66 | |
| 54 | 67 | #tablepress-nav { |
| @@ -69,9 +82,9 @@ | ||
| 69 | 82 | } |
| 70 | 83 | |
| 71 | 84 | li:hover > a, |
| 72 | 85 | li > a:focus { |
| 73 | - border-bottom-color: #049cdb; | |
| 86 | + border-bottom-color: var(--wp-admin-theme-color); | |
| 74 | 87 | background-color: #f9f9f9; |
| 75 | 88 | } |
| 76 | 89 | } |
| 77 | 90 | |
| @@ -84,9 +97,9 @@ | ||
| 84 | 97 | text-decoration: none; |
| 85 | 98 | color: #1e1e1e; |
| 86 | 99 | |
| 87 | 100 | &.active { |
| 88 | - border-bottom-color: #049cdb; | |
| 101 | + border-bottom-color: var(--wp-admin-theme-color); | |
| 89 | 102 | } |
| 90 | 103 | |
| 91 | 104 | &.separator { |
| 92 | 105 | margin-right: 20px; |
| @@ -105,22 +118,27 @@ | ||
| 105 | 118 | padding: 6px 4px 6px 12px; |
| 106 | 119 | font-size: 14px; |
| 107 | 120 | line-height: 1; |
| 108 | 121 | text-decoration: none; |
| 109 | - transition: color 0.1s, background-color 0.1s, border-color 0.1s; | |
| 110 | 122 | display: inline-flex; |
| 111 | 123 | color: #ffffff; |
| 112 | - background-color: #8ab547; | |
| 113 | - border-color: #8ab547; | |
| 124 | + background-color: #16a34a; | |
| 125 | + border-color: #16a34a; | |
| 114 | 126 | |
| 115 | 127 | &:hover, |
| 116 | 128 | &:active, |
| 117 | 129 | &:focus { |
| 118 | - color: #fff; | |
| 119 | - background-color: #69b547; | |
| 120 | - border-color: #69b547; | |
| 130 | + span:first-child { | |
| 131 | + text-decoration: underline; | |
| 132 | + text-decoration-thickness: 1.5px; | |
| 133 | + } | |
| 121 | 134 | } |
| 122 | 135 | |
| 136 | + &.renew { | |
| 137 | + background-color: #ff5100; | |
| 138 | + border-color: #ff5100; | |
| 139 | + } | |
| 140 | + | |
| 123 | 141 | .dashicons { |
| 124 | 142 | margin: 0 6px 0 4px; |
| 125 | 143 | } |
| 126 | 144 | } |
| @@ -125,109 +143,370 @@ | ||
| 125 | 143 | } |
| 126 | 144 | } |
| 127 | 145 | } |
| 128 | 146 | |
| 129 | - /* Margins for messages on screens */ | |
| 130 | - div.notice { | |
| 147 | + .postbox ul { | |
| 148 | + list-style: disc inside; | |
| 149 | + margin: 0; | |
| 150 | + | |
| 151 | + > li { | |
| 152 | + margin: 0; | |
| 153 | + } | |
| 154 | + } | |
| 155 | + | |
| 156 | + /* Styling for the "Info" icon next to descriptions/notices. */ | |
| 157 | + .components-h-stack { | |
| 158 | + svg { | |
| 159 | + min-width: 24px; | |
| 160 | + } | |
| 161 | + } | |
| 162 | + | |
| 163 | + .code input, | |
| 164 | + .code textarea { | |
| 165 | + font-family: Consolas, Monaco, monospace; | |
| 166 | + direction: ltr; | |
| 167 | + unicode-bidi: embed; | |
| 168 | + } | |
| 169 | + | |
| 170 | + /* Reset style from postboxes that pollute components' styles. */ | |
| 171 | + .components-panel__body { | |
| 172 | + > .components-panel__body-title { | |
| 173 | + padding: 0; | |
| 174 | + } | |
| 175 | + | |
| 176 | + &.is-opened > .components-panel__body-title { | |
| 177 | + margin: -16px -16px 5px; | |
| 178 | + } | |
| 179 | + } | |
| 180 | + | |
| 181 | + .components-card { | |
| 182 | + box-shadow: none; | |
| 183 | + border-radius: 0; | |
| 184 | + border: 1px solid #c3c4c7; | |
| 185 | + | |
| 186 | + .components-card-header { | |
| 187 | + padding: 0; | |
| 188 | + border-bottom: 1px solid #c3c4c7; | |
| 189 | + | |
| 190 | + h2 { | |
| 191 | + line-height: 24px; | |
| 192 | + } | |
| 193 | + } | |
| 194 | + | |
| 195 | + .components-card-body { | |
| 196 | + padding: 16px; | |
| 197 | + } | |
| 198 | + | |
| 199 | + .card-title { | |
| 200 | + font-size: 13px; | |
| 201 | + font-weight: 500; | |
| 202 | + padding: 0 0 16px; | |
| 203 | + } | |
| 204 | + } | |
| 205 | + | |
| 206 | + .components-checkbox-control__input, | |
| 207 | + .components-radio-control__input { | |
| 208 | + &:checked:disabled { | |
| 209 | + opacity: 0.4; | |
| 210 | + } | |
| 211 | + | |
| 212 | + &:not(:checked):disabled { | |
| 213 | + background: #f0f0f0; | |
| 214 | + border-color: #cccccc; | |
| 215 | + } | |
| 216 | + } | |
| 217 | + | |
| 218 | + .components-text-control__input:disabled, | |
| 219 | + .components-textarea-control__input:disabled { | |
| 220 | + background: #f0f0f0; | |
| 221 | + border-color: #cccccc; | |
| 222 | + box-shadow: none; | |
| 223 | + } | |
| 224 | + | |
| 225 | + /* Alignment of selects inside of checkbox labels. */ | |
| 226 | + .checkbox-select-in-label { | |
| 227 | + .components-h-stack { | |
| 228 | + align-items: center; | |
| 229 | + } | |
| 230 | + .components-checkbox-control__label { | |
| 231 | + display: flex; | |
| 232 | + gap: 8px; | |
| 233 | + align-items: center; | |
| 234 | + } | |
| 235 | + } | |
| 236 | + | |
| 237 | + .notice { | |
| 131 | 238 | margin: 20px 0 0; |
| 239 | + | |
| 240 | + /* Remove rounded corners in WP 7.1+, as long as notices still use non-Gutenberg style. */ | |
| 241 | + --wpds-border-radius-lg: 0; /* stylelint-disable-line plugin-wpds/no-setting-wpds-custom-properties */ | |
| 132 | 242 | } |
| 243 | + | |
| 244 | + .components-notice { | |
| 245 | + @at-root body[class*="branch-6-"] &.notice { | |
| 246 | + box-shadow: none; | |
| 247 | + padding: 8px 12px; | |
| 248 | + border-top: none; | |
| 249 | + border-right: none; | |
| 250 | + border-bottom: none; | |
| 251 | + | |
| 252 | + | |
| 253 | + &.is-dismissible { | |
| 254 | + padding-right: 38px; | |
| 255 | + | |
| 256 | + .notice-dismiss { | |
| 257 | + &:before { | |
| 258 | + content: unicode("f335"); | |
| 259 | + content: unicode("f335") / ""; | |
| 260 | + font-size: 24px; | |
| 261 | + padding-right: 4px; | |
| 262 | + } | |
| 263 | + | |
| 264 | + &:hover:before { | |
| 265 | + color: #1e1e1e; | |
| 266 | + } | |
| 267 | + } | |
| 268 | + } | |
| 269 | + } | |
| 270 | + | |
| 271 | + &.notice-info { | |
| 272 | + border-left-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)); | |
| 273 | + } | |
| 274 | + &.notice-error { | |
| 275 | + background-color: #fcf0f0; | |
| 276 | + } | |
| 277 | + &.notice-milestone { | |
| 278 | + position: relative; | |
| 279 | + border-left-color: #16a34a; | |
| 280 | + background-color: #ffffff; | |
| 281 | + | |
| 282 | + .components-button { | |
| 283 | + font-size: 16px; | |
| 284 | + margin-right: 3em; | |
| 285 | + color: #ffffff; | |
| 286 | + background: linear-gradient(135deg, rgba(252, 185, 0, 1) 0%, rgba(255, 105, 0, 1) 100%); | |
| 287 | + border-color: #ffffff; | |
| 288 | + font-weight: bold; | |
| 289 | + border-radius: 3px; | |
| 290 | + | |
| 291 | + &:hover span:first-child { | |
| 292 | + text-decoration: underline; | |
| 293 | + } | |
| 294 | + } | |
| 295 | + | |
| 296 | + p { | |
| 297 | + margin-left: 230px; | |
| 298 | + } | |
| 299 | + | |
| 300 | + img { | |
| 301 | + position: absolute; | |
| 302 | + bottom: -1px; | |
| 303 | + left: 20px; | |
| 304 | + width: 200px; | |
| 305 | + height: 160px; | |
| 306 | + } | |
| 307 | + } | |
| 308 | + .components-notice__content { | |
| 309 | + margin: 0; | |
| 310 | + } | |
| 311 | + } | |
| 312 | + | |
| 313 | + /* Notices for "Preview" and "Save Changes" buttons. */ | |
| 314 | + .components-notice-list { | |
| 315 | + display: flex; | |
| 316 | + flex-direction: column; | |
| 317 | + gap: 8px; | |
| 318 | + | |
| 319 | + @keyframes fadeIn { | |
| 320 | + from { | |
| 321 | + opacity: 0; | |
| 322 | + } | |
| 323 | + to { | |
| 324 | + opacity: 1; | |
| 325 | + } | |
| 326 | + } | |
| 327 | + | |
| 328 | + .components-notice { | |
| 329 | + animation: fadeIn 1s; /* Fade in new notices. */ | |
| 330 | + transition: opacity 1s; /* Fade out notices before removing them. */ | |
| 331 | + scroll-margin-bottom: 50px; /* Scroll into view offset for error notices. */ | |
| 332 | + } | |
| 333 | + | |
| 334 | + } | |
| 335 | + | |
| 336 | + .components-snackbar-list { | |
| 337 | + position: fixed; | |
| 338 | + bottom: 24px; | |
| 339 | + } | |
| 133 | 340 | } |
| 134 | 341 | |
| 135 | -/* Add New Table form */ | |
| 136 | -#tablepress_add-add-table .form-wrap { | |
| 137 | - max-width: 500px; | |
| 342 | +#tablepress-header .buttons .tablepress-button { | |
| 343 | + color: #ffffff; | |
| 344 | + background: linear-gradient(135deg, rgba(252, 185, 0, 1) 0%, rgba(255, 105, 0, 1) 100%); | |
| 345 | + border-color: #ffffff !important; | |
| 346 | + font-weight: bold; | |
| 138 | 347 | } |
| 139 | -#tablepress_add-add-table .form-field { | |
| 140 | - margin: 0; | |
| 348 | + | |
| 349 | +/* Table Preview (CSS for actual preview is directly in the preview HTML). */ | |
| 350 | +.table-preview-modal { | |
| 351 | + .components-modal__content { | |
| 352 | + padding: 0 16px 26px; | |
| 353 | + } | |
| 354 | + | |
| 355 | + iframe { | |
| 356 | + width: 100%; | |
| 357 | + height: 100%; | |
| 358 | + } | |
| 359 | + | |
| 360 | + .components-modal__header { | |
| 361 | + padding: 20px 26px 8px; | |
| 362 | + | |
| 363 | + + div { | |
| 364 | + height: 100%; | |
| 365 | + } | |
| 366 | + } | |
| 141 | 367 | } |
| 142 | -/* Number of rows/columns in the "Add New Table" form */ | |
| 143 | -#tablepress_add-add-table .form-field-small { | |
| 144 | - float: left; | |
| 145 | - width: 150px; | |
| 146 | - margin-right: 20px; | |
| 368 | + | |
| 369 | +/* Width of the columns on the "All Tables" list. */ | |
| 370 | +.tablepress-all-tables { | |
| 371 | + thead { | |
| 372 | + .column-table_id { | |
| 373 | + width: 50px; | |
| 374 | + } | |
| 375 | + .column-table_name { | |
| 376 | + width: 30%; | |
| 377 | + } | |
| 378 | + .column-table_author { | |
| 379 | + width: 12%; | |
| 380 | + } | |
| 381 | + .column-table_last_modified { | |
| 382 | + width: 15%; | |
| 383 | + } | |
| 384 | + } | |
| 385 | + | |
| 386 | + /* Font weight for the table ID column. */ | |
| 387 | + tbody .column-table_id { | |
| 388 | + font-weight: bold; | |
| 389 | + } | |
| 390 | + | |
| 391 | + /* Responsiveness on the All Tables screen. */ | |
| 392 | + @media screen and (max-width: 782px) { | |
| 393 | + .column-table_id { | |
| 394 | + display: none !important; | |
| 395 | + font-size: 14px; | |
| 396 | + } | |
| 397 | + /* WordPress < 7.1. */ | |
| 398 | + th + .column-table_id { | |
| 399 | + padding: 3px 8px 3px 35%; | |
| 400 | + } | |
| 401 | + | |
| 402 | + /* WordPress >= 7.1. */ | |
| 403 | + td + .column-table_id { | |
| 404 | + padding: 6px 8px 8px 32px; | |
| 405 | + } | |
| 406 | + } | |
| 147 | 407 | } |
| 148 | 408 | |
| 149 | -/* Width of the columns on the "All Tables" list */ | |
| 150 | -.tablepress-all-tables thead .column-table_id { | |
| 151 | - width: 50px; | |
| 152 | -} | |
| 153 | -.tablepress-all-tables thead .column-table_name { | |
| 154 | - width: 30%; | |
| 155 | -} | |
| 156 | -.tablepress-all-tables thead .column-table_author { | |
| 157 | - width: 12%; | |
| 158 | -} | |
| 159 | -.tablepress-all-tables thead .column-table_last_modified { | |
| 160 | - width: 15%; | |
| 161 | -} | |
| 162 | -/* Font weight for the table ID column */ | |
| 163 | -.tablepress-all-tables tbody .column-table_id { | |
| 164 | - font-weight: bold; | |
| 165 | -} | |
| 166 | -/* Responsiveness on the All Tables screen */ | |
| 167 | -@media screen and (max-width: 782px) { | |
| 168 | - .tablepress-all-tables .column-table_id { | |
| 169 | - display: none !important; | |
| 170 | - padding: 3px 8px 3px 35%; | |
| 409 | +/* Layout adjustments for the header row. */ | |
| 410 | +table.widefat { | |
| 411 | + thead, | |
| 412 | + tfoot { | |
| 413 | + td.check-column { | |
| 414 | + padding-top: 0; | |
| 415 | + | |
| 416 | + @media screen and (max-width: 782px) { | |
| 417 | + padding-top: 6px; | |
| 418 | + } | |
| 419 | + } | |
| 171 | 420 | } |
| 421 | + th { | |
| 422 | + &.sortable, | |
| 423 | + &.sorted { | |
| 424 | + a { | |
| 425 | + line-height: 24px; | |
| 426 | + } | |
| 427 | + } | |
| 428 | + } | |
| 429 | + .sorting-indicators { | |
| 430 | + margin-top: 2px; | |
| 431 | + } | |
| 172 | 432 | } |
| 173 | 433 | |
| 174 | -/* Search results for WP_List_Table */ | |
| 434 | +/* Positioning of Search results of WP_List_Tables. */ | |
| 175 | 435 | #tablepress-page .subtitle { |
| 176 | 436 | float: left; |
| 177 | 437 | padding: 8px 0 0 0; |
| 178 | 438 | } |
| 179 | 439 | |
| 180 | -/* Table ID/name dropdown on "Export" screen */ | |
| 181 | -#tablepress-page #tables-export { | |
| 182 | - width: 100%; | |
| 183 | -} | |
| 184 | - | |
| 185 | -/* Tables in postboxes (on the "Edit" and "Plugin Options" screens) */ | |
| 440 | +/* Tables in postboxes (on the "Edit" and "Plugin Options" screens). */ | |
| 186 | 441 | .tablepress-postbox-table { |
| 187 | 442 | border-spacing: 0; |
| 188 | 443 | max-width: 1000px; |
| 189 | 444 | width: 100%; |
| 445 | + | |
| 446 | + /* Default column widths. */ | |
| 447 | + .column-1 { | |
| 448 | + width: 25%; | |
| 449 | + } | |
| 450 | + .column-2 { | |
| 451 | + width: 75%; | |
| 452 | + } | |
| 453 | + | |
| 454 | + th { | |
| 455 | + text-align: left; | |
| 456 | + font-weight: normal; | |
| 457 | + } | |
| 458 | + th, | |
| 459 | + td { | |
| 460 | + padding: 2px; | |
| 461 | + } | |
| 462 | + .top-border { | |
| 463 | + th, | |
| 464 | + td { | |
| 465 | + padding-top: 6px; | |
| 466 | + } | |
| 467 | + } | |
| 468 | + .bottom-border { | |
| 469 | + th, | |
| 470 | + td { | |
| 471 | + padding-bottom: 6px; | |
| 472 | + border-bottom: 1px solid #eeeeee; | |
| 473 | + } | |
| 474 | + } | |
| 475 | + .top-align { | |
| 476 | + vertical-align: top; | |
| 477 | + padding-top: 6px; | |
| 478 | + } | |
| 190 | 479 | } |
| 191 | -/* Default column widths */ | |
| 192 | -.tablepress-postbox-table .column-1 { | |
| 193 | - width: 25%; | |
| 194 | -} | |
| 195 | -.tablepress-postbox-table .column-2 { | |
| 196 | - width: 75%; | |
| 197 | -} | |
| 198 | -.tablepress-postbox-table th { | |
| 199 | - text-align: left; | |
| 200 | - font-weight: normal; | |
| 201 | -} | |
| 202 | -.tablepress-postbox-table th, | |
| 203 | -.tablepress-postbox-table td { | |
| 204 | - padding: 2px; | |
| 205 | - word-wrap: break-word; | |
| 206 | -} | |
| 207 | -.tablepress-postbox-table .top-border th, | |
| 208 | -.tablepress-postbox-table .top-border td { | |
| 209 | - padding-top: 6px; | |
| 210 | -} | |
| 211 | -.tablepress-postbox-table .bottom-border th, | |
| 212 | -.tablepress-postbox-table .bottom-border td { | |
| 213 | - padding-bottom: 6px; | |
| 214 | - border-bottom: 1px solid #eeeeee; | |
| 215 | -} | |
| 216 | -.tablepress-postbox-table .top-align { | |
| 217 | - vertical-align: top; | |
| 218 | - padding-top: 6px; | |
| 219 | -} | |
| 220 | -/* Select dropdown alignment */ | |
| 480 | + | |
| 481 | +/* Select dropdown alignment. */ | |
| 221 | 482 | #tablepress-page select { |
| 222 | 483 | vertical-align: baseline; |
| 223 | 484 | } |
| 224 | -/* Alignment of textareas and buttons in postboxes */ | |
| 225 | -#tablepress-page textarea, | |
| 485 | + | |
| 486 | +/* Alignment of textareas and buttons in postboxes. */ | |
| 487 | +#tablepress-page textarea:not(.components-textarea-control__input), | |
| 226 | 488 | .tablepress-postbox-table .button { |
| 227 | 489 | margin: 1px; |
| 228 | 490 | } |
| 229 | 491 | |
| 230 | -/* Red color for the "Uninstall TablePress" button on the "Plugin Options" screen */ | |
| 231 | -#uninstall-tablepress { | |
| 232 | - color: #bc0b0b; | |
| 492 | +/* Styling of pills in postbox headings. */ | |
| 493 | +.postbox .postbox-header .hndle:not(:has(> .help-container)) { | |
| 494 | + display: inline; | |
| 495 | + | |
| 496 | + .pill-label { | |
| 497 | + display: inline-block; | |
| 498 | + vertical-align: top; | |
| 499 | + box-sizing: border-box; | |
| 500 | + margin: 3px 0 0 6px; | |
| 501 | + padding: 0 5px; | |
| 502 | + min-width: 18px; | |
| 503 | + height: 18px; | |
| 504 | + border-radius: 9px; | |
| 505 | + background-color: var(--wp-admin-theme-color); | |
| 506 | + color: #ffffff; | |
| 507 | + font-size: 11px; | |
| 508 | + line-height: 1.6; | |
| 509 | + text-align: center; | |
| 510 | + z-index: 26; | |
| 511 | + } | |
| 233 | 512 | } |