oficina / estilo Public

Clone
git clone https://amadan.net/oficina/estilo

Plain git — no account needed to clone.

Download

Download this file

1/* menu/menu.css: the one floating panel, and the menu bar it hangs from.
2 Every floating surface in the suite uses [estilo-menu]: the account
3 menu, the switcher, the narrow Menu sheet and every menubar menu.
4 A float is rounded and so is a highlight inside it; a menubar title is
5 in the page flow, so it is square (the suite's square rule). */
6:root {
7 --estilo-float-radius: 9px; /* rastrillo's hard-coded dropdown value, named. PUBLIC */
8 --estilo-float-padding: var(--rst-sp-1);
9 --estilo-item-padding-block: var(--rst-sp-1);
10 --estilo-item-padding-inline: var(--rst-sp-3);
11}
12[estilo-menu] {
13 box-sizing: border-box;
14 /* Sized to its rows, not to what it hangs from. Every panel is absolutely
15 positioned inside a <details> no wider than its title, and an absolute
16 box's shrink-to-fit width is capped by that, so without this a row with
17 a shortcut wrapped ("Decrease / indent") inside a menu with room to
18 spare. Docs found it on first adoption. */
19 inline-size: max-content;
20 min-inline-size: 12rem;
21 max-inline-size: min(22rem, calc(100vw - 1rem));
22 /* The 8rem floor is for short frames, where the viewport maths alone can
23 leave a panel a few pixels tall: an overflowing menu can be scrolled,
24 an invisible one cannot. */
25 max-block-size: max(calc(100dvh - var(--estilo-bar-block-size, 3.25rem) - 1rem), 8rem);
26 overflow-y: auto;
27 overscroll-behavior: contain;
28 padding: var(--estilo-float-padding);
29 background: var(--rst-surface);
30 color: var(--rst-text);
31 border: 1px solid var(--rst-line);
32 border-radius: var(--estilo-float-radius);
33 box-shadow: var(--rst-shadow-pop);
34 font-size: var(--rst-fs-sm);
35 text-align: start;
36 z-index: 30;
37}
38[estilo-menu~="sheet"] {
39 position: absolute;
40 inset-inline: 0.5rem;
41 inset-block-start: calc(100% + 4px);
42 inline-size: auto;
43 max-inline-size: none;
44}
45[estilo-menu] form { margin: 0; }
46[estilo-menu-item] {
47 display: flex;
48 align-items: center;
49 gap: var(--rst-sp-2);
50 box-sizing: border-box;
51 inline-size: 100%;
52 min-block-size: 2rem;
53 padding: var(--estilo-item-padding-block) var(--estilo-item-padding-inline);
54 border: 0;
55 border-radius: var(--rst-radius-sm); /* inset and rounded: inside a float */
56 background: none;
57 color: var(--rst-text);
58 font: inherit;
59 text-align: start;
60 text-decoration: none;
61 cursor: pointer;
62}
63[estilo-menu-item]:hover,
64[estilo-menu-item]:focus-visible { background: var(--rst-accent-soft); }
65[estilo-menu-item]:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; }
66/* A destructive row: the negative tone, and its own tint on hover. The
67 label says what it does; the tone says it is the one to read twice. */
68[estilo-menu-item~="danger"] { color: var(--rst-tone-negative-fg); }
69[estilo-menu-item~="danger"]:hover, [estilo-menu-item~="danger"]:focus-visible { background: var(--rst-tone-negative-bg); }
70[estilo-menu-item][aria-disabled="true"],
71[estilo-menu-item]:disabled {
72 color: var(--rst-text-faint);
73 background: none;
74 cursor: default;
75}
76[estilo-menu-check] {
77 display: inline-flex;
78 flex: none;
79 inline-size: 1rem;
80 block-size: 1rem;
81 visibility: hidden;
82 color: var(--rst-accent);
83}
84[estilo-menu-check] svg { inline-size: 100%; block-size: 100%; }
85[estilo-menu-item][aria-pressed="true"] [estilo-menu-check],
86[estilo-menu-item][aria-current] [estilo-menu-check] { visibility: visible; }
87[estilo-menu-icon] { display: inline-flex; flex: none; inline-size: 1.25rem; block-size: 1.25rem; color: currentColor; }
88[estilo-menu-icon] svg { inline-size: 100%; block-size: 100%; }
89[estilo-menu-label] { flex: 1 1 auto; min-inline-size: 0; }
90[estilo-menu-key] {
91 flex: none;
92 margin-inline-start: auto;
93 padding-inline-start: var(--rst-sp-5);
94 color: var(--rst-text-muted);
95 font: inherit;
96 font-size: var(--rst-fs-xs);
97 font-variant-numeric: tabular-nums;
98 white-space: nowrap;
99}
100[estilo-menu] hr {
101 border: 0;
102 border-block-start: 1px solid var(--rst-line);
103 margin: var(--rst-sp-1) 0;
104}
105[estilo-menu-heading] {
106 margin: 0;
107 padding: var(--rst-sp-2) var(--estilo-item-padding-inline) var(--rst-sp-1);
108 color: var(--rst-text-muted);
109 font-size: var(--rst-fs-xs);
110 font-weight: 600; /* no text-transform */
111}
112
113/* The document menu bar: File, Edit, View... Titles are in the page flow,
114 so their highlight is square. Every title joins the one top-level
115 exclusivity group, name="estilo-menus", with the bar's own triggers. */
116[estilo-menubar] { display: flex; flex-wrap: wrap; align-items: stretch; min-block-size: 2rem; }
117[estilo-menubar-menu] { position: relative; }
118[estilo-menubar-menu] > [estilo-menu] {
119 position: absolute;
120 inset-inline-start: 0;
121 inset-block-start: calc(100% + 2px);
122}
123[estilo-menubar-title] {
124 display: flex;
125 align-items: center;
126 box-sizing: border-box;
127 block-size: 100%;
128 min-block-size: 2rem;
129 padding-inline: var(--rst-sp-2);
130 border-radius: 0; /* square: in-flow */
131 color: var(--rst-text);
132 font-size: var(--rst-fs-sm);
133 white-space: nowrap;
134 list-style: none;
135 cursor: default;
136 user-select: none;
137}
138[estilo-menubar-title]::-webkit-details-marker { display: none; }
139[estilo-menubar-title]::marker { content: ""; }
140[estilo-menubar-title]:hover { background: var(--rst-surface-2); }
141[open] > [estilo-menubar-title] { background: var(--rst-accent-soft); }
142[estilo-menubar-title]:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; }
143/* A panel hung from a title near the inline end overflows a phone, so
144 below 30rem every menubar panel spans the viewport instead. */
145@media (max-width: 30rem) {
146 [estilo-menubar-menu] { position: static; }
147 [estilo-menubar] { position: relative; }
148 [estilo-menubar-menu] > [estilo-menu] { inset-inline: 0.5rem; inline-size: auto; min-inline-size: 0; max-inline-size: none; }
149}
150
151/* Touch (the phone web audit, 2026-11-28, findings 9 and 10). A row is a
152 44px target on a coarse pointer, as Apple's and Google's guidance ask,
153 in every app's menus, and so is a menubar title (the wide stacked
154 header keeps its 24px look and takes 44px of hit area, chrome.css). And where nothing hovers and the pointer is a
155 finger, a shortcut hint is noise: nobody can press it, and it takes the
156 room a long label needs. A hardware keyboard on a tablet still works;
157 the shortcuts sheet in Help still lists them. */
158@media (pointer: coarse) {
159 [estilo-menu-item] { min-block-size: 2.75rem; }
160 [estilo-menubar-title] { min-block-size: 2.75rem; }
161}
162@media (hover: none) and (pointer: coarse) {
163 [estilo-menu-key] { display: none; }
164}
165