PluginProbe
Code Snippets / 3.10.1
Code Snippets v3.10.1
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 3.0.1 All 64 releases
code-snippets / css / edit / _form.scss

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

177 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
62 .button.button-large {
63 display: flex;
64 align-items: center;
65 gap: 8px;
66 inline-size: 100%;
67 border-color: theme.$control-border;
68 background: transparent;
69 padding: 6px 12px;
70
71 &:hover:not(:disabled),
72 &:focus:not(:disabled) {
73 background: #f6f7f7;
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: theme.$accent;
86 border-color: theme.$accent;
87 }
88 }
89
90 .snippet-form {
91 margin-block-start: 10px;
92 display: grid;
93 gap: $sidebar-gap;
94 grid-template-columns: 1fr $sidebar-width;
95 grid-template-areas: 'upper sidebar' 'lower sidebar';
96 transition: all 700ms;
97
98 @media (prefers-reduced-motion: reduce) {
99 transition-duration: 0.01s;
100 }
101
102 &.snippet-form-expanded {
103 grid-template-areas: 'upper upper' 'lower sidebar';
104 }
105
106 .snippet-form-upper {
107 grid-area: upper;
108 }
109
110 .snippet-form-lower {
111 grid-area: lower;
112 }
113
114 .snippet-form-upper,
115 .snippet-form-lower {
116 display: flex;
117 flex-flow: column;
118 gap: 24px;
119 }
120
121 .snippet-editor-sidebar {
122 grid-area: span 3 / sidebar;
123 max-inline-size: $sidebar-width;
124 position: sticky;
125 overflow: clip;
126
127 // Keep the sidebar clear of the fixed WordPress admin bar and leave a
128 // usable visual gap beneath it while the editor scrolls.
129 inset-block-start: 48px;
130 align-self: start;
131
132 @media (width <= 782px) {
133 position: static;
134 }
135 }
136
137 @media (width <= 1024px) {
138 grid-template-columns: 1fr;
139 }
140
141 h2, h3 {
142 margin-block: 25px 15px;
143 margin-inline: 0;
144 font-size: 1.16em;
145
146 label {
147 cursor: auto;
148 }
149
150 .button {
151 font-weight: normal;
152 }
153 }
154 }
155
156 .above-editor-container {
157 display: flex;
158 flex-flow: row wrap;
159 gap: 1em;
160
161 > * {
162 flex: 1;
163 display: flex;
164 flex-flow: column;
165 min-inline-size: 180px;
166 }
167 }
168
169 // Match the location selector's control height to the adjacent conditions
170 // button so the two sidebar controls line up. This targets a different
171 // container than the type selector rules above, so their relative order does
172 // not affect the cascade.
173 // stylelint-disable-next-line no-descending-specificity
174 .snippet-editor-sidebar .code-snippets-select.code-snippets-select-location > div:first-of-type {
175 min-block-size: 48px;
176 }
177