PluginProbe
Code Snippets / 3.10.0
Code Snippets v3.10.0
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / css / edit / _form.scss

_form.scss in Code Snippets 3.10.0, at css/edit/_form.scss

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