| @@ -1,12 +1,51 @@ | ||
| 1 | -@use 'sass:color'; | |
| 1 | +@use '../common/notices'; | |
| 2 | +@use '../common/checkbox'; | |
| 2 | 3 | @use '../common/theme'; |
| 3 | -@use '../common/banners'; | |
| 4 | 4 | |
| 5 | +.cloud-snippet-status { | |
| 6 | + display: inline-flex; | |
| 7 | + align-items: center; | |
| 8 | + gap: 8px; | |
| 9 | + color: var(--cs-color-text-muted); | |
| 10 | + font-size: 12px; | |
| 11 | + font-weight: 500; | |
| 12 | + white-space: nowrap; | |
| 13 | + | |
| 14 | + &::before { | |
| 15 | + content: ''; | |
| 16 | + block-size: 10px; | |
| 17 | + inline-size: 10px; | |
| 18 | + border-radius: 50%; | |
| 19 | + display: inline-block; | |
| 20 | + } | |
| 21 | + | |
| 22 | + &-public::before { | |
| 23 | + background: var(--cs-cloud-status-public-color); | |
| 24 | + } | |
| 25 | + | |
| 26 | + &-private::before { | |
| 27 | + background: var(--cs-cloud-status-private-color); | |
| 28 | + } | |
| 29 | + | |
| 30 | + &-unverified::before { | |
| 31 | + background: var(--cs-cloud-status-unverified-color); | |
| 32 | + } | |
| 33 | + | |
| 34 | + &-ai-verified::before { | |
| 35 | + background: var(--cs-cloud-status-ai-verified-color); | |
| 36 | + } | |
| 37 | + | |
| 38 | + &-pro-verified::before { | |
| 39 | + background: var(--cs-cloud-status-pro-verified-color); | |
| 40 | + } | |
| 41 | +} | |
| 42 | + | |
| 43 | +.bundle-share-code-form, | |
| 5 | 44 | .cloud-search-form { |
| 6 | 45 | display: flex; |
| 7 | 46 | gap: 8px; |
| 8 | - margin-block: 31px 47px; | |
| 47 | + margin-block: 0 47px; | |
| 9 | 48 | block-size: 54px; |
| 10 | 49 | |
| 11 | 50 | > select { |
| 12 | 51 | flex: 0 0 250px; |
| @@ -15,18 +54,8 @@ | ||
| 15 | 54 | .button { |
| 16 | 55 | flex: 0 0 165px; |
| 17 | 56 | } |
| 18 | 57 | |
| 19 | - .cloud-search-submit { | |
| 20 | - display: inline-flex; | |
| 21 | - align-items: center; | |
| 22 | - justify-content: center; | |
| 23 | - | |
| 24 | - .components-spinner { | |
| 25 | - margin: 0; | |
| 26 | - } | |
| 27 | - } | |
| 28 | - | |
| 29 | 58 | .cloud-search-query { |
| 30 | 59 | flex: 1; |
| 31 | 60 | position: relative; |
| 32 | 61 | |
| @@ -40,163 +69,120 @@ | ||
| 40 | 69 | inset-inline-end: 1.5em; |
| 41 | 70 | inset-block-start: 25%; |
| 42 | 71 | } |
| 43 | 72 | } |
| 73 | + | |
| 74 | + button[type='submit'] { | |
| 75 | + display: inline-flex; | |
| 76 | + align-items: center; | |
| 77 | + justify-content: center; | |
| 78 | + | |
| 79 | + .components-spinner { | |
| 80 | + margin: 0; | |
| 81 | + } | |
| 82 | + } | |
| 44 | 83 | } |
| 45 | 84 | |
| 46 | 85 | .cloud-search { |
| 47 | - @include banners.banners; | |
| 86 | + @include notices.notices('banner'); | |
| 48 | 87 | |
| 88 | + padding-block-start: 10px; | |
| 89 | + | |
| 49 | 90 | .banner { |
| 50 | 91 | justify-content: center; |
| 51 | 92 | } |
| 52 | 93 | |
| 53 | - .tablenav.top { | |
| 54 | - display: flex; | |
| 55 | - gap: 20px; | |
| 56 | - block-size: 40px; | |
| 57 | - margin-block-end: 31px; | |
| 58 | - align-items: center; | |
| 59 | - | |
| 60 | - select { | |
| 61 | - inline-size: 245px; | |
| 62 | - block-size: 100%; | |
| 63 | - } | |
| 64 | - | |
| 65 | - nav { | |
| 66 | - margin-inline-start: auto; | |
| 67 | - } | |
| 68 | - | |
| 69 | - .tablenav-pages { | |
| 70 | - margin: 0; | |
| 71 | - margin-inline-start: auto; | |
| 72 | - } | |
| 73 | - } | |
| 74 | 94 | } |
| 75 | 95 | |
| 76 | -.cloud-search-results { | |
| 77 | - display: grid; | |
| 78 | - grid-template-columns: repeat(auto-fill, minmax(580px, 1fr)); | |
| 79 | - gap: 20px; | |
| 80 | - margin: 0; | |
| 96 | +.bundle-share-code-form { | |
| 97 | + max-inline-size: 60%; | |
| 81 | 98 | } |
| 82 | 99 | |
| 83 | -.cloud-search-result { | |
| 84 | - background: #fff; | |
| 85 | - border: 1px solid #c3c4c7; | |
| 86 | - margin: 0; | |
| 100 | +.cloud-snippet-action-buttons { | |
| 87 | 101 | display: flex; |
| 88 | - flex-flow: column; | |
| 89 | - box-sizing: border-box; | |
| 102 | + justify-content: flex-end; | |
| 103 | + align-items: center; | |
| 104 | + gap: 8px; | |
| 90 | 105 | |
| 91 | - a { | |
| 92 | - text-decoration: none; | |
| 93 | - color: #2271b1; | |
| 106 | + // Keep the Download / Edit / Pro Only button a consistent width so | |
| 107 | + // rows line up regardless of which state the snippet is in. | |
| 108 | + .button-primary, | |
| 109 | + .cloud-pro-button, | |
| 110 | + .button:not(.button-primary) { | |
| 111 | + inline-size: 103px; | |
| 112 | + min-inline-size: 103px; | |
| 113 | + text-align: center; | |
| 114 | + justify-content: center; | |
| 94 | 115 | } |
| 116 | +} | |
| 95 | 117 | |
| 96 | - p:last-child { | |
| 97 | - margin-block-end: 0; | |
| 118 | +.cloud-snippets-table { | |
| 119 | + // Body rows inherit the shared table-cell padding so descriptions can grow | |
| 120 | + // naturally instead of being constrained to a fixed row height. | |
| 121 | + tbody td { | |
| 122 | + vertical-align: middle; | |
| 98 | 123 | } |
| 99 | 124 | |
| 100 | - .cloud-snippet { | |
| 101 | - padding: 24px; | |
| 125 | + .check-column { | |
| 126 | + vertical-align: middle; | |
| 102 | 127 | |
| 103 | - .cloud-snippet-title-button { | |
| 104 | - display: inline; | |
| 105 | - margin: 0; | |
| 106 | - padding: 0; | |
| 107 | - border: none; | |
| 108 | - background: none; | |
| 109 | - font: inherit; | |
| 110 | - color: #2271b1; | |
| 111 | - cursor: pointer; | |
| 112 | - text-align: start; | |
| 113 | - text-decoration: underline; | |
| 114 | - | |
| 115 | - &:focus-visible { | |
| 116 | - outline: 2px solid #2271b1; | |
| 117 | - outline-offset: 2px; | |
| 118 | - border-radius: 2px; | |
| 119 | - } | |
| 128 | + input[type='checkbox'] { | |
| 129 | + @include checkbox.canonical; | |
| 120 | 130 | } |
| 121 | 131 | } |
| 122 | 132 | |
| 123 | - .cloud-snippet-meta { | |
| 124 | - display: flex; | |
| 125 | - gap: 16px; | |
| 133 | + .column-name { | |
| 134 | + inline-size: 22%; | |
| 126 | 135 | } |
| 127 | 136 | |
| 128 | - $status-colors: ( | |
| 129 | - public #64baba, | |
| 130 | - private #cc96fb, | |
| 131 | - unverified #ea835e, | |
| 132 | - ai-verified #1cabcf, | |
| 133 | - pro-verified #7cd68a, | |
| 134 | - ); | |
| 137 | + .column-desc { | |
| 138 | + inline-size: 30%; | |
| 139 | + min-inline-size: 18rem; | |
| 140 | + } | |
| 135 | 141 | |
| 136 | - .cloud-snippet-status { | |
| 137 | - text-transform: uppercase; | |
| 138 | - color: #646970; | |
| 139 | - font-size: 12px; | |
| 140 | - font-weight: 700; | |
| 142 | + .column-type { | |
| 143 | + inline-size: 90px; | |
| 144 | + } | |
| 141 | 145 | |
| 142 | - &::before { | |
| 143 | - content: ''; | |
| 144 | - block-size: 10px; | |
| 145 | - inline-size: 10px; | |
| 146 | - border-radius: 50%; | |
| 147 | - display: inline-block; | |
| 148 | - margin-inline-end: 8px; | |
| 149 | - } | |
| 146 | + .column-status { | |
| 147 | + inline-size: 120px; | |
| 150 | 148 | } |
| 151 | 149 | |
| 152 | - @each $status, $color in $status-colors { | |
| 153 | - .cloud-snippet-status-#{$status}::before { | |
| 154 | - background: $color; | |
| 155 | - } | |
| 150 | + .column-actions { | |
| 151 | + inline-size: 234px; | |
| 156 | 152 | } |
| 157 | 153 | |
| 158 | - footer { | |
| 159 | - display: flex; | |
| 160 | - gap: 8px; | |
| 161 | - background: #f6f7f7; | |
| 162 | - margin-block-start: auto; | |
| 163 | - border-block-start: 1px solid #c3c4c7; | |
| 164 | - padding-inline: 24px; | |
| 165 | - padding-block: 12px; | |
| 166 | - align-items: center; | |
| 154 | + .cloud-table-name-button { | |
| 155 | + background: none; | |
| 156 | + border: 0; | |
| 157 | + padding: 0; | |
| 158 | + margin: 0; | |
| 159 | + font-size: inherit; | |
| 160 | + font-weight: 600; | |
| 161 | + color: var(--cs-color-accent); | |
| 162 | + text-decoration: none; | |
| 163 | + cursor: pointer; | |
| 164 | + text-align: start; | |
| 167 | 165 | |
| 168 | - .dashicons-warning { | |
| 169 | - color: #b32d2e; | |
| 166 | + &:hover, | |
| 167 | + &:focus-visible { | |
| 168 | + color: #135e96; | |
| 169 | + text-decoration: underline; | |
| 170 | 170 | } |
| 171 | - | |
| 172 | - .cloud-snippet-status { | |
| 173 | - margin-inline-end: auto; | |
| 174 | - } | |
| 175 | 171 | } |
| 176 | 172 | |
| 177 | - .cloud-snippet-votes { | |
| 178 | - .dashicons { | |
| 179 | - color: theme.$accent; | |
| 180 | - padding-inline-end: 8px; | |
| 181 | - } | |
| 173 | + // Clamp descriptions so every row stays the same height. | |
| 174 | + .cloud-table-description { | |
| 175 | + display: -webkit-box; | |
| 176 | + -webkit-box-orient: vertical; | |
| 177 | + -webkit-line-clamp: 2; | |
| 178 | + line-clamp: 2; | |
| 179 | + overflow: hidden; | |
| 182 | 180 | } |
| 183 | 181 | } |
| 184 | 182 | |
| 185 | -.cloud-search-results .cloud-search-result footer > .components-spinner { | |
| 186 | - margin: 0; | |
| 187 | -} | |
| 188 | - | |
| 189 | -// Anchored to the card container so this keeps its brand-orange fill above the WP-admin | |
| 190 | -// compatibility layer's secondary-button styling (equal specificity, resolved by source order). | |
| 191 | -.cloud-search-result .cloud-pro-button.button { | |
| 192 | - background-color: theme.$secondary; | |
| 193 | - border-color: theme.$secondary; | |
| 194 | - color: #fff; | |
| 195 | - | |
| 196 | - &:hover, | |
| 197 | - &:focus { | |
| 198 | - background-color: color.adjust(theme.$secondary, $lightness: -10%); | |
| 199 | - border-color: color.adjust(theme.$secondary, $lightness: -10%); | |
| 200 | - color: #fff; | |
| 201 | - } | |
| 183 | +// Community bundles tab shares the same top padding as .cloud-search so the | |
| 184 | +// two tabs' descriptions and inputs align (scoped so the My Library bundles | |
| 185 | +// tab is unaffected). | |
| 186 | +.community-bundles { | |
| 187 | + padding-block-start: 10px; | |
| 202 | 188 | } |