Files
AEmotionStudio-ComfyUI-Magn…/css/sidebar.css
T
Æmotion StudioandClaude Opus 5.5 6799dc8fbb Fix sidebar collapse and glass media culling
- Make the sidebar tab wrapper fill the panel, and let the content keep its
  natural height when the parent has none, so the settings no longer collapse
  to a 16px scroller.
- Only measure DOM images and videos under the glass, so per-frame work scales
  with what is under the glass instead of all media on the page.
- Cap Virtual Zoom near 60 fps again, so high-refresh displays do not run two
  full graph draws every frame.
- Cull nodes with LiteGraph's boundingRect and keep collapsed nodes, so title
  bars and collapsed nodes in front of a preview stay on top in the glass.
- Drop the self-min on the title width and the dead pos/size guards.
- Remove the stale web/shared/settings.js build output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:32:16 -08:00

418 lines
8.2 KiB
CSS

/**
* ComfyUI MagnifyGlass - Sidebar CSS
*
* Built on ComfyUI's own tokens so the panel follows the palette: the palette's
* --fg-color and --comfy-menu-bg, and the frontend's --interface-stroke,
* --secondary-background and --primary-background, with fallbacks. Muted text is
* the text colour at 72%, which keeps 4.5:1 on light and dark menus.
*/
.magnify-sidebar {
--mg-fg: var(--fg-color, #fff);
--mg-muted: color-mix(in srgb, var(--mg-fg) 72%, transparent);
--mg-surface: var(--comfy-menu-bg, #171718);
--mg-stroke: var(--interface-stroke, var(--border-color, #4e4e4e));
--mg-control: var(--secondary-background, var(--comfy-input-bg, #262729));
--mg-control-hover: var(--secondary-background-hover, var(--mg-stroke));
--mg-accent: var(--primary-background, #0b8ce9);
--mg-ring: var(--mg-fg);
--mg-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
display: flex;
flex-direction: column;
height: 100%;
min-width: 0;
color: var(--mg-fg);
font: inherit;
font-size: 0.8125rem;
line-height: 1.35;
}
.magnify-sidebar *,
.magnify-sidebar *::before,
.magnify-sidebar *::after {
box-sizing: border-box;
}
.magnify-sidebar button,
.magnify-sidebar input,
.magnify-sidebar select {
font: inherit;
color: inherit;
}
.magnify-sidebar button {
cursor: pointer;
}
.magnify-sidebar :focus-visible {
outline: 2px solid var(--mg-ring);
outline-offset: 2px;
}
.magnify-sidebar [hidden] {
display: none !important;
}
/* Header, as the native tabs have it */
.magnify-sidebar-header {
display: flex;
align-items: center;
gap: 0.5rem;
min-height: 4rem;
padding-inline: 1rem;
border-bottom: 1px solid var(--mg-stroke);
}
.magnify-mark {
flex: none;
font-size: 1.125rem;
}
.magnify-sidebar-title {
flex: 1;
min-width: 0;
margin: 0;
overflow: hidden;
font-size: 0.9375rem;
font-weight: 700;
white-space: nowrap;
text-overflow: ellipsis;
}
/* Body: the panel's one scroller */
.magnify-sidebar-content {
flex: 1 1 auto;
min-height: 0;
overflow-x: hidden;
overflow-y: auto;
padding-bottom: 1rem;
}
.magnify-inspector-toggle {
padding: 0.5rem 1rem;
border-bottom: 1px solid var(--mg-stroke);
font-weight: 600;
}
/* Sections */
.magnify-sidebar-section {
padding: 0.25rem 1rem;
}
.magnify-sidebar-section + .magnify-sidebar-section {
border-top: 1px solid var(--mg-stroke);
}
.magnify-sidebar-section-header {
display: flex;
align-items: center;
gap: 0.5rem;
width: 100%;
min-height: 2.25rem;
padding: 0;
border: 0;
background: transparent;
font-weight: 600;
text-align: start;
}
.magnify-sidebar-section-header .pi {
font-size: 0.625rem;
color: var(--mg-muted);
transition: transform 120ms var(--mg-ease);
}
.magnify-sidebar-section-header[aria-expanded='false'] .pi {
transform: rotate(-90deg);
}
.magnify-sidebar-section-body {
display: flex;
flex-direction: column;
gap: 0.25rem;
padding-bottom: 0.5rem;
}
/* A setting's row: name and value on one line, the control under it */
.magnify-control-row {
display: flex;
flex-direction: column;
gap: 0.375rem;
padding-block: 0.3125rem;
}
.magnify-control-row label {
color: var(--mg-muted);
}
.magnify-control-row .control-value {
margin-left: auto;
font-variant-numeric: tabular-nums;
}
.magnify-control-label-row {
display: flex;
justify-content: space-between;
align-items: center;
}
.magnify-slider {
width: 100%;
margin: 0;
accent-color: var(--mg-accent);
cursor: pointer;
}
/* Toggles */
.magnify-toggle-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
min-height: 2rem;
}
.magnify-toggle-row label {
cursor: pointer;
}
.magnify-toggle {
position: relative;
flex: none;
width: 2.25rem;
height: 1.25rem;
border-radius: 1rem;
background: var(--border-default, var(--mg-stroke));
cursor: pointer;
transition: background-color 120ms var(--mg-ease);
}
.magnify-toggle::after {
content: '';
position: absolute;
top: 0.125rem;
left: 0.125rem;
width: 1rem;
height: 1rem;
border-radius: 50%;
background: var(--base-background, var(--mg-surface));
transition: transform 120ms var(--mg-ease);
}
.magnify-toggle.active {
background: var(--mg-accent);
}
.magnify-toggle.active::after {
transform: translateX(1rem);
}
/* Selects */
.magnify-select {
width: 100%;
height: 2rem;
padding-inline: 0.5rem 1.75rem;
border: 1px solid transparent;
border-radius: 0.5rem;
background-color: var(--mg-control);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.5rem center;
appearance: none;
cursor: pointer;
}
.magnify-select:hover {
background-color: var(--mg-control-hover);
}
.magnify-select option {
background: var(--mg-surface);
}
/* Colour pickers */
.magnify-color-row {
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.magnify-color-wrapper {
display: flex;
align-items: center;
gap: 0.375rem;
}
.magnify-color-input {
width: 2rem;
height: 2rem;
padding: 0.1875rem;
border: 1px solid var(--mg-stroke);
border-radius: 0.5rem;
background: transparent;
cursor: pointer;
}
.magnify-color-input::-webkit-color-swatch-wrapper {
padding: 0;
}
.magnify-color-input::-webkit-color-swatch {
border: none;
border-radius: 0.3125rem;
}
.magnify-color-input::-moz-color-swatch {
border: none;
border-radius: 0.3125rem;
}
.magnify-color-preview {
width: 5.25rem;
height: 2rem;
padding-inline: 0.5rem;
border: 1px solid transparent;
border-radius: 0.5rem;
background: var(--mg-control);
font-variant-numeric: tabular-nums;
}
.magnify-color-preview:hover {
background: var(--mg-control-hover);
}
/* Reset buttons */
.magnify-sidebar-actions {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 0.75rem 1rem;
border-top: 1px solid var(--mg-stroke);
}
.magnify-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 0.375rem;
min-height: 2rem;
padding: 0 0.75rem;
border: 0;
border-radius: 0.5rem;
background: var(--mg-control);
font-weight: 500;
}
.magnify-btn:hover {
background: var(--mg-control-hover);
}
.magnify-btn .pi {
font-size: 0.75rem;
}
.magnify-btn-secondary {
background: transparent;
box-shadow: inset 0 0 0 1px var(--mg-stroke);
color: var(--mg-muted);
}
.magnify-btn-secondary:hover {
color: var(--mg-fg);
}
/* About */
.magnify-about {
padding: 0.25rem 1rem;
border-top: 1px solid var(--mg-stroke);
}
.magnify-about a {
color: inherit;
text-underline-offset: 2px;
}
.magnify-brand {
display: flex;
align-items: center;
gap: 0.75rem;
padding-block: 0.75rem;
}
.magnify-brand > .pi {
flex: none;
font-size: 1.75rem;
}
.magnify-heading {
margin: 0;
font-size: inherit;
font-weight: 600;
}
.magnify-hint {
margin: 0;
color: var(--mg-muted);
}
.magnify-actions {
display: flex;
flex-wrap: wrap;
gap: 0.375rem;
margin-bottom: 0.5rem;
}
a.magnify-link {
display: inline-flex;
align-items: center;
gap: 0.375rem;
min-height: 1.75rem;
padding: 0 0.625rem;
border-radius: 0.5rem;
background: var(--mg-control);
text-decoration: none;
}
a.magnify-link:hover {
background: var(--mg-control-hover);
}
.magnify-studio {
padding-block: 0.5rem;
}
.magnify-studio > summary {
min-height: 1.5rem;
font-weight: 600;
cursor: pointer;
}
.magnify-studio > p {
margin: 0.25rem 0 0.5rem;
}
.magnify-packs {
display: flex;
flex-direction: column;
gap: 0.375rem;
margin: 0;
padding: 0;
list-style: none;
}
.magnify-packs > li {
display: flex;
flex-direction: column;
}
.magnify-packs a {
font-weight: 500;
}
@media (prefers-reduced-motion: reduce) {
.magnify-sidebar * {
transition: none !important;
}
}