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