| 1 |
@use '../common/theme'; |
| 2 |
|
| 3 |
.snippet-form #titlediv #title { |
| 4 |
border-color: var(--cs-color-border); |
| 5 |
border-radius: 5px; |
| 6 |
block-size: 45px; |
| 7 |
margin: 0; |
| 8 |
} |
| 9 |
|
| 10 |
// The type selector is a react-select control that sizes to its content; pin |
| 11 |
// its bordered control box to the same 45px as the adjacent title field and |
| 12 |
// keep the selected value vertically centred within it. |
| 13 |
.snippet-type-container .code-snippets-select { |
| 14 |
block-size: 100%; |
| 15 |
|
| 16 |
// Target the control box only (:first-of-type). The open menu is a later |
| 17 |
// sibling div; matching it here would clamp and flex-row the option list. |
| 18 |
> div:first-of-type { |
| 19 |
border-color: var(--cs-color-border); |
| 20 |
min-block-size: 45px; |
| 21 |
block-size: 45px; |
| 22 |
max-block-size: 45px; |
| 23 |
} |
| 24 |
|
| 25 |
> div:first-of-type > div:first-child { |
| 26 |
display: flex; |
| 27 |
align-items: center; |
| 28 |
block-size: 45px; |
| 29 |
padding-block: 0; |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
.snippet-type-option { |
| 34 |
display: flex; |
| 35 |
align-items: center; |
| 36 |
justify-content: space-between; |
| 37 |
flex-flow: row; |
| 38 |
gap: 2em; |
| 39 |
|
| 40 |
.snippet-type-option-main { |
| 41 |
display: flex; |
| 42 |
align-items: center; |
| 43 |
gap: 8px; |
| 44 |
} |
| 45 |
|
| 46 |
.small-badge { |
| 47 |
margin-inline-start: 0.5em; |
| 48 |
} |
| 49 |
} |
| 50 |
|
| 51 |
|
| 52 |
.conditions-editor-open { |
| 53 |
.conditions-editor-header { |
| 54 |
display: flex; |
| 55 |
align-items: center; |
| 56 |
justify-content: flex-start; |
| 57 |
gap: 8px; |
| 58 |
margin-block-end: 8px; |
| 59 |
} |
| 60 |
|
| 61 |
.button.button-large { |
| 62 |
display: flex; |
| 63 |
align-items: center; |
| 64 |
gap: 8px; |
| 65 |
inline-size: 100%; |
| 66 |
min-block-size: 48px; |
| 67 |
border-color: var(--cs-color-accent); |
| 68 |
background: transparent; |
| 69 |
padding: 6px 12px; |
| 70 |
|
| 71 |
&:hover:not(:disabled), |
| 72 |
&:focus:not(:disabled) { |
| 73 |
background: var(--cs-color-surface-subtle); |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
&.no-condition .cond-badge { |
| 78 |
background: transparent; |
| 79 |
color: inherit; |
| 80 |
border: 1px solid currentcolor; |
| 81 |
} |
| 82 |
|
| 83 |
&.no-condition:hover :not([disabled]) .cond-badge { |
| 84 |
color: #fff; |
| 85 |
background: var(--cs-color-accent); |
| 86 |
border-color: var(--cs-color-accent); |
| 87 |
} |
| 88 |
} |
| 89 |
|
| 90 |
.snippet-form { |
| 91 |
display: grid; |
| 92 |
gap: var(--cs-sidebar-gap); |
| 93 |
grid-template-columns: 1fr var(--cs-sidebar-width); |
| 94 |
grid-template-areas: 'upper sidebar' 'lower sidebar'; |
| 95 |
transition: all 700ms; |
| 96 |
|
| 97 |
@media (prefers-reduced-motion: reduce) { |
| 98 |
transition-duration: 0.01s; |
| 99 |
} |
| 100 |
|
| 101 |
&.snippet-form-expanded { |
| 102 |
grid-template-areas: 'upper upper' 'lower sidebar'; |
| 103 |
} |
| 104 |
|
| 105 |
.snippet-form-upper { |
| 106 |
grid-area: upper; |
| 107 |
} |
| 108 |
|
| 109 |
.snippet-form-lower { |
| 110 |
grid-area: lower; |
| 111 |
} |
| 112 |
|
| 113 |
.snippet-form-upper, |
| 114 |
.snippet-form-lower { |
| 115 |
display: flex; |
| 116 |
flex-flow: column; |
| 117 |
gap: 24px; |
| 118 |
} |
| 119 |
|
| 120 |
.snippet-editor-sidebar { |
| 121 |
grid-area: span 3 / sidebar; |
| 122 |
max-inline-size: var(--cs-sidebar-width); |
| 123 |
position: sticky; |
| 124 |
overflow: clip; |
| 125 |
|
| 126 |
// Keep the sidebar clear of the fixed WordPress admin bar and leave a |
| 127 |
// usable visual gap beneath it while the editor scrolls. |
| 128 |
inset-block-start: 48px; |
| 129 |
align-self: start; |
| 130 |
|
| 131 |
@media (width <= 782px) { |
| 132 |
position: static; |
| 133 |
} |
| 134 |
} |
| 135 |
|
| 136 |
@media (width <= 1024px) { |
| 137 |
grid-template-columns: 1fr; |
| 138 |
} |
| 139 |
|
| 140 |
h2, h3 { |
| 141 |
margin-block: 25px 15px; |
| 142 |
margin-inline: 0; |
| 143 |
font-size: 1.16em; |
| 144 |
|
| 145 |
label { |
| 146 |
cursor: auto; |
| 147 |
} |
| 148 |
|
| 149 |
.button { |
| 150 |
font-weight: normal; |
| 151 |
} |
| 152 |
} |
| 153 |
} |
| 154 |
|
| 155 |
.above-editor-container { |
| 156 |
display: flex; |
| 157 |
flex-flow: row wrap; |
| 158 |
gap: 1em; |
| 159 |
|
| 160 |
> * { |
| 161 |
flex: 1; |
| 162 |
display: flex; |
| 163 |
flex-flow: column; |
| 164 |
min-inline-size: 180px; |
| 165 |
} |
| 166 |
} |
| 167 |
|
| 168 |
// Match the location selector's control height to the adjacent conditions |
| 169 |
// button so the two sidebar controls line up. This targets a different |
| 170 |
// container than the type selector rules above, so their relative order does |
| 171 |
// not affect the cascade. |
| 172 |
// stylelint-disable-next-line no-descending-specificity |
| 173 |
.snippet-editor-sidebar .code-snippets-select.code-snippets-select-location > div:first-of-type { |
| 174 |
min-block-size: 48px; |
| 175 |
} |
| 176 |
|