oficina / calendar Public

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

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: 0.25rem;
9 --estilo-item-padding-block: 0.4rem;
10 --estilo-item-padding-inline: 0.65rem;
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: 0.5rem;
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-label] { flex: 1 1 auto; min-inline-size: 0; }
88[estilo-menu-key] {
89 flex: none;
90 margin-inline-start: auto;
91 padding-inline-start: 1.5rem;
92 color: var(--rst-text-muted);
93 font: inherit;
94 font-size: var(--rst-fs-xs);
95 font-variant-numeric: tabular-nums;
96 white-space: nowrap;
97}
98[estilo-menu] hr {
99 border: 0;
100 border-block-start: 1px solid var(--rst-line);
101 margin: 0.25rem 0;
102}
103[estilo-menu-heading] {
104 margin: 0;
105 padding: 0.5rem var(--estilo-item-padding-inline) 0.25rem;
106 color: var(--rst-text-muted);
107 font-size: var(--rst-fs-xs);
108 font-weight: 600; /* no text-transform */
109}
110
111/* The document menu bar: File, Edit, View... Titles are in the page flow,
112 so their highlight is square. Every title joins the one top-level
113 exclusivity group, name="estilo-menus", with the bar's own triggers. */
114[estilo-menubar] { display: flex; flex-wrap: wrap; align-items: stretch; min-block-size: 2rem; }
115[estilo-menubar-menu] { position: relative; }
116[estilo-menubar-menu] > [estilo-menu] {
117 position: absolute;
118 inset-inline-start: 0;
119 inset-block-start: calc(100% + 2px);
120}
121[estilo-menubar-title] {
122 display: flex;
123 align-items: center;
124 box-sizing: border-box;
125 block-size: 100%;
126 min-block-size: 2rem;
127 padding-inline: 0.6rem;
128 border-radius: 0; /* square: in-flow */
129 color: var(--rst-text);
130 font-size: var(--rst-fs-sm);
131 white-space: nowrap;
132 list-style: none;
133 cursor: default;
134 user-select: none;
135}
136[estilo-menubar-title]::-webkit-details-marker { display: none; }
137[estilo-menubar-title]::marker { content: ""; }
138[estilo-menubar-title]:hover { background: var(--rst-surface-2); }
139[open] > [estilo-menubar-title] { background: var(--rst-accent-soft); }
140[estilo-menubar-title]:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; }
141/* A panel hung from a title near the inline end overflows a phone, so
142 below 30rem every menubar panel spans the viewport instead. */
143@media (max-width: 30rem) {
144 [estilo-menubar-menu] { position: static; }
145 [estilo-menubar] { position: relative; }
146 [estilo-menubar-menu] > [estilo-menu] { inset-inline: 0.5rem; inline-size: auto; min-inline-size: 0; max-inline-size: none; }
147}
148