Files
DataStack/public/assets/aistudio/sidebar.styles.size_bee6ac94.md
T
Md Najmul d39d9f92f9 docs: update AI Studio design token audits
Refresh design token inventory files to reflect the latest UI sizing and layout configurations from the sandbox prototype.
2026-10-23 11:43:49 -05:00

176 lines
55 KiB
Markdown

# Sandbox Sidebar Styles And Size Tokens
## Audit Scope
Source: canonical [`sandbox/index.html`](../index.html). This review-only ledger records authored styles and sizing declarations for the host activity rail, secondary sidebar/drawer and its rendered activity-specific content, plus SQL Studio's separate iframe sidebar. It includes all 13 host sidebar renderer variants as a selector union; repeated UI states are not counted as duplicate CSS sources.
Included styles cover dimensions, layout, spacing, typography, colors/backgrounds, borders/radii, overflow, positioning, transitions, focus/active/hover states, and responsive overrides. The titlebar navigation dropdown is a separate menu and is not included. Generic reset/control rules are included only where they apply to sidebar descendants. Values using semantic variables remain literal references.
The raw CSS inventory contains 96 host rule groups (454 declarations) and 16 SQL Studio sidebar rule groups (83 declarations). The rendered host sidebar union yielded 15 inline style occurrences across four source patterns; SQL Studio sidebar elements have no inline styles. Inline background values are dynamic expressions sourced from collection colors or tool gradients.
## Host Reset And Generic Descendant Rules
| Selector | Media | Exact declarations |
| -------------------------------------------- | ----- | ------------------------------------------------------------------------------------- |
| `*` | base | `box-sizing:border-box; margin:0; padding:0` |
| `button` | base | `font-family:inherit; cursor:pointer` |
| `input,select,textarea` | base | `font-family:inherit` |
| `::-webkit-scrollbar` | base | `width:10px; height:10px` |
| `::-webkit-scrollbar-track` | base | `background:transparent` |
| `::-webkit-scrollbar-thumb` | base | `background:var(--border-strong); border-radius:5px; border:2px solid var(--bg-main)` |
| `::-webkit-scrollbar-thumb:hover` | base | `background:var(--text-dim)` |
| `body.light-theme ::-webkit-scrollbar-thumb` | base | `background:var(--border-strong); border-color:var(--bg-main)` |
## Host Activity Rail
| Selector | Media | Exact declarations |
| ------------------------------------------------------------------------------------------------ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.activity` | base | `width:52px; flex-shrink:0; background:var(--bg-activity); border-right:1px solid var(--border); display:flex; flex-direction:column; align-items:center; padding:8px 0; gap:2px; transition:width .15s,opacity .15s` |
| `.act-btn` | base | `width:38px; height:38px; border-radius:9px; border:none; background:transparent; display:flex; align-items:center; justify-content:center; color:var(--text-muted); position:relative; transition:background .15s,color .15s` |
| `.act-btn svg` | base | `width:21px; height:21px` |
| `.act-btn:hover` | base | `background:var(--bg-hover); color:var(--text)` |
| `.act-btn.active` | base | `color:var(--text); background:var(--bg-active)` |
| `.act-btn.active::before` | base | `content:''; position:absolute; left:-7px; top:50%; transform:translateY(-50%); width:3px; height:20px; background:var(--accent); border-radius:0 3px 3px 0` |
| `.act-btn::after` | base | `content:attr(data-tip); position:absolute; left:46px; top:50%; transform:translateY(-50%); background:var(--bg-elevated); color:var(--text); padding:5px 9px; border-radius:5px; font-size:11.5px; font-weight:500; white-space:nowrap; opacity:0; pointer-events:none; border:1px solid var(--border-strong); z-index:200; transition:opacity .12s; box-shadow:0 4px 14px var(--shadow-tooltip)` |
| `.act-btn:hover::after` | base | `opacity:1` |
| `.act-badge` | base | `position:absolute; top:3px; right:3px; background:var(--accent); color:var(--text-on-accent); font-size:9.5px; font-weight:700; line-height:1; min-width:14px; height:14px; border-radius:7px; display:flex; align-items:center; justify-content:center; padding:0 3px` |
| `.act-sep` | base | `width:24px; height:1px; background:var(--border-strong); margin:6px 0` |
| `.act-spacer` | base | `flex:1` |
| `.avatar` | base | `width:30px; height:30px; border-radius:50%; background:var(--avatar-gradient); display:flex; align-items:center; justify-content:center; font-size:11.5px; font-weight:700; color:var(--text-on-accent); cursor:pointer; border:2px solid transparent; transition:border-color .15s` |
| `.avatar:hover` | base | `border-color:var(--accent)` |
| `.avatar.active` | base | `border-color:var(--accent); color:var(--text-on-accent)` |
| `.activity` | `max-width:640px` | `order:2; width:100%; height:calc(64px + env(safe-area-inset-bottom)); flex:0 0 calc(64px + env(safe-area-inset-bottom)); flex-direction:row; justify-content:space-around; gap:2px; padding:4px 6px calc(4px + env(safe-area-inset-bottom)); background:var(--bg-activity); border-right:0; border-top:1px solid var(--border); position:relative; z-index:101` |
| `.act-btn` | `max-width:640px` | `flex:1 1 0; width:auto; min-width:0; height:52px; flex-direction:column; gap:3px; border-radius:7px` |
| `#activity [data-act="favorites"],#activity [data-act="recent"],#activity [data-act="settings"]` | `max-width:640px` | `display:none` |
| `.act-btn svg` | `max-width:640px` | `width:20px; height:20px; flex:none` |
| `.act-btn::after` | `max-width:640px` | `position:static; left:auto; top:auto; transform:none; background:transparent; color:var(--text-muted); border:0; box-shadow:none; padding:0; font-size:9.5px; font-weight:500; opacity:1; transition:none; pointer-events:none` |
| `.act-btn.active::before` | `max-width:640px` | `left:50%; top:0; transform:translateX(-50%); width:18px; height:3px; border-radius:0 0 3px 3px` |
| `.act-sep,.act-spacer` | `max-width:640px` | `display:none` |
| `.avatar` | `max-width:640px` | `flex:0 0 32px; width:30px; height:30px` |
| `*` | `max-width:640px` | `scrollbar-width:none; -ms-overflow-style:none` |
| `*::-webkit-scrollbar` | `max-width:640px` | `display:none; width:0; height:0` |
## Host Secondary Sidebar And Shared Controls
| Selector | Media | Exact declarations |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `.sidebar` | base | `width:232px; flex-shrink:0; background:var(--bg-sidebar); border-right:1px solid var(--border); display:flex; flex-direction:column; overflow-y:auto; overflow-x:hidden; transition:width .15s,opacity .15s` |
| `.sidebar.hidden` | base | `width:0; opacity:0; border:none; pointer-events:none` |
| `.side-block` | base | `padding:8px 8px 3px` |
| `.side-block+.side-block` | base | `border-top:1px solid var(--border)` |
| `.side-title` | base | `font-size:9.5px; font-weight:600; text-transform:uppercase; letter-spacing:.07em; color:var(--text-dim); padding:3px 5px 6px; display:flex; align-items:center; justify-content:space-between` |
| `.side-title .hint` | base | `font-size:10px; font-weight:400; letter-spacing:0; color:var(--text-dim)` |
| `.search-wrap` | base | `display:flex; align-items:center; gap:7px; background:var(--bg-main); border:1px solid var(--border-strong); border-radius:6px; padding:0 9px; height:30px; transition:border-color .15s` |
| `.search-wrap:focus-within` | base | `border-color:var(--accent)` |
| `.search-wrap svg` | base | `color:var(--text-dim); flex-shrink:0` |
| `.search-input` | base | `flex:1; background:transparent; border:none; outline:none; color:var(--text); font-size:12.5px` |
| `.search-input::placeholder` | base | `color:var(--text-dim)` |
| `.side-item` | base | `display:flex; align-items:center; gap:8px; width:100%; min-height:32px; padding:5px 7px; border-radius:5px; border:none; background:transparent; color:var(--text-muted); font-size:12.5px; text-align:left; transition:background .12s,color .12s` |
| `.side-item:hover` | base | `background:var(--bg-hover); color:var(--text)` |
| `.side-item.active` | base | `background:var(--accent-soft); color:var(--accent-hover); font-weight:500` |
| `.route-nav-btn` | base | `display:inline-flex; align-items:center; gap:6px` |
| `.route-nav-btn>svg:last-child,.route-badge svg,.profile-tool>svg:last-child` | base | `flex:none; color:var(--text-dim); transition:transform .12s ease,color .12s ease` |
| `.route-nav-btn:hover>svg:last-child,.route-nav-btn:focus-visible>svg:last-child,.route-nav-btn:hover .route-badge svg,.route-nav-btn:focus-visible .route-badge svg` | base | `transform:translate(1px,-1px); color:var(--accent)` |
| `.route-badge` | base | `display:inline-flex; align-items:center; gap:3px; margin-left:auto; padding:1px 5px; border-radius:4px; background:var(--bg-active); color:var(--text-dim); font-size:9px; font-weight:500; white-space:nowrap` |
| `.side-item .count` | base | `margin-left:auto; font-size:11px; color:var(--text-dim); background:var(--bg-elevated); padding:1px 6px; border-radius:9px` |
| `.side-item.active .count` | base | `background:var(--accent-count-bg); color:var(--accent-hover)` |
| `.side-select` | base | `width:100%; background:var(--bg-main); border:1px solid var(--border-strong); color:var(--text); font-size:12.5px; padding:6px 8px; border-radius:5px; outline:none` |
| `.switch-row` | base | `display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:5px; cursor:pointer; font-size:12.5px; color:var(--text-muted)` |
| `.switch-row:hover` | base | `background:var(--bg-hover); color:var(--text)` |
| `.switch-row input` | base | `accent-color:var(--accent); cursor:pointer` |
| `.fav-item` | base | `display:flex; align-items:center; gap:8px; width:100%; padding:6px 8px; border:0; border-radius:5px; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; transition:background .12s` |
| `.fav-item:hover` | base | `background:var(--bg-hover)` |
| `.fav-glyph` | base | `width:26px; height:26px; border-radius:6px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-family:ui-monospace,monospace; font-size:10px; font-weight:700; color:var(--text-on-accent)` |
| `.fav-name` | base | `font-size:12.5px; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap` |
| `.fav-meta` | base | `font-size:10.5px; color:var(--text-dim)` |
| `.empty-side` | base | `padding:14px 10px; font-size:12px; color:var(--text-dim); line-height:1.6; text-align:center` |
| `.collection-item` | base | `width:100%; border:0; background:transparent; color:var(--text); font:inherit; text-align:left` |
| `.collection-item:focus-visible` | base | `outline:2px solid var(--accent); outline-offset:-2px` |
| `.app.focus .activity,.app.focus .statusbar` | base | `display:none` |
| `.app.focus .sidebar` | base | `display:none` |
| `.sidebar` | `max-width:860px` | `position:absolute; left:52px; top:0; bottom:0; z-index:100; box-shadow:8px 0 24px var(--shadow-sidebar)` |
| `.sidebar` | `max-width:640px` | `left:8px; right:8px; top:auto; bottom:calc(64px + env(safe-area-inset-bottom)); width:auto; height:min(60vh,32rem); max-height:calc(100% - 72px); border:1px solid var(--border-strong); border-radius:8px; box-shadow:0 12px 32px var(--shadow-drawer); z-index:100; transform:translateY(calc(100% + 12px)); visibility:hidden; opacity:0; pointer-events:none; transition:transform .18s ease,opacity .18s ease,visibility .18s` |
| `.sidebar.hidden` | `max-width:640px` | `display:none; width:auto` |
| `.app.mobile-sidebar-open .sidebar` | `max-width:640px` | `transform:translateY(0); visibility:visible; opacity:1; pointer-events:auto` |
## Host Sidebar Drawer Context
These workbench rules establish the sidebar's containing flex area and mobile drawer backdrop.
| Selector | Media | Exact declarations |
| --------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.workbench` | base | `flex:1; display:flex; min-height:0; overflow:hidden` |
| `.workbench` | `max-width:640px` | `position:relative; flex-direction:column` |
| `.workbench::before` | `max-width:640px` | `content:''; position:absolute; inset:0; background:var(--backdrop-drawer); opacity:0; pointer-events:none; z-index:90; transition:opacity .18s ease` |
| `.app.mobile-sidebar-open .workbench::before` | `max-width:640px` | `opacity:1; pointer-events:auto` |
## Host Activity-Specific Sidebar Content
| Selector | Media | Exact declarations |
| -------------------------------------------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.workspace-sidebar-card` | base | `padding:10px; margin:0 2px 8px; border:1px solid var(--border); border-radius:6px; background:var(--bg-elevated)` |
| `.workspace-sidebar-card strong` | base | `display:block; overflow:hidden; color:var(--text); font-size:11.5px; text-overflow:ellipsis; white-space:nowrap` |
| `.workspace-sidebar-card span` | base | `display:block; margin-top:4px; color:var(--text-muted); font-size:10px` |
| `.workspace-sidebar-list` | base | `display:grid; gap:2px` |
| `.workspace-sidebar-item` | base | `width:100%; display:flex; align-items:center; gap:7px; min-height:30px; padding:5px 7px; border:0; border-radius:5px; background:transparent; color:var(--text-muted); font:inherit; font-size:11.5px; text-align:left; cursor:pointer` |
| `.workspace-sidebar-item:hover,.workspace-sidebar-item.active` | base | `background:var(--bg-hover); color:var(--text)` |
| `.workspace-sidebar-item svg` | base | `flex:none; color:var(--accent)` |
| `.workspace-sidebar-item span` | base | `min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap` |
| `.workspace-sidebar-item small` | base | `flex:none; color:var(--text-dim); font-size:9.5px` |
| `.workspace-sidebar-empty` | base | `padding:6px 7px; color:var(--text-dim); font-size:10.5px` |
| `.workspace-sidebar-more` | base | `width:100%; margin-top:2px; padding:5px 7px; border:0; border-radius:4px; background:transparent; color:var(--accent); font:inherit; font-size:10.5px; text-align:left; cursor:pointer` |
| `.workspace-sidebar-more:hover` | base | `background:var(--bg-hover); color:var(--text)` |
| `.profile-side-card` | base | `display:flex; align-items:center; gap:8px; padding:8px 6px 10px; border-bottom:1px solid var(--border); margin-bottom:4px` |
| `.profile-side-avatar` | base | `width:30px; height:30px; flex:0 0 30px; border-radius:50%; display:grid; place-items:center; background:var(--avatar-gradient); color:var(--text-on-accent); font-size:10px; font-weight:700` |
| `.profile-side-copy` | base | `min-width:0` |
| `.profile-side-copy strong,.profile-side-copy span` | base | `display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap` |
| `.profile-side-copy strong` | base | `font-size:11.5px; color:var(--text)` |
| `.profile-side-copy span` | base | `font-size:10px; color:var(--text-dim); margin-top:1px` |
| `.profile-side-group` | base | `padding:6px 0 3px` |
| `.profile-side-group+.profile-side-group` | base | `border-top:1px solid var(--border)` |
| `.profile-side-link` | base | `min-height:30px; font-size:11.5px` |
| `.profile-side-link svg` | base | `width:15px; height:15px; flex:none` |
## SQL Studio Iframe Sidebar
These rules belong only to the mock SQL Studio iframe; its styles do not cross into the host sidebar.
| Selector | Exact declarations |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.sidebar` | `width:212px; flex-shrink:0; background:var(--frame-panel); border-right:1px solid var(--frame-border); display:flex; flex-direction:column; overflow:hidden` |
| `.sb-header` | `padding:14px 14px 10px; border-bottom:1px solid var(--frame-border); display:flex; align-items:center; gap:9px` |
| `.sb-logo` | `width:24px; height:24px; border-radius:6px; background:var(--frame-accent); display:flex; align-items:center; justify-content:center; font-family:ui-monospace,monospace; font-size:9px; font-weight:700; color:var(--frame-on-accent); flex-shrink:0` |
| `.sb-title` | `font-size:13px; font-weight:700; letter-spacing:-.01em` |
| `.sb-scroll` | `flex:1; overflow-y:auto; padding:6px 0; -webkit-overflow-scrolling:touch; overscroll-behavior:contain` |
| `.sb-section` | `padding:8px 12px 4px` |
| `.sb-section-title` | `font-size:10px; text-transform:uppercase; letter-spacing:.07em; color:var(--frame-muted); font-weight:700; padding:2px 6px 6px; display:flex; align-items:center; gap:6px` |
| `.sb-section-title .n` | `background:var(--frame-surface); color:var(--frame-soft); padding:1px 6px; border-radius:8px; font-size:9.5px; letter-spacing:0` |
| `.sb-item` | `display:flex; align-items:center; gap:7px; padding:5px 8px; border-radius:5px; font-size:12.5px; color:var(--frame-secondary); cursor:pointer; transition:background .12s; white-space:nowrap; overflow:hidden` |
| `.sb-item:hover` | `background:var(--frame-surface)` |
| `.sb-item.active` | `background:var(--frame-accent-bg); color:var(--frame-accent-text); font-weight:500` |
| `.sb-item .ico` | `width:14px; height:14px; flex-shrink:0; color:var(--frame-muted); display:flex; align-items:center; justify-content:center; font-size:11px` |
| `.sb-item.active .ico` | `color:var(--frame-accent-icon)` |
| `.sb-item .label` | `flex:1; overflow:hidden; text-overflow:ellipsis` |
| `.sb-item .badge` | `font-size:10px; background:var(--frame-surface); color:var(--frame-soft); padding:1px 6px; border-radius:8px; flex-shrink:0` |
| `.sb-item.active .badge` | `background:var(--frame-accent-bg); color:var(--frame-accent-text)` |
## Inline Sidebar Styles
These are inline style attributes emitted by host sidebar renderers. Background values are dynamic, supplied from collection colors or tool gradient tokens; they are not resolved here.
| Renderer/selector | Exact inline style source |
| ----------------------------------------------------- | --------------------------------------- |
| `collectionsSidebar` / `span.fav-glyph` | `background:` + `esc(collection.color)` |
| `favoritesSidebar`, `recentSidebar` / `div.fav-glyph` | `background:` + `tool.gradient` |
| `favoritesSidebar`, `recentSidebar` / `span` | `min-width:0` |
| `collectionsSidebar` / `button.side-item` | `margin-top:6px` |
The rendered view sample contained 15 inline style instances across these patterns. The SQL Studio sidebar contains no inline styles. Inline HTML source patterns are documented once, not repeated per rendered tool/item.
## Coverage Notes
- Host matching included all eight activity sidebar renderers plus hidden/focus/mobile drawer states; responsive media conditions are shown explicitly.
- Global reset/control inheritance is included where it affects sidebar descendants. Titlebar dropdown/menu rules, page content, and the SQL Studio main toolbar are excluded as separate surfaces.
- Theme values remain semantic references; this source inventory does not define production sidebar components or styles.
- No sandbox HTML or production styles were changed. Refresh this audit when sidebar markup or rules in `sandbox/index.html` change.