editor.scss
461 lines
| 1 | .gb-pattern-library { |
| 2 | display: grid; |
| 3 | grid-template-areas: |
| 4 | "header header" |
| 5 | "subheader subheader" |
| 6 | "sidebar content"; |
| 7 | grid-template-columns: 312px 1fr; |
| 8 | grid-template-rows: 75px auto 1fr; |
| 9 | height: 100%; |
| 10 | |
| 11 | &__header { |
| 12 | align-items: center; |
| 13 | background: #fff; |
| 14 | border-bottom: 1px solid #fafafa; |
| 15 | display: grid; |
| 16 | grid-area: header; |
| 17 | grid-template-columns: 1fr 3fr 1fr; |
| 18 | height: 75px; |
| 19 | justify-content: space-between; |
| 20 | padding: 0 32px; |
| 21 | |
| 22 | h1 { |
| 23 | font-size: 20px; |
| 24 | display: flex; |
| 25 | gap: 10px; |
| 26 | |
| 27 | svg { |
| 28 | width: 20px; |
| 29 | height: 20px; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | &-title { |
| 34 | grid-column: 1; |
| 35 | } |
| 36 | |
| 37 | &-action { |
| 38 | justify-content: center;; |
| 39 | display: flex; |
| 40 | gap: 1rem; |
| 41 | grid-column: 2; |
| 42 | } |
| 43 | |
| 44 | &-close { |
| 45 | align-items: center; |
| 46 | display: flex; |
| 47 | gap: 10px; |
| 48 | grid-column: 3; |
| 49 | justify-content: flex-end; |
| 50 | |
| 51 | .components-button { |
| 52 | .components-spinner { |
| 53 | margin: 0; |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | // TODO: Refactor this for better semantics and code placement |
| 60 | .gblocks-collection-required-components { |
| 61 | grid-column: 1 / -1; |
| 62 | } |
| 63 | |
| 64 | &__sidebar { |
| 65 | grid-area: sidebar; |
| 66 | height: 100%; |
| 67 | overflow-y: auto; |
| 68 | padding: 32px; |
| 69 | width: 100%; |
| 70 | } |
| 71 | |
| 72 | .pattern-library-selector { |
| 73 | display: flex; |
| 74 | align-items: center; |
| 75 | justify-content: center; |
| 76 | gap: 8px; |
| 77 | |
| 78 | .components-button-group { |
| 79 | display: flex; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | &__content { |
| 84 | height: 100%; |
| 85 | grid-area: content; |
| 86 | overflow-y: scroll; |
| 87 | padding-bottom: 32px; |
| 88 | position: relative; |
| 89 | |
| 90 | } |
| 91 | .patterns-wrapper { |
| 92 | background: #f0f0f0; |
| 93 | display: grid; |
| 94 | gap: 32px; |
| 95 | grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); |
| 96 | margin-top: 0; |
| 97 | padding: 30px; |
| 98 | list-style-type: none; |
| 99 | |
| 100 | &:empty { |
| 101 | display: none; |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | .pattern-category-list, |
| 106 | .pattern-tree { |
| 107 | display: flex; |
| 108 | flex-direction: column; |
| 109 | gap: 10px; |
| 110 | } |
| 111 | |
| 112 | .pattern-category-list { |
| 113 | margin-bottom: 10px; |
| 114 | background: #fafafa; |
| 115 | border-radius: 3px; |
| 116 | |
| 117 | .pattern-category-dropdown > .components-button { |
| 118 | width: 100%; |
| 119 | display: flex; |
| 120 | flex-direction: row-reverse; |
| 121 | justify-content: space-between !important; |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | .gb-pattern-wrapper { |
| 126 | background: #fff; |
| 127 | border: none; |
| 128 | padding: 10px 10px 0; |
| 129 | border-radius: 10px; |
| 130 | |
| 131 | .gb-selectable__toggle { |
| 132 | border-radius: 10px; |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | .gb-pattern-frame { |
| 137 | overflow: hidden; |
| 138 | padding: 20px 20px 0; |
| 139 | background: #e1e1e1; |
| 140 | } |
| 141 | |
| 142 | .gb-pattern { |
| 143 | overflow: hidden; |
| 144 | position: relative; |
| 145 | height: 100%; |
| 146 | background: #f7f7f7; |
| 147 | |
| 148 | .components-spinner { |
| 149 | position: absolute; |
| 150 | top: calc(50% - 8px); |
| 151 | left: calc(50% - 8px); |
| 152 | width: 16px; |
| 153 | height: 16px; |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | .loading-library { |
| 158 | display: flex; |
| 159 | justify-content: center; |
| 160 | align-items: center; |
| 161 | min-height: 30vh; |
| 162 | |
| 163 | .components-spinner { |
| 164 | margin-top: 0; |
| 165 | margin-bottom: 0; |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | .gb-pattern-details { |
| 171 | padding: 20px; |
| 172 | display: flex; |
| 173 | align-items: center; |
| 174 | justify-content: space-between; |
| 175 | gap: 10px; |
| 176 | |
| 177 | h3 { |
| 178 | margin: 0; |
| 179 | overflow: hidden; |
| 180 | text-overflow: ellipsis; |
| 181 | white-space: nowrap; |
| 182 | font-size: 15px; |
| 183 | font-weight: 400; |
| 184 | } |
| 185 | |
| 186 | &__actions { |
| 187 | flex-shrink: 0; |
| 188 | display: flex; |
| 189 | gap: 5px; |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | .gblocks-pattern-library-modal.is-full-screen { |
| 194 | .components-modal__header { |
| 195 | display: none; |
| 196 | |
| 197 | + div { |
| 198 | height: 100%; |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | .components-modal__content { |
| 203 | margin-top: 0; |
| 204 | padding: 0; |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | .gblocks-pattern-library-pagination { |
| 209 | display: flex; |
| 210 | gap: 10px; |
| 211 | justify-content: center; |
| 212 | |
| 213 | a { |
| 214 | display: block; |
| 215 | font-size: 17px; |
| 216 | padding: 15px 20px; |
| 217 | border-radius: 3px; |
| 218 | background: #fff; |
| 219 | box-shadow: inset 0 0 0 1px var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)); |
| 220 | color: var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)); |
| 221 | |
| 222 | &:not([aria-disabled="true"]) { |
| 223 | cursor: pointer; |
| 224 | } |
| 225 | |
| 226 | &[aria-current="page"]="page""] { |
| 227 | background: var(--wp-components-color-foreground, #1e1e1e); |
| 228 | color: var(--wp-components-color-foreground-inverted, #fff); |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | li.previous.disabled, |
| 233 | li.next.disabled { |
| 234 | display: none; |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | .gblocks-manage-libraries { |
| 239 | width: 400px; |
| 240 | max-width: 100%; |
| 241 | |
| 242 | &__table { |
| 243 | border: 1px solid #ddd; |
| 244 | margin-bottom: 2em; |
| 245 | } |
| 246 | |
| 247 | &__library { |
| 248 | display: flex; |
| 249 | align-items: center; |
| 250 | justify-content: space-between; |
| 251 | padding: 10px; |
| 252 | border-bottom: 1px solid #ddd; |
| 253 | |
| 254 | &:nth-child(even) { |
| 255 | background: #fafafa; |
| 256 | } |
| 257 | |
| 258 | &:last-child { |
| 259 | border-bottom: 0; |
| 260 | } |
| 261 | |
| 262 | .components-base-control { |
| 263 | margin: 0; |
| 264 | |
| 265 | &__field { |
| 266 | margin: 0; |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | &-name { |
| 271 | display: flex; |
| 272 | align-items: center; |
| 273 | gap: 10px; |
| 274 | |
| 275 | .components-button { |
| 276 | svg { |
| 277 | width: 17px; |
| 278 | height: 17px; |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | &-actions { |
| 284 | display: flex; |
| 285 | align-items: center; |
| 286 | gap: 10px; |
| 287 | |
| 288 | .components-base-control { |
| 289 | margin: 0; |
| 290 | |
| 291 | &__field { |
| 292 | margin: 0; |
| 293 | } |
| 294 | } |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | h4 { |
| 299 | margin: 0 0 10px; |
| 300 | font-size: 15px; |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | .gblocks-patterns-add-library { |
| 305 | .components-base-control { |
| 306 | margin-bottom: 1.5em; |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | .gb-selected-patterns { |
| 311 | |
| 312 | &__list { |
| 313 | > :first-child { |
| 314 | border-top: 1px solid #e1e1e1; |
| 315 | } |
| 316 | |
| 317 | > * { |
| 318 | border-bottom: 1px solid #e1e1e1; |
| 319 | margin: 0; |
| 320 | } |
| 321 | |
| 322 | &.is-dragging { |
| 323 | background-color: #bcecfb; |
| 324 | } |
| 325 | |
| 326 | .gb-sortable-listitem { |
| 327 | background-color: #fefefe; |
| 328 | |
| 329 | &.is-dragging { |
| 330 | background-color: #f0f0f0; |
| 331 | } |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | .gb-selected-pattern { |
| 337 | align-items: center; |
| 338 | display: flex; |
| 339 | flex-grow: 1; |
| 340 | gap: 0.625rem; |
| 341 | |
| 342 | &__label { |
| 343 | -webkit-box-orient: vertical; |
| 344 | display: -webkit-box; |
| 345 | font-weight: 500; |
| 346 | -webkit-line-clamp: 1; |
| 347 | overflow: hidden; |
| 348 | } |
| 349 | |
| 350 | &__handle { |
| 351 | flex-shrink: 1; |
| 352 | } |
| 353 | |
| 354 | &__actions { |
| 355 | display: flex; |
| 356 | align-items: center; |
| 357 | flex-shrink: 1; |
| 358 | gap: 0.125rem; |
| 359 | margin-left: auto; |
| 360 | } |
| 361 | |
| 362 | .components-button { |
| 363 | svg { |
| 364 | display: block; |
| 365 | height: 1rem; |
| 366 | width: 1rem; |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | // Borrow from wp-core-ui media select styles to avoid extra unwanted styles |
| 372 | .gb-selectable { |
| 373 | $selectable_blue: #2271b1; |
| 374 | position: relative; |
| 375 | |
| 376 | &__toggle { |
| 377 | background: transparent; |
| 378 | border: none; |
| 379 | height: 100%; |
| 380 | left: 0; |
| 381 | position: absolute; |
| 382 | top: 0; |
| 383 | width: 100%; |
| 384 | z-index: 1; |
| 385 | } |
| 386 | |
| 387 | .check { |
| 388 | background: #f0f0f1; |
| 389 | border: 0; |
| 390 | box-shadow: 0 0 0 1px #fff, 0 0 0 2px rgba(0, 0, 0, 0.15); |
| 391 | cursor: pointer; |
| 392 | display: none; |
| 393 | height: 24px; |
| 394 | outline: none; |
| 395 | padding: 0; |
| 396 | position: absolute; |
| 397 | right: -6px; |
| 398 | top: -6px; |
| 399 | width: 24px; |
| 400 | z-index: 10; |
| 401 | |
| 402 | .media-modal-icon { |
| 403 | background-position: -1px 0; |
| 404 | display: block; |
| 405 | height: 15px; |
| 406 | margin: 5px; |
| 407 | width: 15px; |
| 408 | } |
| 409 | |
| 410 | &:hover .media-modal-icon { |
| 411 | background-position: -40px 0; |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | &.is-selected .gb-selectable__toggle, |
| 416 | .gb-selectable__toggle:where(:hover, :focus-within) { |
| 417 | outline: 3px solid $selectable_blue; |
| 418 | outline-offset: -3px; |
| 419 | } |
| 420 | |
| 421 | &.is-selected .check { |
| 422 | display: block; |
| 423 | |
| 424 | &:focus, |
| 425 | & { |
| 426 | background-color: $selectable_blue; |
| 427 | box-shadow: |
| 428 | 0 0 0 1px #fff, |
| 429 | 0 0 0 2px $selectable_blue; |
| 430 | } |
| 431 | |
| 432 | &:focus { |
| 433 | /* Only visible in Windows High Contrast mode */ |
| 434 | outline: 2px solid transparent; |
| 435 | } |
| 436 | |
| 437 | .media-modal-icon { |
| 438 | background-position: -21px 0; |
| 439 | } |
| 440 | |
| 441 | &:focus .media-modal-icon, |
| 442 | &:hover .media-modal-icon { |
| 443 | background-position: -60px 0; |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | // Target the check when interacting with the toggle while the item is selected |
| 448 | &.is-selected .gb-selectable__toggle:where(:hover, :focus-visible) + .check { |
| 449 | .media-modal-icon { |
| 450 | background-position: -60px 0; |
| 451 | } |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | .gblocks-pattern-library-button { |
| 456 | svg { |
| 457 | width: 19px; |
| 458 | height: 19px; |
| 459 | } |
| 460 | } |
| 461 |