PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.11
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.11
1.1.11 1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 All 35 releases
desktop-mode / assets / css / notch.css

notch.css in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.11, at assets/css/notch.css

198 lines 6.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*
2 * The notch — top-centre, floating, never reserving.
3 *
4 * The load-bearing rule in this file is that nothing here touches
5 * `.os-area`. The desktop has one work-area rectangle now
6 * (`src/work-area/index.ts`, carved out of the area by the dock),
7 * and it stays useful only while few things carve it; a notch that
8 * reserved height would be a second claimant on the top edge for
9 * the sake of a pill a window may cover. It floats, and it gets out
10 * of the way instead.
11 *
12 * Getting out of the way is also what the stacking order says: the
13 * notch is on the desk, under the window layer, so a window reaching
14 * the top edge covers the pill instead of the pill hanging over it.
15 */
16
17 /*
18 * Anchored to the SHELL, not the viewport. `.os-shell` starts below
19 * the admin bar when the user keeps it, and at the viewport top when
20 * they don't, so an absolutely-positioned notch lands correctly in
21 * every admin-bar mode without knowing which one is on. Fixed
22 * positioning put it under the bar, which paints above the shell.
23 */
24 .os-notch {
25 position: absolute;
26 top: 0;
27 left: 50%;
28 transform: translateX( -50% );
29 z-index: var( --os-z-notch, 60 );
30
31 display: flex;
32 align-items: center;
33 gap: 7px;
34 max-width: min( 420px, 60vw );
35 height: 34px;
36 padding: 0 14px;
37 /*
38 * A hairline all the way round except the top, where the pill meets
39 * the screen edge and a line would draw a lid on it. Without the
40 * border the surface disappeared into the default wallpaper — Void
41 * on Void, with only the shadow separating them.
42 */
43 border: 1px solid var( --os-notch-border, rgba( 255, 251, 255, 0.22 ) );
44 border-top: 0;
45 /* Square at the top, round below — it reads as hanging from the
46 screen edge rather than floating near it. */
47 border-radius: 0 0 15px 15px;
48 /* The bottom dock pill's glass, to the number: a pill hanging off
49 an edge should not be a second recipe. Its inset top highlight is
50 not copied, since this top edge is fused to the screen. */
51 background: var( --os-notch-bg, rgba( 20, 18, 24, 0.92 ) );
52 backdrop-filter: blur( 28px ) saturate( 170% );
53 -webkit-backdrop-filter: blur( 28px ) saturate( 170% );
54 box-shadow: 0 10px 32px var( --os-notch-shadow, rgba( 0, 0, 0, 0.4 ) );
55 color: var( --os-ui-fg, #fffbff );
56 font-size: 13px;
57 line-height: 1;
58 cursor: pointer;
59 /* `width` is not animated: the pill is sized by its content, and
60 transitioning an auto width does nothing. The message's own
61 max-width is what opens and closes. */
62 transition: background 160ms ease, opacity 160ms ease,
63 border-color 160ms ease, top 180ms ease,
64 visibility 0s linear 160ms;
65 }
66
67 .os-notch:hover,
68 .os-notch:focus-visible {
69 background: var( --os-notch-bg-hover, rgba( 32, 29, 38, 0.96 ) );
70 border-color: var( --os-ui-accent-dim, rgba( 242, 82, 252, 0.5 ) );
71 }
72
73 .os-notch:focus-visible {
74 outline: 2px solid var( --os-ui-accent, #f252fc );
75 outline-offset: -2px;
76 }
77
78 .os-notch__glyph {
79 display: flex;
80 flex: 0 0 auto;
81 width: 18px;
82 height: 18px;
83 }
84
85 .os-notch__glyph svg {
86 width: 100%;
87 height: 100%;
88 fill: currentColor;
89 }
90
91 /*
92 * The resting label. It yields to a message rather than sitting
93 * beside one — the notch says one thing at a time, and "Site
94 * assistant · Saving…" would be two.
95 */
96 .os-notch__label {
97 overflow: hidden;
98 max-width: 160px;
99 white-space: nowrap;
100 text-overflow: ellipsis;
101 transition: max-width 200ms ease, opacity 120ms ease;
102 }
103
104 .os-notch--speaking .os-notch__label {
105 max-width: 0;
106 opacity: 0;
107 }
108
109 /*
110 * The message is always in the DOM (it is an `aria-live` region and
111 * has to be, to be announced reliably); it is its WIDTH that opens.
112 * `max-width` rather than `display` so there is something to animate
113 * and so the live region is never removed from the accessibility tree.
114 */
115 .os-notch__message {
116 overflow: hidden;
117 max-width: 0;
118 white-space: nowrap;
119 text-overflow: ellipsis;
120 transition: max-width 200ms ease;
121 }
122
123 .os-notch--speaking .os-notch__message {
124 max-width: 320px;
125 }
126
127 /*
128 * Overview is the shell talking about itself — a zoomed-out view of
129 * every window and desktop. A pill hanging over that view is chrome
130 * on top of chrome, and it lands squarely on the desktop thumbnails.
131 * Mio steps aside for the same reason and in the same way.
132 *
133 * `visibility` alongside the fade so it stops taking clicks on the way
134 * out; a transparent button over a desktop thumbnail still swallows
135 * the click that was meant to switch desktops.
136 */
137 .os-shell:has( .os-area--overview ) .os-notch {
138 opacity: 0;
139 visibility: hidden;
140 /* No delay on the way OUT — the pill must stop taking clicks the
141 moment it starts fading, not after. The delay in the base rule
142 is what holds it visible while it fades back IN. */
143 transition-delay: 0s;
144 }
145
146 /* Solo mode is one window freed into a native OS window — the shell's
147 own chrome has no place in it. */
148 body.os-solo .os-notch {
149 display: none;
150 }
151
152 @media ( prefers-reduced-motion: reduce ) {
153 .os-notch,
154 .os-notch__label,
155 .os-notch__message {
156 transition-duration: 1ms;
157 }
158 }
159
160 /*
161 * Auto-hide admin bar.
162 *
163 * The shell starts at the viewport top in this mode (the bar is out of
164 * flow), so the notch would be underneath the bar whenever it rolls
165 * down. It steps down to sit below it instead, on the bar's own timing.
166 */
167 body.os-active.os-admin-bar-dynamic:has( #wpadminbar:hover ) .os-notch,
168 body.os-active.os-admin-bar-dynamic:has( #wpadminbar:focus-within ) .os-notch,
169 body.os-active.os-admin-bar-dynamic:has( .os-notch:hover ) .os-notch,
170 body.os-active.os-admin-bar-dynamic:has( .os-notch:focus-visible ) .os-notch {
171 /* The bar's measured edge (src/admin-bar-height.ts), Core's token
172 behind it — a host that made the bar taller moved this step too. */
173 top: var( --os-admin-bar-height, var( --wp-admin--admin-bar--height, 32px ) );
174 }
175
176 /*
177 * The hover bridge, and it is what makes the step stable.
178 *
179 * Hovering the notch is one of the things that rolls the bar down, and
180 * the notch answers by moving 32px away from the pointer — which ends
181 * the hover, retracts the bar, and brings the notch back up under the
182 * pointer to start again. This claims the space the notch vacates, so
183 * the pointer is still over the element after the step. Hovering a
184 * pseudo-element counts as hovering its owner, the same trick the
185 * bar's own reveal zone uses.
186 *
187 * Only in this mode: nothing moves in the other two, and a permanent
188 * 32px hit area hanging off the notch would swallow clicks meant for
189 * whatever is behind it.
190 */
191 body.os-active.os-admin-bar-dynamic .os-notch::before {
192 content: "";
193 position: absolute;
194 inset-inline: 0;
195 inset-block-end: 100%;
196 height: var( --os-admin-bar-height, var( --wp-admin--admin-bar--height, 32px ) );
197 }
198