askrobots / dbbasic-web-native
Public
100+ copy-paste UI components in plain HTML and CSS: no dependencies, no build step.
danq9
Add canonical.html v1.0 - The single source of truth for usability standards
fb6e650
1 year ago
History
component-docs.css · 6.9 KB · 327 lines
| 1 | /* Shared styles for all component documentation pages */ |
| 2 | |
| 3 | * { |
| 4 | margin: 0; |
| 5 | padding: 0; |
| 6 | box-sizing: border-box; |
| 7 | } |
| 8 | |
| 9 | body { |
| 10 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; |
| 11 | background: #000; |
| 12 | color: #fff; |
| 13 | line-height: 1.6; |
| 14 | letter-spacing: 0.015em; |
| 15 | overflow-x: hidden; |
| 16 | } |
| 17 | |
| 18 | .container { |
| 19 | max-width: 1400px; |
| 20 | margin: 0 auto; |
| 21 | padding: 48px 24px; |
| 22 | width: 100%; |
| 23 | box-sizing: border-box; |
| 24 | } |
| 25 | |
| 26 | @media (max-width: 768px) { |
| 27 | .container { |
| 28 | padding: 24px 16px; |
| 29 | max-width: 100%; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | /* Header */ |
| 34 | .header { |
| 35 | margin-bottom: 64px; |
| 36 | border-bottom: 2px solid #38383a; |
| 37 | padding-bottom: 32px; |
| 38 | } |
| 39 | |
| 40 | .component-name { |
| 41 | font-size: 48px; |
| 42 | font-weight: 900; |
| 43 | color: #409cff; |
| 44 | margin-bottom: 16px; |
| 45 | word-break: break-word; |
| 46 | } |
| 47 | |
| 48 | .tagline { |
| 49 | font-size: 24px; |
| 50 | color: #f0f0f0; /* Improved from #f0f0f0 for 7.0:1 contrast */ |
| 51 | margin-bottom: 24px; |
| 52 | } |
| 53 | |
| 54 | .quick-example { |
| 55 | background: #1c1c1e; |
| 56 | border: 1px solid #38383a; |
| 57 | border-radius: 12px; |
| 58 | padding: 24px; |
| 59 | font-family: 'Monaco', 'Courier New', monospace; |
| 60 | font-size: 14px; |
| 61 | color: #34c759; |
| 62 | overflow-x: auto; |
| 63 | max-width: 100%; |
| 64 | } |
| 65 | |
| 66 | @media (max-width: 768px) { |
| 67 | .component-name { |
| 68 | font-size: 32px; |
| 69 | } |
| 70 | |
| 71 | .tagline { |
| 72 | font-size: 18px; |
| 73 | } |
| 74 | |
| 75 | .quick-example { |
| 76 | font-size: 13px; /* Increased from 12px for better mobile readability */ |
| 77 | padding: 16px; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | /* Sections */ |
| 82 | .section { |
| 83 | margin-bottom: 80px; |
| 84 | page-break-inside: avoid; |
| 85 | } |
| 86 | |
| 87 | .section-title { |
| 88 | font-size: 32px; |
| 89 | font-weight: 700; |
| 90 | color: #fff; |
| 91 | margin-bottom: 16px; |
| 92 | border-left: 4px solid #409cff; |
| 93 | padding-left: 16px; |
| 94 | } |
| 95 | |
| 96 | .section-description { |
| 97 | font-size: 16px; |
| 98 | color: #f0f0f0; |
| 99 | margin-bottom: 32px; |
| 100 | line-height: 1.8; |
| 101 | } |
| 102 | |
| 103 | /* Grid */ |
| 104 | .grid { |
| 105 | display: grid; |
| 106 | grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Reduced from 300px for better mobile fit */ |
| 107 | gap: 32px; |
| 108 | margin-bottom: 32px; |
| 109 | } |
| 110 | |
| 111 | @media (max-width: 768px) { |
| 112 | .grid { |
| 113 | grid-template-columns: 1fr; |
| 114 | gap: 16px; |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | /* Examples */ |
| 119 | .example { |
| 120 | background: #1c1c1e; |
| 121 | border: 2px solid #38383a; |
| 122 | border-radius: 16px; |
| 123 | padding: 32px; |
| 124 | page-break-inside: avoid; |
| 125 | min-width: 0; /* Prevent grid blowout */ |
| 126 | } |
| 127 | |
| 128 | @media (max-width: 768px) { |
| 129 | .example { |
| 130 | padding: 20px; /* Reduced padding on mobile */ |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | .example-label { |
| 135 | font-size: 14px; |
| 136 | font-weight: 700; |
| 137 | color: #409cff; |
| 138 | text-transform: uppercase; |
| 139 | letter-spacing: 1px; |
| 140 | margin-bottom: 16px; |
| 141 | } |
| 142 | |
| 143 | .example-demo { |
| 144 | margin-bottom: 24px; |
| 145 | min-height: 60px; |
| 146 | display: flex; |
| 147 | align-items: center; |
| 148 | justify-content: center; |
| 149 | } |
| 150 | |
| 151 | .example-code { |
| 152 | background: #000; |
| 153 | border: 1px solid #38383a; |
| 154 | border-radius: 8px; |
| 155 | padding: 16px; |
| 156 | font-family: 'Monaco', 'Courier New', monospace; |
| 157 | font-size: 14px; /* Increased from 12px for better mobile readability */ |
| 158 | color: #34c759; |
| 159 | overflow-x: auto; |
| 160 | margin-bottom: 16px; |
| 161 | } |
| 162 | |
| 163 | .example-notes { |
| 164 | font-size: 14px; /* Increased from 13px for better mobile readability */ |
| 165 | color: #f0f0f0; |
| 166 | line-height: 1.6; |
| 167 | border-top: 1px solid #38383a; |
| 168 | padding-top: 16px; |
| 169 | } |
| 170 | |
| 171 | /* State Showcase */ |
| 172 | .state-showcase { |
| 173 | display: grid; |
| 174 | grid-template-columns: 1fr 1fr; |
| 175 | gap: 24px; |
| 176 | margin-bottom: 32px; |
| 177 | } |
| 178 | |
| 179 | @media (max-width: 768px) { |
| 180 | .state-showcase { |
| 181 | grid-template-columns: 1fr; /* Single column on mobile to prevent overflow */ |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | .state-box { |
| 186 | background: #2c2c2e; |
| 187 | border: 2px solid #38383a; |
| 188 | border-radius: 12px; |
| 189 | padding: 24px; |
| 190 | text-align: center; |
| 191 | min-width: 0; /* Prevent grid blowout */ |
| 192 | } |
| 193 | |
| 194 | .state-label { |
| 195 | font-size: 14px; /* Increased from 12px for better mobile readability */ |
| 196 | font-weight: 700; |
| 197 | color: #f0f0f0; |
| 198 | text-transform: uppercase; |
| 199 | letter-spacing: 1px; |
| 200 | margin-bottom: 16px; |
| 201 | } |
| 202 | |
| 203 | .state-visual { |
| 204 | margin-bottom: 16px; |
| 205 | } |
| 206 | |
| 207 | /* Simulate interactive states visually using CSS custom properties |
| 208 | These pass through shadow DOM boundaries to style the inner button */ |
| 209 | .state-visual.state-hover semantic-action, |
| 210 | .state-visual.state-hover semantic-card, |
| 211 | .state-visual.state-hover semantic-input, |
| 212 | .state-visual.state-hover semantic-modal, |
| 213 | .state-visual.state-hover semantic-adjuster { |
| 214 | --demo-transform: translateY(-2px); |
| 215 | --demo-box-shadow: 0 3px 8px rgba(64, 156, 255, 0.6); |
| 216 | --demo-filter: brightness(1.2); |
| 217 | } |
| 218 | |
| 219 | /* State demos using CSS custom properties that pass through shadow DOM */ |
| 220 | |
| 221 | .state-visual.state-active semantic-action, |
| 222 | .state-visual.state-active semantic-card, |
| 223 | .state-visual.state-active semantic-input { |
| 224 | --demo-transform: scale(0.96) translateY(1px); |
| 225 | --demo-box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3); |
| 226 | --demo-filter: brightness(0.85); |
| 227 | } |
| 228 | |
| 229 | .state-visual.state-focus semantic-action, |
| 230 | .state-visual.state-focus semantic-input, |
| 231 | .state-visual.state-focus semantic-card { |
| 232 | --demo-outline: 3px solid #4d9fff; |
| 233 | --demo-outline-offset: 2px; |
| 234 | } |
| 235 | |
| 236 | .state-visual.state-disabled semantic-action, |
| 237 | .state-visual.state-disabled semantic-input, |
| 238 | .state-visual.state-disabled semantic-card, |
| 239 | .state-visual.state-disabled semantic-adjuster { |
| 240 | /* Disabled state works naturally via disabled attribute */ |
| 241 | cursor: not-allowed !important; |
| 242 | } |
| 243 | |
| 244 | .state-description { |
| 245 | font-size: 14px; /* Increased from 13px for better mobile readability */ |
| 246 | color: #f0f0f0; |
| 247 | line-height: 1.6; |
| 248 | } |
| 249 | |
| 250 | /* Property Tables */ |
| 251 | .property-table { |
| 252 | width: 100%; |
| 253 | border-collapse: collapse; |
| 254 | background: #1c1c1e; |
| 255 | border: 2px solid #38383a; |
| 256 | border-radius: 12px; |
| 257 | overflow: hidden; |
| 258 | margin-bottom: 32px; |
| 259 | display: block; /* Allow horizontal scroll on mobile */ |
| 260 | overflow-x: auto; /* Enable horizontal scrolling for wide tables */ |
| 261 | } |
| 262 | |
| 263 | .property-table thead { |
| 264 | background: rgba(64, 156, 255, 0.1); |
| 265 | } |
| 266 | |
| 267 | .property-table th { |
| 268 | padding: 16px; |
| 269 | text-align: left; |
| 270 | font-weight: 700; |
| 271 | color: #409cff; |
| 272 | border-bottom: 2px solid #38383a; |
| 273 | font-size: 14px; /* Ensure readable size */ |
| 274 | } |
| 275 | |
| 276 | .property-table td { |
| 277 | padding: 16px; |
| 278 | border-bottom: 1px solid #38383a; |
| 279 | font-size: 14px; /* Ensure readable size */ |
| 280 | } |
| 281 | |
| 282 | @media (max-width: 768px) { |
| 283 | .property-table th, |
| 284 | .property-table td { |
| 285 | padding: 12px 8px; /* Reduced padding on mobile */ |
| 286 | font-size: 13px; /* Slightly smaller but still readable */ |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | .property-table tr:last-child td { |
| 291 | border-bottom: none; |
| 292 | } |
| 293 | |
| 294 | .prop-name { |
| 295 | font-family: 'Monaco', monospace; |
| 296 | color: #34c759; |
| 297 | font-weight: 600; |
| 298 | } |
| 299 | |
| 300 | .prop-type { |
| 301 | font-family: 'Monaco', monospace; |
| 302 | color: #ff9500; |
| 303 | font-size: 13px; |
| 304 | } |
| 305 | |
| 306 | .prop-values { |
| 307 | font-family: 'Monaco', monospace; |
| 308 | color: #409cff; |
| 309 | font-size: 13px; |
| 310 | } |
| 311 | |
| 312 | /* Print Styles */ |
| 313 | @media print { |
| 314 | body { |
| 315 | background: white; |
| 316 | color: black; |
| 317 | } |
| 318 | |
| 319 | .example { |
| 320 | border: 2px solid #ccc; |
| 321 | page-break-inside: avoid; |
| 322 | } |
| 323 | |
| 324 | .section { |
| 325 | page-break-after: always; |
| 326 | } |
| 327 | } |