PluginProbe
Code Snippets / 4.0.0-beta.2
Code Snippets v4.0.0-beta.2
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 / common / _demo.scss

_demo.scss in Code Snippets 4.0.0-beta.2, at css/common/_demo.scss

226 lines 4.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Shared chrome for the feature walkthroughs. Each demo styles its own stage
2 // content; everything here is the frame around it.
3
4 @keyframes demo-fade-in {
5 from {
6 opacity: 0;
7 }
8
9 to {
10 opacity: 1;
11 }
12 }
13
14 // Demo screens have no subnav band between the toolbar and the title, so the
15 // header carries that separation itself. The playback controls sit beside the
16 // title rather than being pushed to the far end of the row.
17 .demo-page-header {
18 justify-content: flex-start;
19
20 h1 {
21 display: flex;
22 align-items: center;
23 gap: 12px;
24 }
25 }
26
27 // Matches the toolbar's "New" badge, so the two read as one signal for the
28 // same feature.
29 .demo-chip {
30 display: inline-flex;
31 justify-content: center;
32 align-items: center;
33 box-sizing: border-box;
34 padding: 5px 10px;
35 border: 1px solid rgb(0 0 0 / 5%);
36 border-radius: 999px;
37 background: linear-gradient(135deg, var(--cs-color-secondary) 0%, #e2953f 100%);
38 color: #fff;
39 font-size: 12px;
40 font-weight: 700;
41 letter-spacing: 0.04em;
42 line-height: 1;
43 text-transform: uppercase;
44 }
45
46 .demo-controls {
47 display: flex;
48 align-items: center;
49 gap: 8px;
50 flex-shrink: 0;
51 }
52
53 .demo-callout {
54 --cs-callout-inline-size: 320px;
55
56 // Anchored to the foot of the viewport rather than its middle: the demo
57 // pages fill their width, so a centred panel lands on the fields the
58 // commentary is describing.
59 position: fixed;
60 inset-inline-end: 28px;
61 inset-block-end: 28px;
62 z-index: 100;
63 inline-size: var(--cs-callout-inline-size);
64 box-sizing: border-box;
65 padding: 16px 18px;
66 border: 1px solid #b9d4ea;
67 border-inline-start: 4px solid var(--cs-color-accent);
68 border-radius: var(--cs-card-radius);
69 background: #f4f9fd;
70 box-shadow: 0 6px 20px rgb(0 0 0 / 18%);
71 animation: demo-callout-in 300ms ease both;
72
73 // Narrow screens have no room beside the walkthrough, so the panel is
74 // dropped rather than allowed to obscure the thing it describes.
75 @media (width <= 1400px) {
76 display: none;
77 }
78 }
79
80 .demo-callout__step {
81 display: block;
82 margin-block-end: 6px;
83 color: var(--cs-color-accent);
84 font-size: 11px;
85 font-weight: 700;
86 letter-spacing: 0.06em;
87 text-transform: uppercase;
88 }
89
90 .demo-callout__title {
91 margin-block: 0 6px;
92 font-size: 15px;
93 font-weight: 600;
94 color: var(--cs-color-text);
95 }
96
97 .demo-callout__body {
98 margin: 0;
99 font-size: 13px;
100 line-height: 1.5;
101 color: var(--cs-color-text-secondary);
102 }
103
104 @keyframes demo-callout-in {
105 from {
106 opacity: 0;
107 transform: translateY(12px);
108 }
109
110 to {
111 opacity: 1;
112 transform: translateY(0);
113 }
114 }
115
116 // A modal draws its own overlay across the whole viewport, which would dim the
117 // commentary along with the page behind it. The callout keeps its corner and
118 // rises above the overlay instead, narrowing to the gutter beside the modal so
119 // it never covers what it is describing.
120 body.modal-open .demo-callout {
121 // One step above the WordPress modal overlay (100000), so the commentary is
122 // not dimmed by a modal the walkthrough opened.
123 z-index: 100001;
124 inline-size: calc((100vw - var(--cs-preview-modal-inline-size)) / 2 - var(--cs-preview-modal-inset));
125 max-inline-size: var(--cs-callout-inline-size);
126 }
127
128 // Marks the button the walkthrough is "clicking", so a simulated press reads
129 // as deliberate rather than as a stray focus ring.
130 .demo-click {
131 position: relative;
132 outline: 2px solid var(--cs-color-error);
133 outline-offset: 2px;
134
135 &::after {
136 content: '';
137 position: absolute;
138 inset-block-start: 50%;
139 inset-inline-start: 50%;
140 inline-size: 12px;
141 block-size: 12px;
142 margin-block-start: -6px;
143 margin-inline-start: -6px;
144 border-radius: 50%;
145 background: var(--cs-color-error);
146 box-shadow: 0 0 0 3px rgb(214 54 56 / 30%);
147 animation: demo-click-pulse 1.1s ease-out infinite;
148 pointer-events: none;
149 }
150 }
151
152 @keyframes demo-click-pulse {
153 0% {
154 box-shadow: 0 0 0 3px rgb(214 54 56 / 40%);
155 }
156
157 70% {
158 box-shadow: 0 0 0 12px rgb(214 54 56 / 0%);
159 }
160
161 100% {
162 box-shadow: 0 0 0 3px rgb(214 54 56 / 0%);
163 }
164 }
165
166 // Dims and blurs everything except the part of the page being described.
167 .demo-spotlight {
168 position: fixed;
169 inset: 0;
170 z-index: 90;
171 pointer-events: none;
172 }
173
174 .demo-spotlight__panel {
175 position: fixed;
176 background: rgb(29 35 39 / 45%);
177 backdrop-filter: blur(3px);
178 transition: all 200ms ease;
179 }
180
181 .demo-spotlight__ring {
182 position: fixed;
183 border: 2px solid #fff;
184 border-radius: 5px;
185 box-shadow: 0 0 0 1px rgb(29 35 39 / 25%), 0 8px 24px rgb(0 0 0 / 25%);
186 transition: all 200ms ease;
187 }
188
189 .demo-upsell {
190 border: 1px solid #c5d9ed;
191 border-radius: var(--cs-card-radius);
192 background: var(--cs-color-surface-info);
193 padding: 20px;
194 animation: demo-fade-in 0.35s ease;
195
196 p {
197 margin-block: 0 12px;
198 color: var(--cs-color-text);
199 }
200 }
201
202 .demo-upsell__title {
203 margin-block: 0 10px;
204 font-size: 16px;
205 }
206
207 .demo-upsell__actions {
208 display: flex;
209 align-items: center;
210 flex-wrap: wrap;
211 gap: 10px;
212 }
213
214 @media (prefers-reduced-motion: reduce) {
215 .demo-upsell,
216 .demo-callout,
217 .demo-click::after {
218 animation: none;
219 }
220
221 .demo-spotlight__panel,
222 .demo-spotlight__ring {
223 transition: none;
224 }
225 }
226