| 1 |
@use '../common/theme'; |
| 2 |
@use '../common/cards'; |
| 3 |
|
| 4 |
.cloud-search-result { |
| 5 |
p:last-child { |
| 6 |
margin-block-end: 0; |
| 7 |
} |
| 8 |
|
| 9 |
.card-inner { |
| 10 |
display: flex; |
| 11 |
flex-flow: column; |
| 12 |
gap: 16px; |
| 13 |
} |
| 14 |
|
| 15 |
.snippet-card-header { |
| 16 |
display: flex; |
| 17 |
align-items: center; |
| 18 |
gap: 10px; |
| 19 |
|
| 20 |
// Keep header content clear of the absolutely-positioned selection checkbox. |
| 21 |
padding-inline-end: 32px; |
| 22 |
|
| 23 |
h3 { |
| 24 |
margin: 0; |
| 25 |
font-size: 18px; |
| 26 |
font-weight: 700; |
| 27 |
line-height: 1.5; |
| 28 |
min-inline-size: 0; |
| 29 |
} |
| 30 |
|
| 31 |
.cloud-snippet-title-button { |
| 32 |
display: block; |
| 33 |
max-inline-size: 100%; |
| 34 |
margin: 0; |
| 35 |
padding: 0; |
| 36 |
border: none; |
| 37 |
background: none; |
| 38 |
font: inherit; |
| 39 |
color: theme.$accent; |
| 40 |
cursor: pointer; |
| 41 |
text-align: start; |
| 42 |
overflow: hidden; |
| 43 |
white-space: nowrap; |
| 44 |
text-overflow: ellipsis; |
| 45 |
|
| 46 |
&:hover, &:focus { |
| 47 |
text-decoration: underline; |
| 48 |
} |
| 49 |
|
| 50 |
&:focus-visible { |
| 51 |
outline: 2px solid theme.$accent; |
| 52 |
outline-offset: 2px; |
| 53 |
border-radius: 2px; |
| 54 |
} |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
.snippet-card-meta { |
| 59 |
display: flex; |
| 60 |
align-items: center; |
| 61 |
flex-wrap: wrap; |
| 62 |
gap: 16px; |
| 63 |
font-size: 14px; |
| 64 |
line-height: 1.5; |
| 65 |
|
| 66 |
.cloud-snippet-tags { |
| 67 |
color: theme.$accent; |
| 68 |
} |
| 69 |
|
| 70 |
.snippet-card-modified { |
| 71 |
color: #6c7e7e; |
| 72 |
margin-inline-start: auto; |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
.snippet-description-content { |
| 77 |
display: -webkit-box; |
| 78 |
-webkit-box-orient: vertical; |
| 79 |
-webkit-line-clamp: 2; |
| 80 |
line-clamp: 2; |
| 81 |
overflow: hidden; |
| 82 |
margin: 0; |
| 83 |
font-size: 14px; |
| 84 |
line-height: 1.5; |
| 85 |
color: #646970; |
| 86 |
border-block-start: 1px solid #dcdcde; |
| 87 |
padding-block-start: 16px; |
| 88 |
} |
| 89 |
|
| 90 |
.cloud-snippet-author { |
| 91 |
margin: 0; |
| 92 |
font-size: 14px; |
| 93 |
color: #646970; |
| 94 |
|
| 95 |
a { |
| 96 |
color: theme.$accent; |
| 97 |
} |
| 98 |
} |
| 99 |
|
| 100 |
footer { |
| 101 |
.dashicons-warning { |
| 102 |
color: #b32d2e; |
| 103 |
} |
| 104 |
|
| 105 |
.cloud-snippet-update svg { |
| 106 |
display: block; |
| 107 |
} |
| 108 |
|
| 109 |
.button { |
| 110 |
font-size: 14px; |
| 111 |
line-height: 2.5714; |
| 112 |
border-radius: 5px; |
| 113 |
} |
| 114 |
|
| 115 |
.button:not(.button-primary, .cloud-pro-button) { |
| 116 |
background: transparent; |
| 117 |
} |
| 118 |
} |
| 119 |
} |
| 120 |
|
| 121 |
.cloud-search-results .cloud-search-result footer .components-spinner { |
| 122 |
margin: 0; |
| 123 |
} |
| 124 |
|
| 125 |
// Pro-only actions use the same quiet outline treatment in card and table views. |
| 126 |
.cloud-pro-button.button { |
| 127 |
background-color: transparent; |
| 128 |
border-color: theme.$accent; |
| 129 |
color: theme.$accent; |
| 130 |
|
| 131 |
&:hover, |
| 132 |
&:focus { |
| 133 |
background-color: #eff5f9; |
| 134 |
border-color: theme.$accent; |
| 135 |
color: theme.$accent; |
| 136 |
} |
| 137 |
} |
| 138 |
|
| 139 |
// Three equal-height snippet cards per row, matching the manage snippets |
| 140 |
// grid. minmax(0, 1fr) lets columns shrink below their content width so |
| 141 |
// the grid never overflows the page. |
| 142 |
ul.cloud-search-results.code-snippets-cards { |
| 143 |
grid-template-columns: repeat(3, minmax(0, 1fr)); |
| 144 |
|
| 145 |
@media (width <= 1100px) { |
| 146 |
grid-template-columns: repeat(2, minmax(0, 1fr)); |
| 147 |
} |
| 148 |
|
| 149 |
@media (width <= 782px) { |
| 150 |
grid-template-columns: minmax(0, 1fr); |
| 151 |
} |
| 152 |
|
| 153 |
.code-snippets-card { |
| 154 |
min-inline-size: 0; |
| 155 |
|
| 156 |
footer { |
| 157 |
flex-wrap: wrap; |
| 158 |
} |
| 159 |
} |
| 160 |
|
| 161 |
// Reveal the bulk-select checkbox on hover or keyboard focus, and keep |
| 162 |
// every checkbox visible while any card in the grid is selected so an |
| 163 |
// in-progress selection is never hidden. |
| 164 |
.snippet-card-select { |
| 165 |
opacity: 0; |
| 166 |
transition: opacity 0.15s ease; |
| 167 |
|
| 168 |
@media (prefers-reduced-motion: reduce) { |
| 169 |
transition-duration: 0.01s; |
| 170 |
} |
| 171 |
} |
| 172 |
|
| 173 |
.snippet-card-select:checked, |
| 174 |
&.has-selection .snippet-card-select, |
| 175 |
.code-snippets-card:hover .snippet-card-select, |
| 176 |
.code-snippets-card:focus-within .snippet-card-select { |
| 177 |
opacity: 1; |
| 178 |
} |
| 179 |
} |
| 180 |
|