PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.1
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.1
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 0.8.7 All 34 releases
desktop-mode / assets / css / notch.css

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

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