PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.0
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.0
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.0, at assets/css/notch.css

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