File size: 4,065 Bytes
795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a ba2c0b3 795a91a | 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 165 166 | // =============================================================================
// main.scss β CollabCode Design System
// Entry point. Compiles to main.css (loaded by app.py via libsass).
//
// Architecture: ITCSS (Inverted Triangle CSS) β Specificity increases
// downward so lower layers can override without !important abuse.
// (Harry Roberts, csswizardry.com/itcss)
//
// Layer order:
// 1. Settings β tokens (variables, no output)
// 2. Tools β mixins, functions (no output)
// 3. Generic β normalize / reset
// 4. Elements β bare HTML element styles
// 5. Objects β layout primitives (no cosmetics)
// 6. Componentsβ UI components (all visual)
// 7. Utilities β single-purpose overrides
//
// Build: python static/build.py
// Watch: python static/build.py --watch
// =============================================================================
// 1 + 2. Settings & Tools (no CSS output)
@import 'tokens';
@import 'mixins';
// 3. Generic β Minimal reset. We don't include a full Normalize because
// Gradio already ships one. Only reset what we own.
.cc-root,
.cc-root * {
box-sizing: border-box;
}
// 4. Elements β Base typography for our HTML-rendered components.
.cc-root {
font-family: $font-family-sans;
font-size: $font-size-base;
line-height: $line-height-normal;
color: $color-text-primary;
background: $color-bg-base;
// Smooth font rendering on macOS / retina
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
// 5. Objects β Layout
.cc-container {
width: 100%;
max-width: 1160px;
margin-inline: auto;
padding-inline: $space-5;
@include max-width('md') {
padding-inline: $space-4;
}
}
.cc-stack {
display: flex;
flex-direction: column;
gap: $space-4;
}
.cc-cluster {
display: flex;
flex-wrap: wrap;
gap: $space-3;
align-items: center;
}
.cc-split {
display: flex;
justify-content: space-between;
align-items: center;
gap: $space-4;
}
// 6. Components β Import all component definitions
@import 'components_clean';
// 7. Utilities / Overrides
//
// Gradio integration overrides β scoped to avoid cascading beyond our intent.
// We avoid !important except where Gradio's own specificity forces it.
.gradio-container {
max-width: 1160px !important;
margin: 0 auto !important;
background: $color-bg-base !important;
}
// Hide Gradio's default footer (Gradio branding)
footer.svelte-mpyp5e { display: none !important; }
// Gradio injects inline styles on tab panels; bring bg in line with our palette
.tab-nav button {
font-weight: $font-weight-medium !important;
font-size: $font-size-sm !important;
}
// Global focus-visible reset β ensures our custom focus rings aren't masked
:focus { outline: none; }
:focus-visible {
outline: 2px solid $color-border-focus;
outline-offset: 2px;
}
// Gradio button overrides β nudge the primary button to use our interactive colour
.gradio-container .btn-primary,
.gradio-container button[data-testid='primary'] {
background: $color-interactive !important;
border-color: $color-interactive !important;
&:hover {
background: $color-interactive-hover !important;
border-color: $color-interactive-hover !important;
}
}
// Reduced-motion β disable all transitions when user prefers
@include motion-reduce {
.cc-root *,
.gradio-container * {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
// High-contrast mode β ensure borders and focus rings are visible
@include high-contrast {
.cc-card,
.cc-section,
.cc-stepper,
.cc-rule {
border: 2px solid ButtonText !important;
}
.cc-dim-desc {
border-left-color: Highlight !important;
}
}
// Print β hide navigation, keep content readable
@media print {
.cc-stepper,
footer,
button { display: none !important; }
.cc-card {
box-shadow: none;
border: 1px solid #000;
break-inside: avoid;
}
}
|