UNPKG

styleui-components

Version:

Lightweight, modular UI component library with zero dependencies

2,147 lines (1,852 loc) 80.6 kB
/*! * StyleUI CSS Bundle * License: MIT */ /* --- variables.css --- */ /** * StyleUI Styles - CSS Custom Properties * This file defines all design tokens for the application. */ /* Shoelace Component Theme Override */ :root { --sl-tooltip-background-color: #1a1a1a; --sl-tooltip-color: #ffffff; --accent-rgb: 181, 211, 182; --header-height: 60px; --footer-height: 60px; } /* CSS Custom Properties */ :root { /* Typography */ --font-family-base: var(--font-system); --font-system: Inter, 'Noto Sans SC', PingFang SC, 'Microsoft YaHei', Heiti SC, sans-serif; --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace; /* Colors - Light Mode (Original Style Guide) */ --bg-layer-0: #a8a8a0; --bg-layer-1: #b4b4ac; --bg-layer-2: #c0c0b8; --bg-layer-3: #9c9c94; --bg-layer-4: #90908c; /* Darkest background */ --text-primary: #424242; --text-secondary: #616161; --text-tertiary: #757575; --text-quaternary: #9e9e9e; --text-disabled: #bdbdbd; --text-placeholder: #e0e0e0; --border-color: #9e9e9e00; --border-strong: #bdbdbd; /* Accent Colors (Original Style Guide) */ --default-accent: #b5d3b6; --default-accent-hover: #9fc5a1; --default-accent-dark: #2c592d; --accent: var(--default-accent); --accent-hover: var(--default-accent-hover); --accent-text: var(--default-accent-dark); /* Semantic Colors (Pastel) */ --primary: #b3d9ff; /* Soft Blue - Primary actions */ --success: #b8e6b8; /* Soft Green - Success states */ --warning: #ffe4a3; /* Soft Amber - Warnings */ --error: #ffb3ba; /* Soft Red - Errors */ --info: #d4c5f9; /* Soft Purple - Information */ --neutral: #e8e3d9; /* Soft Beige - Neutral */ /* RGBA versions for transparent backgrounds */ --primary-rgba: 179, 217, 255; --success-rgba: 184, 230, 184; --warning-rgba: 255, 228, 163; --error-rgba: 255, 179, 186; --info-rgba: 212, 197, 249; /* Semantic Hover Colors */ --primary-hover: #a1c9e8; --success-hover: #a6d4a6; --warning-hover: #e8d193; --error-hover: #e8a1a8; --info-hover: #c2b3e1; /* Dark Semantic Colors for Text */ --primary-dark: #0059b3; --success-dark: #1e7e34; --warning-dark: #856404; --error-dark: #721c24; --info-dark: #492a7c; /* Component-Specific Variables */ --input-background: var(--bg-layer-2); --input-background-focus: var(--bg-layer-3); --range-track-background: var(--bg-layer-3); /* Greyscale Colors */ --grey-50: #fafafa; --grey-100: #f5f5f5; --grey-200: #eeeeee; --grey-300: #e0e0e0; --grey-400: #bdbdbd; --grey-500: #9e9e9e; --grey-600: #757575; --grey-700: #616161; --grey-800: #424242; --grey-900: #212121; /* Component Dimensions */ --nav-width: 300px; --nav-width-mobile: 280px; --card-min-width: 350px; --card-header-min-height: 60px; --icon-size-sm: 16px; --icon-size-md: 20px; --icon-size-lg: 32px; --spinner-size-sm: 20px; --spinner-size-md: 32px; --spinner-size-lg: 48px; /* Overlay Colors */ --overlay-light: rgba(0, 0, 0, 0.05); --overlay-medium: rgba(0, 0, 0, 0.08); --overlay-backdrop: rgba(0, 0, 0, 0.5); --overlay-light-dark: rgba(255, 255, 255, 0.05); --overlay-medium-dark: rgba(255, 255, 255, 0.08); /* Animation Durations */ --duration-toast: 5000ms; --duration-modal: 300ms; /* Font Sizes (Original Style Guide) */ --font-size-3xs: 0.5rem; /* New size for tiny tags */ --font-size-2xs: 0.625rem; --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.125rem; --text-xl: 1.25rem; --text-2xl: 1.5rem; --text-3xl: 1.875rem; --text-4xl: 2.25rem; /* Font Weights */ --font-light: 300; --font-normal: 400; --font-medium: 500; --font-semibold: 600; --font-bold: 700; /* Typography Controls */ --h1-letter-spacing: -0.02em; --h2-letter-spacing: -0.015em; --h3-letter-spacing: -0.01em; --line-height-tight: 1.25; --line-height-normal: 1.5; --line-height-relaxed: 1.75; /* Spacing */ --space-0: 0; --space-px: 1px; --space-0-5: 0.125rem; --space-1: 0.25rem; --space-1-5: 0.375rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; /* Shadows */ --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); /* Border Radius */ --radius-sm: 0.25rem; --radius-md: 0.375rem; --radius-lg: 0.5rem; --radius-xl: 0.75rem; --radius-full: 9999px; /* Transitions */ --transition-fast: 150ms ease; --transition-base: 200ms ease; --transition-slow: 300ms ease; /* Z-index */ --z-dropdown: 1000; --z-sticky: 1020; --z-fixed: 1030; --z-modal-backdrop: 1040; --z-modal: 1050; --z-popover: 1060; --z-tooltip: 1070; /* Breakpoints */ --breakpoint-lg: 1400px; --breakpoint-md: 1024px; --breakpoint-sm: 768px; /* Motion variables */ --ease-standard: cubic-bezier(0.4, 0, 0.2, 1); /* Accessibility */ --focus-ring: var(--accent); } /* Dark Theme */ body.dark { /* Dark tinted backgrounds - inverted and darkened */ --bg-layer-0: #2a2a28; --bg-layer-1: #242422; --bg-layer-2: #1e1e1c; --bg-layer-3: #323230; --bg-layer-4: #161614; /* Darkest background */ /* Dimmed text colors for dark theme */ --text-primary: #bbbbbb; --text-secondary: #8c8c8c; --text-tertiary: #6c6c6c; --text-quaternary: #4d4d4d; --text-disabled: #3e3e3e; --text-placeholder: #323232; /* Darker borders for dark theme */ --border-color: #4a4a4a; --border-strong: #5a5a5a; /* Same accent colors - they work in both themes */ /* Accent colors are already designed to work on both light and dark backgrounds */ /* Slightly adjusted semantic colors for dark theme - just enough to maintain readability */ --primary: #8fc2f0; /* Slightly darker blue */ --success: #9bd69b; /* Slightly darker green */ --warning: #f0d490; /* Slightly darker amber */ --error: #f09ba2; /* Slightly darker red */ --info: #bbb0e6; /* Slightly darker purple */ --neutral: #d6d1c7; /* Slightly darker beige */ /* Semantic Hover Colors (Dark Theme) */ --primary-hover: #7dafd8; --success-hover: #89c489; --warning-hover: #d8bf82; --error-hover: #d88990; --info-hover: #a99ed4; /* Dark Semantic Colors for Text (Dark Theme) */ --primary-dark: #5c9ccc; --success-dark: #6abf69; --warning-dark: #d1b160; --error-dark: #d17d83; --info-dark: #9a8ec8; /* Component-Specific Variables */ --input-background: var(--bg-layer-2); --input-background-focus: var(--bg-layer-4); --range-track-background: var(--bg-layer-4); /* Inverted grey scale for dark theme */ --grey-50: #212121; --grey-100: #424242; --grey-200: #616161; --grey-300: #757575; --grey-400: #9e9e9e; --grey-500: #bdbdbd; --grey-600: #e0e0e0; --grey-700: #eeeeee; --grey-800: #f5f5f5; --grey-900: #fafafa; /* Adjusted overlay colors for dark theme */ --overlay-light: rgba(255, 255, 255, 0.05); --overlay-medium: rgba(255, 255, 255, 0.08); --overlay-backdrop: rgba(0, 0, 0, 0.7); } /* Theme Tinting System - Only affects background colors, not accent */ /* Tint background colors in light theme */ [data-tint="primary"]:not(.dark) { --bg-layer-0: #a8b0c0; --bg-layer-1: #b4bcc8; --bg-layer-2: #c0c8d4; --bg-layer-3: #9ca4b4; --bg-layer-4: #9098a8; } [data-tint="success"]:not(.dark) { --bg-layer-0: #a8b8a8; --bg-layer-1: #b4c4b4; --bg-layer-2: #c0d0c0; --bg-layer-3: #9cac9c; --bg-layer-4: #90a090; } [data-tint="warning"]:not(.dark) { --bg-layer-0: #c0b8a0; --bg-layer-1: #ccc4ac; --bg-layer-2: #d8d0b8; --bg-layer-3: #b4ac94; --bg-layer-4: #a8a088; } [data-tint="error"]:not(.dark) { --bg-layer-0: #c0a8ac; --bg-layer-1: #ccb4b8; --bg-layer-2: #d8c0c4; --bg-layer-3: #b49ca0; --bg-layer-4: #a89094; } [data-tint="info"]:not(.dark) { --bg-layer-0: #b0a8c0; --bg-layer-1: #bcb4cc; --bg-layer-2: #c8c0d8; --bg-layer-3: #a49cb4; --bg-layer-4: #9890a8; } [data-tint="neutral"]:not(.dark) { --bg-layer-0: #b0aca8; --bg-layer-1: #bcb8b4; --bg-layer-2: #d0ccc8; --bg-layer-3: #a4a09c; --bg-layer-4: #989490; } /* Tint background colors in dark theme */ [data-tint="primary"].dark { --bg-layer-0: #2a2c30; --bg-layer-1: #24262a; --bg-layer-2: #1e2024; --bg-layer-3: #323438; --bg-layer-4: #16181a; } [data-tint="success"].dark { --bg-layer-0: #2a302a; --bg-layer-1: #242a24; --bg-layer-2: #1e241e; --bg-layer-3: #323832; --bg-layer-4: #161a16; } [data-tint="warning"].dark { --bg-layer-0: #302e2a; --bg-layer-1: #2a2824; --bg-layer-2: #24221e; --bg-layer-3: #383632; --bg-layer-4: #1a1816; } [data-tint="error"].dark { --bg-layer-0: #302a2a; --bg-layer-1: #2a2424; --bg-layer-2: #241e1e; --bg-layer-3: #383232; --bg-layer-4: #1a1616; } [data-tint="info"].dark { --bg-layer-0: #2c2a30; --bg-layer-1: #26242a; --bg-layer-2: #201e24; --bg-layer-3: #343238; --bg-layer-4: #18161a; } [data-tint="neutral"].dark { --bg-layer-0: #2c2c2a; --bg-layer-1: #262624; --bg-layer-2: #20201e; --bg-layer-3: #343432; --bg-layer-4: #181816; } body.spacing-compact { --space-1: 0.125rem; --space-1-5: 0.25rem; --space-2: 0.375rem; --space-3: 0.5rem; --space-4: 0.75rem; --space-5: 1rem; --space-6: 1.25rem; --space-8: 1.5rem; --space-10: 2rem; --space-12: 2.5rem; --space-16: 3rem; --space-20: 4rem; --space-24: 5rem; } /* --- base.css --- */ /** * StyleUI Styles - Base * This file contains foundational styles for the entire application, * including typography, resets, accessibility features, and global element styling. */ /*------------------------------------*\ #BASE STYLES \*------------------------------------*/ * { box-sizing: border-box; } html { scroll-behavior: smooth; } body { margin: 0; font-family: var(--font-system); font-size: var(--text-base); line-height: 1.6; color: var(--text-primary); background-color: var(--bg-layer-0); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; } /*------------------------------------*\ #TYPOGRAPHY \*------------------------------------*/ /* Typography styles are now in css/typography.css */ /*------------------------------------*\ #SCROLLBAR \*------------------------------------*/ /* Firefox */ /*------------------------------------*\ #ACCESSIBILITY & DEFAULTS \*------------------------------------*/ .btn:focus-visible, .nav-item:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .color-swatch:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; } :dir(rtl) .nav-panel { left: auto; right: var(--space-4); } :dir(rtl) .control-panel { right: auto; left: var(--space-4); } :dir(rtl) .main-content { margin-left: calc(320px + var(--space-8)); margin-right: calc(var(--nav-width) + var(--space-8)); } :dir(rtl) body:has(.nav-panel.collapsed) .main-content { margin-right: calc(64px + var(--space-8)); } :dir(rtl) body:has(.control-panel.collapsed) .main-content { margin-left: calc(64px + var(--space-8)); } /*------------------------------------*\ #LAYOUT UTILITIES \*------------------------------------*/ .d-flex { display: flex; } .gap-8 { gap: var(--space-8); } .align-items-start { align-items: flex-start; } .flex-1 { flex: 1; } /*------------------------------------*\\ #MAIN LAYOUT \\*------------------------------------*/ .style-guide-layout { display: flex; } .left-panel { width: 280px; flex-shrink: 0; height: calc(100vh - var(--header-height) - var(--footer-height) - (var(--space-4) * 2)); position: fixed; top: calc(var(--header-height) + var(--space-4)); left: var(--space-4); border-radius: 0; border-right: none; transition: width var(--transition-base), left var(--transition-base); background-color: transparent; box-shadow: none; z-index: 10; display: flex; flex-direction: column; /* Dim accent color locally for tree edges */ --accent: rgba(var(--accent-rgb), 0.4); } .left-panel .panel-header { display: none; } .left-panel .panel-body { background: transparent; padding: 0; } .right-panel { width: 280px; height: calc(100vh - var(--header-height) - var(--footer-height) - (var(--space-4) * 2)); position: fixed; top: calc(var(--header-height) + var(--space-4)); right: var(--space-4); border-radius: var(--radius-lg); background-color: var(--bg-layer-0); border: 1px solid var(--border-color); z-index: 10; display: none; flex-direction: column; } .right-panel .panel-header { background: var(--bg-layer-2); } .right-panel .panel-body { display: flex; flex-direction: column; height: 100%; } .left-panel .tree-node-label { cursor: pointer; transition: background-color var(--transition-base), color var(--transition-base); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); } .left-panel .tree-node-label:hover { background-color: var(--bg-layer-2); color: var(--text-primary); } .main-container { flex-grow: 1; padding: calc(var(--header-height) + var(--space-8)) var(--space-8) calc(var(--footer-height) + var(--space-8)); max-width: 1400px; margin-left: calc(15vw + var(--space-8)); margin-right: var(--space-8); transition: margin-left var(--transition-base), margin-right var(--transition-base); } #collapsed-navigation-container { display: none; flex-direction: column; align-items: center; gap: var(--space-4); padding-top: var(--space-4); } #collapsed-navigation-container .nav-divider { width: 70%; border: none; border-top: 1px solid var(--border-color); margin: var(--space-2) auto; } /* Collapsed State */ .style-guide-layout.collapsed .left-panel { width: calc(56px + var(--space-4)); } .style-guide-layout.collapsed .main-container { margin-left: var(--space-8); } .style-guide-layout.collapsed + .footer-panel { left: 50vw; } .style-guide-layout.collapsed #navigation-tree-container { display: none; } .style-guide-layout.collapsed #collapsed-navigation-container { display: flex; } #collapsed-settings-container { display: none; flex-direction: column; align-items: center; gap: var(--space-4); padding-top: var(--space-4); } /* Right Panel Collapsed State */ .style-guide-layout.right-collapsed .right-panel { width: 80px; } .style-guide-layout.right-collapsed .main-container { margin-right: calc(80px + var(--space-4)); } .style-guide-layout.right-collapsed .right-panel .panel-title-text, .style-guide-layout.right-collapsed .right-panel #settings-container { display: none; } .style-guide-layout.right-collapsed .right-panel #collapsed-settings-container { display: block; } /* Initially hide the collapsed container */ #collapsed-settings-container { display: none; } .style-guide-layout.collapsed .left-panel .panel-title-text { display: none; } .style-guide-layout.collapsed .left-panel .panel-header { justify-content: center; } header { margin-bottom: var(--space-8); } /*------------------------------------*\ #IN-PAGE NAVIGATION OFFSET \*------------------------------------*/ /* Ensure section headers are not hidden behind the fixed header when using anchor links */ section[id^="section-"], .group-header { scroll-margin-top: calc(var(--header-height) + var(--space-4)); } /* --- typography.css --- */ /** * StyleUI Styles - Typography * This file contains all typography-related styles. */ /*------------------------------------*\ #TYPOGRAPHY \*------------------------------------*/ body { font-family: var(--font-family-base); color: var(--text-primary); line-height: var(--line-height-normal); } body.font-mono { --font-family-base: var(--font-mono); } /* Standardize Lucide icon stroke width and color */ .lucide, [data-lucide] { stroke-width: var(--icon-stroke-width, 1.5); width: var(--icon-size, 20px); height: var(--icon-size, 20px); color: currentColor; vertical-align: middle; } body.icons-large { --icon-size: 24px; } body.icons-thick-stroke { --icon-stroke-width: 2; } h1, h2, h3, h4, h5, h6 { font-weight: var(--font-semibold); line-height: 1.2; color: var(--text-primary); margin-bottom: var(--space-4); } h1.font-mono, h2.font-mono, h3.font-mono, h4.font-mono, h5.font-mono, h6.font-mono { font-family: var(--font-mono); } h1 { font-size: calc(var(--text-4xl) * 4); font-family: 'Inter', var(--font-system); font-weight: 800; letter-spacing: var(--h1-letter-spacing); font-kerning: normal; font-feature-settings: "kern" 1; text-rendering: optimizeLegibility; margin-top: var(--space-2); margin-bottom: -80px; } h2 { font-size: calc(var(--text-3xl) * 2); font-family: 'Inter', var(--font-system); font-weight: 700; letter-spacing: var(--h2-letter-spacing); font-kerning: normal; font-feature-settings: "kern" 1; text-rendering: optimizeLegibility; width: fit-content; margin-top: var(--space-20); /* extra gap between sections */ } /* Larger spacing before each group header and section */ .group-header { margin-top: var(--space-24); } section[id^="section-"] > h2:first-child { margin-top: var(--space-20); } h3 { font-size: calc(var(--text-3xl) * 1.5); font-family: 'Inter', var(--font-system); font-weight: 600; letter-spacing: var(--h3-letter-spacing); font-kerning: normal; font-feature-settings: "kern" 1; text-rendering: optimizeLegibility; } h4 { font-size: calc(var(--text-xl) * 1.5); } h5 { font-size: calc(var(--text-lg)* 1.5); padding-bottom: var(--space-2); border-bottom: 2px solid var(--overlay-light); margin-top: var(--space-24); margin-bottom: var(--space-6); } h6 { font-size: calc(var(--text-base) * 1.2); } p { font-size: var(--text-base); line-height: 1.7; color: var(--text-secondary); margin-bottom: var(--space-4); max-width: 65ch; } p.lead { font-size: var(--text-lg); line-height: 1.8; color: var(--text-primary); font-weight: var(--font-normal); } p.small { font-size: var(--text-sm); line-height: 1.6; color: var(--text-tertiary); } a { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--overlay-medium); text-underline-offset: 2px; transition: all var(--transition-fast); background-color: var(--overlay-light); padding: var(--space-1) var(--space-2); border-radius: var(--radius-lg); border: 1px solid var(--overlay-medium); font-weight: var(--font-bold); display: inline-block; white-space: nowrap; vertical-align: middle; width: fit-content; margin: 0 var(--space-2) var(--space-2) 0; } a:hover { color: var(--text-primary); background-color: var(--accent); border-color: var(--accent); } code { font-family: var(--font-mono); font-size: 0.875em; background-color: var(--bg-layer-4); border: 1px solid var(--overlay-medium); padding: var(--space-1) var(--space-2); border-radius: var(--radius-lg); display: inline-block; white-space: nowrap; vertical-align: middle; width: fit-content; margin: 0 var(--space-2) var(--space-2) 0; } pre { font-family: var(--font-mono); background-color: var(--bg-layer-2); padding: var(--space-4); border-radius: var(--radius-lg); border: none; overflow-x: auto; margin-bottom: var(--space-4); } mark { background-color: var(--warning); border: 1px solid var(--warning); color: var(--grey-800); padding: var(--space-1) var(--space-2); border-radius: var(--radius-lg); display: inline-block; white-space: nowrap; vertical-align: middle; width: fit-content; margin: 0 var(--space-2) var(--space-2) 0; } kbd { background-color: var(--overlay-light); border: 1px solid var(--overlay-medium); border-bottom-width: 3px; border-radius: var(--radius-lg); padding: var(--space-1) var(--space-3); font-family: var(--font-mono); font-size: 0.875em; display: inline-block; white-space: nowrap; vertical-align: middle; width: fit-content; margin: 0 var(--space-2) var(--space-2) 0; } abbr[title] { text-decoration: underline dotted; cursor: help; border-bottom: 1px dotted var(--text-tertiary); text-decoration: none; } del { color: var(--text-tertiary); text-decoration: line-through; opacity: 0.7; padding: 0 var(--space-1); } ins { color: var(--text-secondary); text-decoration: none; background-color: rgba(200, 230, 201, 0.2); border-bottom: 2px solid rgba(200, 230, 201, 0.5); padding: var(--space-1) var(--space-2); display: inline-block; white-space: nowrap; vertical-align: middle; width: fit-content; margin: 0 var(--space-2) var(--space-2) 0; } var { font-family: var(--font-mono); font-style: italic; color: var(--text-secondary); background-color: var(--overlay-light); border: 1px solid var(--overlay-medium); padding: var(--space-1) var(--space-2); border-radius: var(--radius-lg); display: inline-block; white-space: nowrap; vertical-align: middle; width: fit-content; margin: 0 var(--space-2) var(--space-2) 0; } samp { font-family: var(--font-mono); background-color: var(--overlay-light); border: 1px solid var(--overlay-medium); padding: var(--space-1) var(--space-2); border-radius: var(--radius-lg); display: inline-block; white-space: nowrap; vertical-align: middle; width: fit-content; margin: 0 var(--space-2) var(--space-2) 0; } cite { font-style: italic; color: var(--text-secondary); border-left: 3px solid var(--accent); padding-left: var(--space-2); display: inline-block; white-space: nowrap; vertical-align: middle; width: fit-content; margin: 0 var(--space-2) var(--space-2) 0; } q { font-style: italic; color: var(--text-secondary); display: inline-block; white-space: nowrap; vertical-align: middle; width: fit-content; margin: 0 var(--space-2) var(--space-2) 0; } /*------------------------------------*\ #UTILITY CLASSES \*------------------------------------*/ .text-center { text-align: center; } .text-right { text-align: right; } .text-left { text-align: left; } .font-mono { font-family: var(--font-mono); } .font-bold { font-weight: var(--font-bold); } .font-semibold { font-weight: var(--font-semibold); } .font-medium { font-weight: var(--font-medium); } .font-light { font-weight: var(--font-light); } .text-xs { font-size: var(--text-xs); } .text-sm { font-size: var(--text-sm); } .text-lg { font-size: var(--text-lg); } .text-xl { font-size: var(--text-xl); } .text-2xl { font-size: var(--text-2xl); } .text-3xl { font-size: var(--text-3xl); } .text-4xl { font-size: var(--text-4xl); } .leading-normal { line-height: 1.5; } .leading-relaxed { line-height: 1.625; } .leading-loose { line-height: 2; } /*------------------------------------*\\ #CALLOUTS \\*------------------------------------*/ .callout { display: flex; align-items: flex-start; padding: var(--space-4); margin: var(--space-4) 0; border-radius: var(--radius-lg); border: 1px solid; gap: var(--space-3); } .callout .icon { flex-shrink: 0; margin-top: 2px; } .callout p { margin: 0; } .callout-info { background-color: var(--bg-layer-2); border-color: var(--overlay-medium); color: var(--text-primary); } .callout-info .icon { color: var(--text-secondary); } .callout-success { background-color: rgba(var(--success-rgba), 0.5); border-color: rgba(var(--success-rgba), 0.3); color: var(--success-dark); } .callout-success .icon { color: var(--text-secondary); } .callout-warning { background-color: rgba(var(--warning-rgba), 0.5); border-color: rgba(var(--warning-rgba), 0.3); color: var(--warning-dark); } .callout-warning .icon { color: var(--text-secondary); } .callout-error { background-color: rgba(var(--error-rgba), 0.5); border-color: rgba(var(--error-rgba), 0.3); color: var(--error-dark); } .callout-error .icon { color: var(--text-secondary); } .callout-accent { background-color: rgba(var(--info-rgba), 0.5); border-color: rgba(var(--info-rgba), 0.3); color: var(--info-dark); } .callout-accent .icon { color: var(--accent-text); } /*------------------------------------*\\ #TABLES \\*------------------------------------*/ table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: var(--space-6); background-color: var(--bg-layer-1); border: 1px solid var(--overlay-light); border-radius: var(--radius-lg); } table th, table td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: 1px solid var(--overlay-light); } table thead th { background-color: var(--bg-layer-2); font-weight: var(--font-semibold); color: var(--text-primary); border-bottom-width: 2px; } table tbody tr:last-child th, table tbody tr:last-child td { border-bottom: 0; } table tbody tr:hover { background-color: var(--bg-layer-2); } table th:first-child { border-top-left-radius: var(--radius-lg); } table th:last-child { border-top-right-radius: var(--radius-lg); } table tr:last-child td:first-child { border-bottom-left-radius: var(--radius-lg); } table tr:last-child td:last-child { border-bottom-right-radius: var(--radius-lg); } tbody tr:nth-of-type(odd) { background-color: var(--bg-layer-0); } tbody tr:nth-of-type(odd):hover { background-color: var(--bg-layer-2); } .scrollbar-demo-container { height: 200px; overflow: auto; border: 1px solid var(--border-color); padding: var(--space-4); border-radius: var(--radius-lg); background-color: var(--bg-layer-3); margin-top: var(--space-4); } .scrollbar-demo-container .wide-content { width: 150%; padding: var(--space-2); } .scrollbar-demo-horizontal { overflow-x: auto; overflow-y: hidden; white-space: nowrap; } .scrollbar-demo-both { overflow: auto; } .scrollbar-demo-styled { background-color: var(--bg-layer-4); color: var(--text-primary); } /* --- animations.css --- */ /** * StyleUI Styles - Animations * A centralized library of keyframes and animation utility classes. */ /*------------------------------------*\ #KEYFRAMES \*------------------------------------*/ @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } } @keyframes slideInUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } @keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } } @keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } } @keyframes press { from { transform: scale(1); } to { transform: scale(0.95); } } @keyframes progress { from { width: 100%; } to { width: 0%; } } /*------------------------------------*\ #ANIMATION UTILITIES \*------------------------------------*/ .anim-fadeIn { animation: fadeIn var(--transition-base) ease-out; } .anim-fadeOut { animation: fadeOut var(--transition-base) ease-out; } .anim-slideInUp { animation: slideInUp var(--transition-base) ease-out; } .anim-slideInRight { animation: slideInRight var(--transition-base) ease-out; } .anim-slideOutRight { animation: slideOutRight var(--transition-base) ease-out; } /*------------------------------------*\ #TRANSITION UTILITIES \*------------------------------------*/ /* Apply to any element to get a smooth transition on all properties */ .transition-all { transition: all var(--transition-base) ease; } /* --- button.css --- */ /** * StyleUI Styles - Button * Component-specific styles for buttons. */ .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-3) var(--space-5); font-size: var(--text-base); font-weight: var(--font-medium); line-height: 1; color: var(--text-primary); background-color: var(--bg-layer-2); border: none; border-radius: var(--radius-lg); cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; user-select: none; } .btn.icon-only { padding: var(--space-2); } .btn:hover:not(:disabled) { background-color: var(--accent); transform: translateY(-1px); } .btn i, .btn svg { width: var(--icon-size-md); height: var(--icon-size-md); } .btn:active:not(:disabled) { transform: translateY(0); } .btn:disabled { opacity: 0.5; cursor: not-allowed; } /* Ghost Button Style */ .btn-ghost { background-color: transparent; border-color: transparent; font-weight: var(--font-normal); } .btn-ghost:hover { background-color: var(--overlay-light); border-color: transparent; color: var(--text-primary); } .btn-ghost.selected { background-color: var(--accent); color: var(--accent-text); } .btn-ghost.selected:hover { background-color: var(--accent-hover); } .btn-primary { background-color: var(--primary); color: var(--primary-dark); } .btn-success { background-color: var(--success); color: var(--success-dark); } .btn-warning { background-color: var(--warning); color: var(--warning-dark); } .btn-error { background-color: var(--error); color: var(--error-dark); } .btn-info { background-color: var(--info); color: var(--info-dark); } .btn-primary:hover:not(:disabled) { background-color: var(--primary-hover); } .btn-success:hover:not(:disabled) { background-color: var(--success-hover); } .btn-warning:hover:not(:disabled) { background-color: var(--warning-hover); } .btn-error:hover:not(:disabled) { background-color: var(--error-hover); } .btn-info:hover:not(:disabled) { background-color: var(--info-hover); } .btn-sm { padding: var(--space-2) var(--space-3); font-size: var(--text-sm); } .btn-lg { padding: var(--space-4) var(--space-6); font-size: var(--text-lg); } .btn.active { background-color: var(--accent); color: var(--grey-800); } .btn-primary.active { background-color: var(--primary); color: var(--primary-dark); } .btn-success.active { background-color: var(--success); color: var(--success-dark); } .btn-warning.active { background-color: var(--warning); color: var(--warning-dark); } .btn-error.active { background-color: var(--error); color: var(--error-dark); } .btn-info.active { background-color: var(--info); color: var(--info-dark); } /* Swatch Button */ .btn-swatch { width: 36px; height: 36px; border-radius: var(--radius-md); transition: all var(--transition-fast); } .btn-swatch:hover { transform: scale(1.1); border-color: var(--border-strong); } .btn-swatch:focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; } /* --- card.css --- */ /** * StyleUI Styles - Card * Component-specific styles for cards. */ .card { position: relative; display: flex; flex-direction: column; background: var(--bg-layer-1); border: none; border-radius: var(--radius-lg); overflow: hidden; width: 100%; margin-bottom: var(--space-6); /* Transitions and shadows are now handled by .interactive-lift or other utilities */ } .card-header { padding: var(--space-8); background: var(--bg-layer-2); display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: nowrap; min-height: 60px; border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); cursor: pointer; } .card-header-left { display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0; white-space: nowrap; } .card-header-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; } .card-icon { width: var(--icon-size-md); height: var(--icon-size-md); flex-shrink: 0; } .card-title { margin: 0; font-size: var(--text-lg); font-weight: var(--font-semibold); color: var(--text-primary); line-height: 1.4; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .card-action-btn { flex-shrink: 0; } .card-body { padding: var(--space-8); background: var(--bg-layer-2); transition: max-height var(--transition-base), opacity var(--transition-base), padding var(--transition-base); overflow: hidden; } .card.collapsed .card-body { max-height: 0; opacity: 0; padding: 0 var(--space-8); } .card-footer { display: flex; gap: var(--space-3); justify-content: flex-end; padding: var(--space-4) var(--space-8); background: var(--bg-layer-2); border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); } .section .card-header::after { content: ''; display: inline-block; width: 20px; height: 20px; margin-left: auto; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; transition: transform var(--transition-fast); flex-shrink: 0; } .section .card.collapsed .card-header::after { transform: rotate(-90deg); } .card-description { margin: 0; color: var(--text-secondary); font-size: var(--text-sm); line-height: var(--line-height-relaxed); } /* Nested card styles */ .card .card { background: var(--bg-layer-2); margin-bottom: 0; } .card .card .card-header, .card .card .card-body, .card .card .card-footer { background: var(--bg-layer-3); } /* --- panel.css --- */ /** * StyleUI Styles - Panel * Component-specific styles for panels. */ .panel { background: var(--bg-layer-0); border-radius: var(--radius-lg); overflow: visible; box-shadow: var(--shadow-sm); /* transition and transform are now handled by .interactive-lift */ } .main-container .panel { margin-bottom: var(--space-6); margin-top: var(--space-6); } .panel.panel--active { z-index: 10; } .panel-header { background: var(--bg-layer-2); padding: var(--space-4); /* Reduced from space-6 */ display: flex; align-items: center; justify-content: space-between; position: relative; border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); transition: border-radius var(--transition-base); } .panel-header .panel-title { display: flex; align-items: center; gap: var(--space-3); font-weight: var(--font-semibold); margin: 0; font-size: var(--text-base); /* Reduced from text-lg */ color: var(--text-primary); } .panel-header .panel-actions { display: flex; gap: var(--space-2); margin-left: auto; } .panel-body { padding: var(--space-6); background: var(--bg-layer-1); overflow-y: auto; position: relative; border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); } .panel-collapsible .panel-body { transition: max-height var(--transition-base); overflow: hidden; } .panel-collapsed .panel-body { max-height: 0; padding-top: 0; padding-bottom: 0; } .panel-collapsed .panel-header { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); } .panel-toggle .lucide { transition: transform var(--transition-base); } .panel-collapsed .panel-toggle .lucide { transform: rotate(-90deg); } /* --- modal.css --- */ /** * StyleUI Styles - Modal * Component-specific styles for modals. */ .modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); z-index: var(--z-modal-backdrop); opacity: 0; transition: opacity var(--transition-base); } .modal-backdrop.show { opacity: 1; } .modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); background: var(--bg-layer-0); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); max-width: 500px; width: 90%; max-height: 90vh; overflow: hidden; z-index: var(--z-modal); opacity: 0; transition: opacity var(--transition-base), transform var(--transition-base); } .modal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); } .modal-sm { max-width: 300px; } .modal-lg { max-width: 800px; } /* * Override card footer styles when inside a modal for a cleaner look. * This removes the separate background and integrates the actions into the main modal body. */ .modal .card-footer { /* background-color: transparent; */ padding-top: 0; } .modal .card { margin-bottom: 0; } /* --- toast.css --- */ /** * StyleUI Styles - Toast * Component-specific styles for toast notifications. */ .toast-container { position: fixed; bottom: var(--space-6); right: var(--space-6); z-index: var(--z-tooltip); display: flex; flex-direction: column; gap: var(--space-3); pointer-events: none; } .toast { display: flex; align-items: center; gap: var(--space-3); min-width: 300px; max-width: 500px; padding: var(--space-4); background: var(--bg-layer-4); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); position: relative; overflow: hidden; pointer-events: all; /* Animation is now handled by utility classes */ } .toast.hiding { /* The .anim-slideOutRight class will be added by JS to trigger the hiding animation */ } .toast-icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; } .toast-message { flex: 1; font-size: var(--text-sm); } .toast-close { flex-shrink: 0; cursor: pointer; opacity: 0.5; transition: opacity var(--transition-fast); } .toast-close:hover { opacity: 1; } .toast-action { margin-left: var(--space-3); } .toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: currentColor; opacity: 0.3; animation: progress var(--toast-duration, 5000ms) linear; } .toast-success { background: var(--success); color: var(--grey-800); } .toast-error { background: var(--error); color: var(--grey-800); } .toast-warning { background: var(--warning); color: var(--grey-800); } .toast-info { background: var(--info); color: var(--grey-800); } /* --- tag.css --- */ /** * StyleUI Styles - Tag * Component-specific styles for tags/badges. */ .tag { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); font-size: var(--font-size-2xs); font-weight: var(--font-bold); line-height: 1.4; color: var(--text-secondary); background-color: var(--bg-layer-1); border: 0px solid var(--overlay-medium); border-radius: var(--radius-md); white-space: nowrap; user-select: none; margin: 0; /* Remove margin to let container handle spacing */ } .tag .lucide { width: 1.5em; height: 1.5em; } /* Color Variants */ .tag-primary { background-color: var(--primary); color: var(--primary-dark); } .tag-success { background-color: var(--success); color: var(--success-dark); } .tag-warning { background-color: var(--warning); color: var(--warning-dark); } .tag-error { background-color: var(--error); color: var(--error-dark); } .tag-info { background-color: var(--info); color: var(--info-dark); } .tag-neutral { background-color: var(--neutral); color: var(--text-primary); } .tag-accent { background-color: var(--accent); color: var(--bg-layer-0); } .tag-dim { background-color: var(--bg-layer-3); color: var(--text-secondary); } /* Size Variants */ .tag-lg { padding: var(--space-2) var(--space-4); font-size: var(--text-base); } .tag-icon-only { padding: var(--space-2); border-radius: var(--radius-full); } /* --- colors.css --- */ /** * StyleUI Styles - Colors * Styles for the color chips in the style guide. */ .demo-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); } .color-chip { width: auto; height: 80px; border-radius: var(--radius-lg); font-weight: var(--font-medium); font-size: var(--text-sm); display: flex; flex-direction: column; /* Stack name and hex vertically */ align-items: center; justify-content: center; text-align: center; padding: var(--space-2); cursor: pointer; } .color-chip:active { animation: press 0.1s ease-out forwards; } .color-chip-name { font-weight: var(--font-semibold); } .color-chip-hex { font-size: var(--text-xs); opacity: 0.7; margin-top: var(--space-1); } /* --- tree.css --- */ /** * StyleUI Styles - Tree * Component-specific styles for tree views with connecting lines. */ .tree { list-style: none; padding: 0; position: relative; } .tree-item { position: relative; padding-left: var(--space-6); /* Indent all items */ } /* --- Guide Lines --- */ /* Vertical connector */ .tree-item::before { content: ''; position: absolute; top: 0; bottom: 0; left: 8px; /* Align with horizontal line */ width: 1px; background: var(--overlay-medium); z-index: 0; /* Place behind horizontal line to avoid darker overlap */ } /* Stop the vertical line at half height for the last child */ .tree-item:last-child::before { bottom: 50%; } /* Horizontal connector */ .tree-item::after { content: ''; position: absolute; top: 50%; transform: translateY(-50%); left: 8px; width: 15px; /* Connect from edge to the content area */ height: 1px; background: var(--overlay-medium); z-index: 1; /* Draw above the vertical line */ } /* --- Content & Toggle --- */ .tree-item-content { display: flex; align-items: center; gap: var(--space-2); border-radius: var(--radius-md); position: relative; justify-content: flex-start; /* Override .btn centering */ /* Base styles inherited from .btn */ padding: var(--space-2) 0 !important; /* Override button padding */ /* Extend highlight background to full row width */ width: 100%; padding-right: var(--space-3) !important; } /* Remove hover since it's handled by .btn-ghost */ /* --- Toggle Icon --- */ .tree-item-toggle { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: var(--space-1); transition: transform var(--transition-fast), background var(--transition-fast); flex-shrink: 0; margin-left: -4px; /* Adjust for increased size to align with lines */ background: transparent; /* Default transparent */ border-radius: var(--radius-sm); position: relative; /* Create stacking context */ z-index: 1; /* Above edges */ } .has-children > .tree-item-content > .tree-item-toggle { background: var(--bg-layer-0); /* Show bg only if has children */ } /* Keep toggle transparent when row is selected or hovered */ .tree-item.selected > .tree-item-content > .tree-item-toggle, .tree-item > .tree-item-content.selected > .tree-item-toggle, .tree-item > .tree-item-content:hover > .tree-item-toggle { background: transparent; } .tree-item-toggle:hover { background: transparent; } .tree-item.collapsed > .tree-item-content > .tree-item-toggle { transform: rotate(-90deg); } .tree-item-toggle .lucide { width: 14px; height: 14px; } /* --- Snake Path & Selection Styling --- */ /* Selection is now handled by .btn-ghost.selected */ /* --- Children --- */ .tree-children { list-style: none; padding-left: 0; transition: max-height var(--transition-base); overflow: hidden; position: relative; } .tree-item.collapsed > .tree-children { max-height: 0; } /* --- Edge Overlay Elements (Draw accent path from top to selection) --- */ .tree-edge-vertical, .tree-edge-horizontal { position: absolute; background: var(--accent); pointer-events: none; z-index: 2; } .tree-edge-dynamic { position: absolute; background: var(--accent); pointer-events: none; z-index: 0; /* Behind toggle */ } .tree-edge-base { position: absolute; background: var(--overlay-medium); pointer-events: none; z-index: -1; } /* Ensure connectors lie below dynamic edges */ .tree-item::before, .tree-item::after { z-index: -1; } /* Legacy pseudo-element connectors are no longer needed, hide them */ .tree-item::before, .tree-item::after { background: transparent !important; } /* --- menu.css --- */ /*------------------------------------*\\ #MENU \\*------------------------------------*/ .menu { position: relative; display: inline-block; } .menu-trigger { /* Uses .btn styles */ } .menu-panel { position: absolute; z-index: var(--z-dropdown); top: calc(100% + var(--space-1)); left: 0; min-width: 220px; max-width: 100vw; max-height: 100vh; overflow: auto; background-color: var(--bg-layer-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-l); padding: var(--space-2); display: none; /* Hidden by default */ opacity: 0; transform: translateY(-10px); transition: opacity 0.2s ease, transform 0.2s ease; margin: var(--space-2); } .menu.menu--top .menu-panel { top: auto; bottom: calc(100% + var(--space-1)); transform: translateY(10px); } .menu.menu--right .menu-panel { top: 0; left: calc(100% + var(--space-1)); transform: translateX(-10px); } .menu.open.menu--right .menu-panel { transform: translateX(0); } .menu.menu--left .menu-panel { top: 0; left: auto; right: calc(100% + var(--space-1)); transform: translateX(10px); } .menu.open.menu--left .menu-panel { transform: translateX(0); } .menu.open .menu-panel { display: block; opacity: 1; transform: translateY(0); } .menu-item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-s); cursor: pointer; font-size: var(--font-size-s); color: var(--text-secondary); white-space: nowrap; } .menu-item:hover { background-color: var(--background-hover); color: var(--text-primary); } .menu-item .lucide { width: 20px; height: 20px; color: var(--text-tertiary); } .menu-item:hover .lucide { color: var(--text-primary); } .menu-divider { height: 1px; background-color: var(--overlay-medium); margin: var(--space-2) 0; } .menu-shortcut { margin-left: auto; } /* Submenu Styles */ .menu-item.has-submenu { position: relative; } .menu-item.has-submenu > .menu-panel { top: calc(0% - var(--space-2)); left: 100%; display: none; opacity: 0; transform: translateX(-10px); } .menu-item.has-submenu:hover > .menu-panel { display: block; opacity: 1; transform: translateX(0); } .menu-item.has-submenu > .menu-panel { margin: 0; } .menu-item.has-submenu > .lucide-chevron-right { margin-left: auto; } /*------------------------------------*\\ #MENU BAR \\*------------------------------------*/ .menu-bar { display: flex; align-items: center; gap: var(--space-1); background-color: var(--bg-layer-2); padding: var(--space-1) var(--space-2); border-radius: var(--radius-lg); margin-bottom: var(--space-4); } .menu-bar-vertical { display: inline-flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); background-color: var(--bg-layer-2); padding: var(--space-2); border-radius: var(--radius-lg); } /* Context Me