vitess.io/vitess@v0.16.2/web/vtadmin/src/index.css (about) 1 /** 2 * Copyright 2021 The Vitess Authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 @import './style/fonts.css'; 18 19 @tailwind base; 20 @tailwind components; 21 @tailwind utilities; 22 23 :root { 24 /* Greyscale */ 25 --grey75: #f8fafd; 26 --grey200: #edf2f7; 27 --grey400: #cbd5e0; 28 --grey600: #718096; 29 --grey800: #2d3748; 30 --grey900: #1e2531; 31 32 /* Invariant colours common across all themes */ 33 --colorSuccess: #00893e; 34 --colorSuccess50: #4cba6a; 35 --colorSuccess200: #005a13; 36 --colorInfo: #ffab40; 37 --colorInfo50: #ffdd71; 38 --colorInfo200: #c77c02; 39 --colorError: #d32f2f; 40 --colorError50: #ff6659; 41 --colorError200: #9a0007; 42 43 /* Fonts */ 44 --fontFamilyPrimary: theme('fontFamily.sans'); 45 --fontFamilyMonospace: theme('fontFamily.mono'); 46 47 /* Body text */ 48 --lineHeightBody: 1.36; 49 50 /* Headings */ 51 --lineHeightHeading: 1.36; 52 53 /* Inputs + other form controls */ 54 --inputHeightSmall: 2.4rem; 55 --inputHeightMedium: 3.7rem; 56 --inputHeightLarge: 4.6rem; 57 58 /* Tables */ 59 --tableCellPadding: 1.6rem; 60 61 /* Layout variables, set to light theme by default */ 62 --backgroundPrimary: #fff; 63 --backgroundPrimaryHighlight: rgba(61, 90, 254, 0.1); 64 --backgroundSecondary: var(--grey75); 65 --backgroundSecondaryHighlight: var(--grey200); 66 --boxShadowHover: 0 3px 3px #cbd5e0; 67 --colorDisabled: var(--grey400); 68 --colorPrimary: #3d5afe; 69 --colorPrimary50: #8187ff; 70 --colorPrimary200: #0031ca; 71 --colorScaffoldingHighlight: var(--grey400); 72 --colorScaffoldingForeground: var(--grey600); 73 --tableBorderColor: var(--grey400); 74 --textColorPrimary: theme('textColor.primary'); 75 --textColorInverted: #fff; 76 --textColorSecondary: theme('textColor.secondary'); 77 --textColorDisabled: #cbd5e0; 78 79 /* TODO(doeg, someday): add a mixin to apply opacity to hex vars to re-use var(--backgroundInverted) */ 80 --tooltipBackground: rgba(0, 0, 0, 0.85); 81 82 /* Z-index */ 83 --zIndexDefault: 0; 84 --zIndexLow: 10; 85 --zIndexMid: 100; 86 --zIndexHigh: 1000; 87 } 88 89 /* Dark theme */ 90 [data-vtadmin-theme='dark'] { 91 --backgroundPrimary: #17171b; 92 --backgroundPrimaryHighlight: rgba(129, 135, 255, 0.2); 93 --backgroundSecondary: var(--grey900); 94 --backgroundSecondaryHighlight: var(--grey800); 95 --boxShadowHover: 0 3px 3px #2d3748; 96 --colorDisabled: var(--grey600); 97 --colorPrimary: #8187ff; 98 --colorPrimary50: #b6b7ff; 99 --colorPrimary200: #4a5acb; 100 --colorScaffoldingHighlight: var(--grey600); 101 --colorScaffoldingForeground: var(--grey400); 102 --tableBorderColor: var(--grey800); 103 --textColorPrimary: #fff; 104 --textColorInverted: #17171b; 105 --textColorSecondary: #cbd5e0; 106 --textColorDisabled: #2d3748; 107 --tooltipBackground: rgba(255, 255, 255, 0.85); 108 } 109 110 * { 111 box-sizing: border-box; 112 } 113 114 html { 115 /** 116 * Set a base font size of 1rem == 10px, based on the common browser default of 16px. 117 * This lets us use rem values everywhere for accessibility, while still 118 * "pinning" to reasonable defaults. For a really good article on this, 119 * see https://www.24a11y.com/2019/pixels-vs-relative-units-in-css-why-its-still-a-big-deal/ 120 */ 121 font-size: 62.5%; 122 } 123 124 body { 125 background: var(--backgroundPrimary); 126 color: var(--textColorPrimary); 127 font-size: theme('fontSize.base'); 128 line-height: var(--lineHeightBody); 129 margin: 0; 130 font-family: var(--fontFamilyPrimary); 131 -webkit-font-smoothing: antialiased; 132 -moz-osx-font-smoothing: grayscale; 133 } 134 135 /* Typography */ 136 h1 { 137 color: var(--textColorPrimary); 138 font-size: theme('fontSize.3xl'); 139 font-weight: 700; 140 line-height: var(--lineHeightHeading); 141 } 142 143 h2 { 144 color: var(--textColorPrimary); 145 font-size: theme('fontSize.2xl'); 146 font-weight: 700; 147 line-height: var(--lineHeightHeading); 148 } 149 150 h3 { 151 color: var(--textColorPrimary); 152 font-size: theme('fontSize.xl'); 153 font-weight: 700; 154 line-height: var(--lineHeightHeading); 155 } 156 157 code { 158 display: inline-block; 159 font-family: var(--fontFamilyMonospace); 160 margin: 0 2px; 161 } 162 163 p { 164 margin: 1.2rem 0; 165 } 166 167 /* Links */ 168 a, 169 a:visited, 170 a:focus, 171 a:active { 172 color: var(--colorPrimary); 173 cursor: pointer; 174 text-decoration: none; 175 } 176 177 /* Tables */ 178 table { 179 border-collapse: collapse; 180 margin: var(--tableCellPadding) 0; 181 width: 100%; 182 } 183 184 table caption { 185 background: var(--backgroundSecondary); 186 color: var(--textColorPrimary); 187 font-size: theme('fontSize.base'); 188 font-weight: 500; 189 padding: 1.2rem var(--tableCellPadding) 0.8rem var(--tableCellPadding); 190 text-align: left; 191 } 192 193 table th { 194 background: var(--backgroundSecondary); 195 border: solid 1px var(--backgroundSecondary); 196 border-bottom-color: var(--tableBorderColor); 197 color: var(--textColorSecondary); 198 font-size: theme('fontSize.base'); 199 font-weight: 500; 200 padding: 8px var(--tableCellPadding); 201 text-align: left; 202 } 203 204 table tbody tr { 205 border-bottom: solid 1px var(--tableBorderColor); 206 border-top: solid 1px var(--tableBorderColor); 207 } 208 209 table tbody td { 210 padding: var(--tableCellPadding); 211 vertical-align: top; 212 } 213 214 table tbody td[rowSpan] { 215 border-right: solid 1px var(--tableBorderColor); 216 } 217 218 .Toastify__toast { 219 padding: 0 !important; 220 min-height: auto !important; 221 background: none !important; 222 } 223 224 .Toastify__toast-body { 225 padding: 0 !important; 226 margin: 0 !important; 227 } 228 229 .Toastify__toast-theme--light, 230 .Toastify__toast-theme--dark { 231 background: none !important; 232 } 233 234 /* See https://tailwindcss.com/docs/extracting-components */ 235 @layer components { 236 .btn, 237 .btn:visited { 238 @apply bg-vtblue; 239 @apply border-2 border-vtblue; 240 @apply cursor-pointer; 241 @apply font-sans font-semibold; 242 @apply inline-block; 243 @apply leading-relaxed; 244 @apply outline-none; 245 @apply px-6 py-2; 246 @apply rounded-lg; 247 @apply text-center; 248 @apply text-white; 249 @apply select-none; 250 @apply whitespace-nowrap; 251 @apply w-min; 252 253 @apply focus:ring-vtblue-50; 254 @apply focus:ring-offset-1; 255 @apply focus:ring-2; 256 257 height: fit-content; 258 appearance: button; 259 } 260 261 .btn:disabled { 262 @apply cursor-not-allowed; 263 264 background: var(--colorDisabled); 265 border-color: var(--colorDisabled); 266 } 267 268 /* Size variants */ 269 .btn-lg { 270 @apply px-8; 271 @apply leading-loose; 272 @apply text-lg; 273 } 274 275 .btn-sm { 276 @apply border; 277 @apply leading-snug; 278 @apply px-4 py-1; 279 @apply text-sm; 280 } 281 282 /* Implicit icon styling */ 283 .btn svg { 284 @apply align-middle; 285 @apply fill-current; 286 @apply h-8; 287 @apply inline-block; 288 @apply -ml-2 mr-1; 289 } 290 291 .btn-lg svg { 292 @apply h-10; 293 @apply -ml-2 mr-2; 294 } 295 296 .btn-sm svg { 297 @apply h-6; 298 @apply -ml-3 mr-0; 299 } 300 301 /* Visual priority variants */ 302 .btn-secondary, 303 .btn-secondary:visited { 304 @apply bg-transparent !important; 305 @apply text-vtblue; 306 } 307 308 .btn-secondary:disabled { 309 @apply text-vtblue; 310 311 color: var(--colorDisabled); 312 } 313 314 /* Intents (colours) */ 315 .btn-danger, 316 .btn-danger:visited { 317 @apply focus:ring-danger-50; 318 @apply bg-danger; 319 @apply border-danger; 320 } 321 322 .btn-danger.btn-secondary:enabled, 323 .btn-danger.btn-secondary:visited { 324 @apply text-danger; 325 } 326 327 .btn-success, 328 .btn-success:visited { 329 @apply focus:ring-success-50; 330 @apply bg-success; 331 @apply border-success; 332 } 333 334 .btn-success.btn-secondary:enabled, 335 .btn-success.btn-secondary:visited { 336 @apply text-success; 337 } 338 339 .btn-warning, 340 .btn-warning:visited { 341 @apply focus:ring-warning-50; 342 @apply bg-warning; 343 @apply border-warning; 344 } 345 346 .btn-warning.btn-secondary:enabled, 347 .btn-warning.btn-secondary:visited { 348 @apply text-warning; 349 } 350 351 .toggle { 352 height: 19px; 353 width: 37px; 354 @apply relative; 355 @apply inline-flex; 356 @apply flex-shrink-0; 357 @apply border-2; 358 @apply border-transparent; 359 @apply rounded-full; 360 @apply cursor-pointer; 361 @apply transition-colors; 362 @apply ease-in-out; 363 @apply duration-200; 364 @apply focus:outline-none; 365 } 366 367 .toggle.on { 368 @apply bg-vtblue; 369 } 370 371 .toggle.off { 372 @apply bg-gray-400; 373 } 374 375 .toggle-button { 376 height: 15px; 377 width: 15px; 378 @apply pointer-events-none; 379 @apply inline-block; 380 @apply rounded-full; 381 @apply bg-white; 382 @apply shadow-lg; 383 @apply transform; 384 @apply ring-0; 385 @apply transition; 386 @apply ease-in-out; 387 @apply duration-200; 388 } 389 390 .toggle-button.on { 391 @apply translate-x-7; 392 } 393 394 .toggle-button.off { 395 @apply translate-x-0; 396 } 397 }