Repository navigation
Expand file tree
/
Copy pathshell.css
More file actions
164 lines (164 loc) · 17.6 KB
/
Copy pathshell.css
File metadata and controls
164 lines (164 loc) · 17.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/* The window's shell (shell.html, shell.js): the pages fill it edge to edge with a hairline between them, as one
page did before Trellis; its own tokens are set from shell.js because they follow the page's theme. */
html, body { margin: 0; height: 100%; overflow: hidden; background: #fff; }
/* Until shell.js has set the theme (once Trellis has loaded) nothing is drawn: the window behind, already in the theme
the pages drew in last (main.js createWindow), shows instead of a light header and sidebar flashing at boot. */
html:not([data-theme]), html:not([data-theme]) body { background: transparent; }
html:not([data-theme]) body { visibility: hidden; }
[data-theme="dark"] { color-scheme: dark; } /* as the page's own (styles.css): an iframe whose color-scheme differs is drawn opaque, and a covering page must be see-through */
[data-theme="dark"] body { background: #1b1d1e; }
/* The header holds the traffic lights and, on the right, the app's own switches (sensitive items, ⌘K, Help, Graph) and drags the window; the panes fill the rest, their tab bars the
full width. Above the header only while a page covers the window (its palette's scrim goes over both). */
.head { position: fixed; top: 0; left: 0; right: 0; height: 38px; box-sizing: border-box; display: flex; align-items: center; justify-content: flex-end; gap: 2px; padding: 0 12px 0 80px;
background: #f6f6f6; -webkit-app-region: drag; user-select: none; }
[data-theme="dark"] .head { background: #232627; }
.head button { -webkit-app-region: no-drag; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; color: #777; opacity: .5; cursor: pointer; }
.head button:hover { background: #ddd; opacity: 1; }
/* the page's Graph switch, copied here (renderer/rail.js): at full strength while the Graph pane is open, as a pressed toggle */
:is(.trellis [data-trellis-part="accessory"], .headnav) button[data-for="navLinks"][aria-pressed="true"] { opacity: 1; }
[data-theme="dark"] .head button { color: #aaa; }
[data-theme="dark"] .head button:hover { background: #3a3f42; }
.head svg { display: block; width: 18px; height: 18px; }
/* One page (no tab bar): its header buttons (shell.js drawNav) sit in the window's header, left of the app's own, a
bullet between the two; shown, as in a tab bar, while the pointer is over the page or the header. */
.headnav { display: flex; align-items: center; }
.headnav:empty, .headnav:empty + .headsep { display: none; }
.headsep { margin: 0 8px; color: #b5b5b5; font-size: 12px; }
.headsep::before { content: '•'; }
.head:not(:hover) .headnav:not([data-pointer]) button, .head:not(:hover) .headnav:not([data-pointer]) + .headsep { opacity: 0; }
.headnav button:disabled:hover { background: none; }
[data-theme="dark"] .headsep { color: #5b6064; }
body.signed-out .head button { display: none; } /* signed out, none of them does anything: the login is the whole window */
body.signed-out .head { background: #fff; } /* and the header is the page's own white, one surface with it */
[data-theme="dark"] body.signed-out .head { background: #1b1d1e; }
#workspace { position: fixed; inset: 38px 0 0 var(--sw, 0px); z-index: 1; }
/* The window's sidebar (shell.js): under the header, in the header's grey, as wide as --sw (0 while it is shut). Its
rows are the app's grey glyphs and words; a section's heading folds it, showing how many pins it holds. */
.sidebar { position: fixed; top: 38px; bottom: 0; left: 0; width: var(--sw, 0px); box-sizing: border-box; padding: 8px 10px 16px; overflow: hidden auto;
background: #f6f6f6; color: #1a1a1a; font: 13.5px -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; user-select: none; } /* the page's words and smoothing (styles.css body) */
body.signed-out .sidebar, body.signed-out .sbedge, body.signed-out .sbcorner { display: none; }
body.signed-out #workspace { left: 0; }
.sbrow { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: left; cursor: default; }
.sbrow:hover { background: #ececec; }
.sbrow.on { background: #e4e4e4; }
.sbrow.drop { box-shadow: inset 0 0 0 2px #3b82f6; } /* rows dragged onto a chat here go into its message (shell.js sbChatDrop) */
.sbrow svg { flex: none; display: block; width: 16px; height: 16px; color: #8a8a8a; }
.sbrow .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbrow kbd, .sbsec .n { margin-left: auto; font: inherit; font-size: 12px; color: #666; }
.sbrow.sensitive .t { filter: blur(4px); } /* blurred as the pages blur it, until the header's eye shows sensitive items */
body.show-sensitive .sbrow.sensitive .t { filter: none; }
.sbsec { display: flex; align-items: center; gap: 4px; width: 100%; height: 26px; margin-top: 14px; padding: 0 8px; border: 0; background: none; color: #666; font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: default; }
.sbsec svg { width: 12px; height: 12px; margin-left: auto; color: #8a8a8a; opacity: 0; transform: rotate(90deg); }
.sbsec:hover svg { opacity: 1; }
.sbsec.shut svg { display: none; }
.sbempty { margin: 14px 8px 0; color: #666; font-size: 12px; line-height: 17px; }
[data-theme="dark"] .sidebar { background: #232627; color: #c9c9c9; }
[data-theme="dark"] .sbrow:hover { background: #2d3133; }
[data-theme="dark"] .sbrow.on { background: #353a3c; }
[data-theme="dark"] :is(.sbrow svg, .sbsec svg) { color: #8d9295; }
[data-theme="dark"] :is(.sbrow kbd, .sbsec, .sbsec .n, .sbempty) { color: #a0a5a8; }
/* At its narrowest it is its icons (body.sb-rail, shell.js SB_RAIL): each row its glyph alone, named on hover, and a
section's heading a hairline between them. It never goes further. */
body.sb-rail .sidebar { padding: 8px; }
body.sb-rail .sbrow { justify-content: center; padding: 0; }
body.sb-rail :is(.sbrow .t, .sbrow kbd, .sbempty) { display: none; }
body.sb-rail .sbsec { width: 16px; height: 1px; margin: 10px auto; padding: 0; overflow: hidden; background: #e2e2e2; font-size: 0; pointer-events: none; }
[data-theme="dark"] body.sb-rail .sbsec { background: #33383a; }
/* Its edge is the handle: the panes' divider (below), 1px in the accent while hovered or dragged. Above the panes, and
under a page covering the window. */
.sbedge { position: fixed; top: 48px; bottom: 0; left: calc(var(--sw, 0px) - 4px); width: 8px; z-index: 3; cursor: col-resize; }
.sbedge::before { content: ''; position: absolute; top: 0; bottom: 0; left: 3.25px; width: 1.5px; }
.sbedge:hover::before, .sbedge.dragging::before { background: #2f8cf6; }
[data-theme="dark"] :is(.sbedge:hover, .sbedge.dragging)::before { background: #5aa8ff; }
/* The page's corner where the sidebar and the header meet it, rounded: the header's grey drawn over it. With tabs the
first tab starts flush with the pane, and its own rounded top is that corner. */
.sbcorner { --r: 12px; position: fixed; top: 38px; left: var(--sw, 0px); width: var(--r); height: var(--r); z-index: 2; pointer-events: none; background: radial-gradient(circle at 100% 100%, transparent calc(var(--r) - .5px), #f6f6f6 var(--r)); }
body.many .sbcorner { display: none; }
[data-theme="dark"] .sbcorner { background: radial-gradient(circle at 100% 100%, transparent calc(var(--r) - .5px), #232627 var(--r)); }
body.covered :is(.sbedge, .sbcorner) { display: none; }
body.covered .trellis { overflow: visible; contain: none; }
/* The hairline between the pages is Trellis's divider (8px wide, on the seam), drawn 1px in the line's colour; hovered
or dragged, the same 1px turns the app's blue (the accent, shell.js tokens). */
.trellis [data-trellis-part="divider"]::before { content: ''; position: absolute; background: var(--trellis-border); }
.trellis [data-trellis-part="divider"][data-axis="x"]::before { top: 0; bottom: 0; left: calc(50% - 1.5px); width: 1px; }
body.many .trellis [data-trellis-part="divider"][data-axis="x"]::before, body.many .trellis [data-trellis-part="divider"][data-axis="x"]::after { top: var(--trellis-tabbar-height); } /* the line starts under the tab bars: the header and the bars read as one band */
.trellis [data-trellis-part="panel"]:not([data-floating], [data-lifted]) { box-shadow: none; } /* Trellis's ring round a panel ran up the tab bars too; the divider draws the line between docked panes. A pane being dragged (lifted) keeps it, in the line's grey */
/* The line's own grey is lighter than the tint over where a dragged pane can land, so over that the edge vanished: a
dragged pane's ring is a see-through grey, as light as the line on white and still there over the tint. */
.trellis [data-trellis-part="panel"][data-lifted] { box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), var(--trellis-shadow-lifted); }
[data-theme="dark"] .trellis [data-trellis-part="panel"][data-lifted] { box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), var(--trellis-shadow-lifted); }
.trellis [data-trellis-part="divider"][data-axis="y"]::before { left: 0; right: 0; top: calc(50% - 0.5px); height: 1px; }
.trellis [data-trellis-part="divider"][data-axis="x"]::after { left: calc(50% - 1.5px); width: 1px; border-radius: 0; }
.trellis [data-trellis-part="divider"][data-axis="y"]::after { top: calc(50% - 0.5px); height: 1px; border-radius: 0; }
/* The empty part of the tab bars along the top drags the window too (shell.js mark), except while a page covers the
window, so a click on the palette's scrim reaches the page. */
.trellis [data-trellis-part="tabbar"][data-top] { -webkit-app-region: drag; }
.trellis [data-trellis-part="tabbar"] { box-shadow: none; } /* no line between the tab bar and the page under it */
.trellis [data-trellis-part="tabbar"][data-top] :is([data-trellis-part="tab"], button) { -webkit-app-region: no-drag; }
body.covered .trellis [data-trellis-part="tabbar"] { -webkit-app-region: no-drag; }
/* The focused pane's tab: its title in bold and the full text colour, instead of Trellis's accent line along the top.
Every other tab, selected in its own pane or not, has the muted grey. */
.trellis [data-trellis-part="tab"][data-selected] { color: var(--trellis-text-muted); }
.trellis :is([data-trellis-part="panel"], [data-trellis-part="tabbar"])[data-focused] [data-trellis-part="tab"][data-selected] { background: var(--trellis-tab-active); color: var(--trellis-text); font-weight: 650; }
.trellis [data-trellis-part="tab"][data-selected]::before, .trellis [data-trellis-part="tab"][data-selected]::after { display: none; } /* rounded on top only: no flared corners where the tab meets the page */
.trellis [data-trellis-part="tabs"] { padding-left: 0; gap: 6px; } /* the first tab starts at the pane's edge, against the divider line, now no flare covers Trellis's 4px inset; tabs 6px apart (Trellis's 2px) */
/* no divider on the window's edge: the first tab stands off it (shell.js mark); beside the sidebar it is not the window's edge, and the first tab starts flush with its pane */
body.signed-out .trellis [data-trellis-part="tabbar"][data-left] [data-trellis-part="tabs"] { padding-left: 8px; }
/* a tab's glyph (shell.js drawTabIcons): the tab's own colour, whatever hue the type has in the page, and a little smaller than the title */
.trellis [data-trellis-part="tab-icon"] { color: var(--trellis-text-muted); } /* never bold: the focused tab's title darkens and thickens, its glyph stays as it is */
.trellis [data-trellis-part="tab-icon"] svg { width: 14px; height: 14px; color: inherit; }
.trellis [data-trellis-part="panel-menu"] { margin-right: 10px; } /* the pane's ⋯ as far in from the edge as the header's buttons (.head's 12px) */
/* A page's header buttons in its tab bar (shell.js drawNav), drawn as the header's own and shown while the pointer is
over the page or the bar; a disabled one stays, faint, and Refresh turns once when pressed (styles.css .navbtn). */
.trellis [data-trellis-part="accessory"], .headnav { gap: 2px; }
/* A narrow pane: the tab keeps its room and the page's buttons give theirs up, the ones that no longer fit dropping out
whole (onto a hidden second line) from the end; every one of them is also in ⌘K. */
.trellis [data-trellis-part="tabs"] { min-width: min(160px, 60%); }
.trellis [data-trellis-part="accessories"], .trellis [data-trellis-part="accessory"] { flex: 0 1 auto; min-width: 0; }
.trellis [data-trellis-part="accessory"] { flex-wrap: wrap; align-content: flex-start; height: 24px; overflow: hidden; }
/* Tiny (Trellis's compact and frame-only panes: the tabs are their glyphs, no titles or buttons). Frame-only lays the
bar out as a centred grid, which stacked the tab over the ⋯ and squeezed it to 16px: here it stays the one row it
is at any width, the glyph tabs full height from the left and the ⋯ at the end; the room rules above are for tabs
that carry a title. */
.trellis [data-trellis-part="panel"]:is([data-compact], [data-frame-only]) [data-trellis-part="tabbar"] { display: flex; align-items: stretch; inset: 0 0 auto 0; height: var(--trellis-tabbar-height); }
.trellis [data-trellis-part="panel"]:is([data-compact], [data-frame-only]) [data-trellis-part="tabs"] { flex: 1 1 auto; min-width: 0; height: auto; }
.trellis [data-trellis-part="panel"]:is([data-compact], [data-frame-only]) [data-trellis-part="tab"] { min-width: 0; padding: 0 8px; justify-content: center; }
.trellis [data-trellis-part="panel"]:is([data-compact], [data-frame-only]) [data-trellis-part="panel-menu"] { margin-right: 6px; }
.trellis [data-trellis-part="accessory"] button, .headnav button { -webkit-app-region: no-drag; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; color: #777; opacity: .4; cursor: pointer; transition: opacity 240ms cubic-bezier(.2, .8, .2, 1); }
.trellis [data-trellis-part="accessory"] button[hidden], .headnav button[hidden] { display: none; }
.trellis [data-trellis-part="accessory"] button:hover:not(:disabled), .headnav button:hover:not(:disabled) { background: #ddd; opacity: 1; }
.trellis [data-trellis-part="accessory"] button:disabled, .headnav button:disabled { opacity: .15; cursor: default; }
.trellis [data-trellis-part="tabbar"]:not(:hover) [data-trellis-part="accessory"]:not([data-pointer]) button { opacity: 0; }
.trellis [data-trellis-part="accessory"] svg, .headnav svg { display: block; width: 18px; height: 18px; }
[data-theme="dark"] .trellis [data-trellis-part="accessory"] button, [data-theme="dark"] .headnav button { color: #aaa; }
[data-theme="dark"] .trellis [data-trellis-part="accessory"] button:hover:not(:disabled), [data-theme="dark"] .headnav button:hover:not(:disabled) { background: #3a3f42; }
@keyframes turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) { :is(.trellis [data-trellis-part="accessory"], .headnav) svg.spin { animation: turn 840ms cubic-bezier(.3, 0, .2, 1); transform-origin: 50% 50%; } }
body.pressing .trellis [data-trellis-part="content"] { pointer-events: none; } /* a tab pressed: the pages let the pointer pass (shell.js) */
/* Create new (shell.html #create): a round button floating in the window's corner, the words sliding out beside its
glyph on hover. It floats, so it gets the chat composer's softness; under the panes while a page's palette covers the
window (its scrim goes over it), and gone while signed out. */
.create { position: fixed; right: 20px; bottom: 20px; z-index: 2; display: flex; align-items: center; height: 40px; padding: 0 12px; border: 0; border-radius: 20px; interpolate-size: allow-keywords; /* the label opens to its own width (auto), so the slide runs its whole length */
background: #fff; color: #6b6b6b; font: 500 13px -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; cursor: pointer;
box-shadow: 0 6px 24px rgba(0, 0, 0, .1), 0 1px 3px rgba(0, 0, 0, .06), 0 0 0 1px rgba(0, 0, 0, .06); }
.create svg { display: block; flex: none; width: 16px; height: 16px; }
.create span { width: 0; overflow: hidden; white-space: nowrap; opacity: 0; color: #333; }
.create:is(:hover, [data-state]) span { width: auto; margin-left: 8px; opacity: 1; } /* data-state: an image over it, or on its way to a task (shell.js createAs) */
.create:active { transform: scale(.96); }
@media (prefers-reduced-motion: no-preference) {
.create { transition: transform 160ms cubic-bezier(.2, .8, .2, 1); }
.create span { transition: width 420ms cubic-bezier(.3, 0, .2, 1), margin 420ms cubic-bezier(.3, 0, .2, 1), opacity 200ms cubic-bezier(.3, 0, .2, 1); }
.create:is(:hover, [data-state]) span { transition-duration: 420ms, 420ms, 300ms; transition-delay: 0s, 0s, 120ms; } /* the words fade in once there is room for them */
}
[data-theme="dark"] .create { background: #242729; color: #a6a6a6; box-shadow: 0 6px 24px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08); }
[data-theme="dark"] .create span { color: #ddd; }
body.covered .create { z-index: 0; }
body.signed-out .create { display: none; }
/* A tab's or pane's menu open: a press beside it lands in the shell, where Trellis closes the menu, instead of in a page
(an iframe the shell never hears), which left the menu up until an option was picked. */
body:has([data-trellis-part="menu"]) .trellis [data-trellis-part="content"] { pointer-events: none; }
/* The page the palette covers the window from (renderer/palette.js coverWindow): everything from its iframe up to the
workspace is lifted over the rest and lets the iframe reach past it; shell.js sizes the iframe to the workspace. */
.trellis [data-covering] { z-index: 1000 !important; overflow: visible !important; clip-path: none !important; contain: none !important; }
.trellis [data-trellis-part="surface"][data-covering] { background: transparent !important; }
.trellis [data-covering] > iframe { position: absolute; }