File size: 38,687 Bytes
deb7f0f f3a20a7 deb7f0f | 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 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 | from __future__ import annotations
from collections.abc import Iterable
from gradio.themes.base import Base
from gradio.themes.utils import colors, fonts, sizes
# Custom CSS to style the Gradio footer as a Windows 95 taskbar
WINDOWS_95_CSS = """
/* Remove transforms from parent containers that break fixed positioning */
.gradio-container,
.gradio-container > *,
.main,
.wrap,
.app,
gradio-app,
gradio-app > *,
body > * {
transform: none !important;
filter: none !important;
perspective: none !important;
contain: none !important;
will-change: auto !important;
}
/* Windows 95 Taskbar Footer */
footer {
position: fixed !important;
bottom: 0 !important;
left: 0 !important;
right: 0 !important;
top: auto !important;
margin: 0 !important;
padding: 4px 8px !important;
background: #C0C0C0 !important;
border-top: 2px solid #FFFFFF !important;
box-shadow:
inset 0 1px 0 0 #DFDFDF,
inset 0 -1px 0 0 #808080,
0 -1px 0 0 #404040 !important;
justify-content: flex-start !important;
gap: 8px !important;
z-index: 2147483647 !important;
font-family: "MS Sans Serif", Tahoma, Arial, sans-serif !important;
height: auto !important;
min-height: 32px !important;
transform: none !important;
width: 100vw !important;
max-width: 100vw !important;
}
/* Style footer buttons like Windows 95 taskbar buttons */
footer button,
footer a {
background: #C0C0C0 !important;
color: #000000 !important;
border: none !important;
padding: 4px 12px !important;
margin: 0 2px !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #FFFFFF,
inset -2px -2px 0px 0px #404040,
inset 2px 2px 0px 0px #DFDFDF !important;
font-family: "MS Sans Serif", Tahoma, Arial, sans-serif !important;
font-size: 12px !important;
}
footer button:hover,
footer a:hover {
color: #000000 !important;
}
footer button:active,
footer a:active {
box-shadow:
inset 1px 1px 0px 0px #808080,
inset -1px -1px 0px 0px #DFDFDF !important;
}
/* Hide the dividers */
footer .divider {
display: none !important;
}
/* Style the images/icons */
footer img {
filter: none !important;
}
/* Add padding to main content to account for fixed footer */
.gradio-container {
padding-bottom: 50px !important;
}
/* Ensure footer stays fixed even in flex/grid containers */
.main,
.wrap,
.app {
padding-bottom: 50px !important;
}
/* Start button style for the first button (if desired) */
footer button:first-of-type,
footer a:first-of-type {
font-weight: bold !important;
}
/* System tray style for the last elements - sunken appearance */
footer button:last-of-type,
footer .settings {
margin-left: auto !important;
box-shadow:
inset 1px 1px 0px 0px #808080,
inset -1px -1px 0px 0px #FFFFFF,
inset 2px 2px 0px 0px #404040,
inset -2px -2px 0px 0px #DFDFDF !important;
}
/* API docs panel styling - gray background like Windows 95 */
.api-docs-wrap,
#api-recorder-container {
background: #C0C0C0 !important;
}
/* API name badges - navy background needs white text */
.post,
h3 .post,
span.post {
background: #000080 !important;
color: #FFFFFF !important;
border-color: #000080 !important;
}
/* Parameter type badges in API docs - the highlight class */
.highlight,
span.highlight,
.code.highlight {
background: #000080 !important;
color: #FFFFFF !important;
padding: 2px 6px !important;
}
/* Parameter type badges in API docs */
.type,
.param-type,
.parameter-type {
color: #FFFFFF !important;
background: #000080 !important;
padding: 2px 6px !important;
}
/* Required/Optional badges */
span[class*="required"],
span[class*="optional"],
.required,
.optional {
color: #FFFFFF !important;
}
/* ===== Windows 95 Copy Button ===== */
.copy-button,
button[class*="copy"],
[class*="copy-button"] {
background: #C0C0C0 !important;
color: #000000 !important;
border: none !important;
border-radius: 0 !important;
padding: 4px 12px !important;
font-family: "MS Sans Serif", Tahoma, Arial, sans-serif !important;
font-size: 12px !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #FFFFFF,
inset -2px -2px 0px 0px #404040,
inset 2px 2px 0px 0px #DFDFDF !important;
}
.copy-button:hover,
button[class*="copy"]:hover,
[class*="copy-button"]:hover {
background: #C0C0C0 !important;
}
.copy-button:active,
button[class*="copy"]:active,
[class*="copy-button"]:active {
box-shadow:
inset 1px 1px 0px 0px #808080,
inset -1px -1px 0px 0px #DFDFDF !important;
}
/* Copy button icons */
.copy-button svg,
button[class*="copy"] svg {
color: #000000 !important;
fill: #000000 !important;
}
/* The "Copy Page" dropdown button - be specific to avoid breaking footer */
.api-docs-wrap [class*="dropdown"] button,
.api-docs-wrap .dropdown-toggle,
.api-docs-wrap button[aria-haspopup="true"] {
background: #C0C0C0 !important;
color: #000000 !important;
border: none !important;
border-radius: 0 !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #FFFFFF,
inset -2px -2px 0px 0px #404040,
inset 2px 2px 0px 0px #DFDFDF !important;
}
/* ===== Windows 95 Dropdown Menus ===== */
[role="menu"],
[role="listbox"],
.dropdown-menu,
div[class*="dropdown"] > div,
ul[class*="menu"],
div[class*="menu"]:not(.overflow-menu) {
background: #C0C0C0 !important;
border: none !important;
border-radius: 0 !important;
padding: 2px !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #FFFFFF,
inset -2px -2px 0px 0px #404040,
inset 2px 2px 0px 0px #DFDFDF,
4px 4px 0px 0px rgba(0,0,0,0.3) !important;
}
/* Dropdown menu items */
[role="menu"] button,
[role="menu"] a,
[role="menuitem"],
.dropdown-menu button,
.dropdown-menu a,
div[class*="dropdown"] button,
div[class*="dropdown"] a {
background: #C0C0C0 !important;
color: #000000 !important;
border: none !important;
border-radius: 0 !important;
padding: 4px 24px 4px 8px !important;
margin: 0 !important;
box-shadow: none !important;
text-align: left !important;
display: block !important;
width: 100% !important;
}
[role="menu"] button:hover,
[role="menu"] a:hover,
[role="menuitem"]:hover,
.dropdown-menu button:hover,
.dropdown-menu a:hover,
div[class*="dropdown"] button:hover,
div[class*="dropdown"] a:hover {
background: #000080 !important;
color: #FFFFFF !important;
}
/* Menu item descriptions/subtitles */
[role="menu"] span,
[role="menu"] p,
.dropdown-menu span,
.dropdown-menu p {
color: inherit !important;
}
/* Menu icons */
[role="menu"] svg,
.dropdown-menu svg {
color: inherit !important;
fill: currentColor !important;
}
/* Any element using color-accent-soft as background needs white text */
[style*="color-accent-soft"],
[style*="accent"] {
color: #FFFFFF !important;
}
/* Code blocks - keep readable with white background */
pre {
background: #FFFFFF !important;
color: #000000 !important;
box-shadow: inset 1px 1px 0px 0px #808080,
inset -1px -1px 0px 0px #FFFFFF,
inset 2px 2px 0px 0px #404040,
inset -2px -2px 0px 0px #DFDFDF !important;
}
pre code,
code {
background: transparent !important;
color: #000000 !important;
}
/* API name in code snippets - keep the accent color visible */
pre .api-name,
code .api-name {
color: #000080 !important;
}
/* Highlighted text in code - navy background needs white text */
pre .highlight,
pre span.highlight,
code .highlight,
code span.highlight {
background: #000080 !important;
color: #FFFFFF !important;
}
/* String literals in code */
pre .token.string,
.token.string {
color: #008000 !important;
}
/* Syntax highlighting keywords with navy background need white text */
pre span[style*="background"],
code span[style*="background"],
pre .keyword,
pre .builtin,
pre .function-name,
code .keyword,
code .builtin {
color: #FFFFFF !important;
}
/* ===== Windows 95 Style Tabs ===== */
/* Remove gap between tabs and content */
.tabs {
gap: 0 !important;
}
/* Tab container - remove the modern underline */
.tab-container::after {
display: none !important;
}
.tab-wrapper {
padding-bottom: 0 !important;
margin-bottom: -2px !important;
border-bottom: none !important;
background: transparent !important;
z-index: 1 !important;
position: relative !important;
}
/* Individual tab buttons - raised 3D folder tab style */
.tab-container button,
.tabs button[role="tab"] {
background: #C0C0C0 !important;
color: #000000 !important;
border: none !important;
border-radius: 0 !important;
padding: 4px 16px !important;
margin: 0 !important;
margin-right: -1px !important;
position: relative !important;
bottom: -2px !important;
font-weight: 400 !important;
/* 3D raised effect for inactive tabs */
box-shadow:
inset 1px 1px 0px 0px #FFFFFF,
inset -1px 0px 0px 0px #808080,
inset 2px 2px 0px 0px #DFDFDF,
inset -2px 0px 0px 0px #404040,
0px -1px 0px 0px #FFFFFF !important;
/* Clip the bottom to show connection */
border-bottom: 2px solid #C0C0C0 !important;
}
/* Inactive tabs - slightly darker/recessed look */
.tab-container button:not(.selected),
.tabs button[role="tab"]:not(.selected) {
background: #C0C0C0 !important;
border-bottom: 2px solid #808080 !important;
margin-bottom: 0 !important;
}
/* Hover state for non-selected tabs */
.tab-container button:hover:not(.selected),
.tabs button[role="tab"]:hover:not(.selected) {
background: #C0C0C0 !important;
}
/* Selected tab - connected to content below */
.tab-container button.selected,
.tabs button[role="tab"].selected,
.tabs button[role="tab"][aria-selected="true"] {
background: #C0C0C0 !important;
color: #000000 !important;
border-bottom: 2px solid #C0C0C0 !important;
z-index: 2 !important;
/* Full raised 3D effect */
box-shadow:
inset 1px 1px 0px 0px #FFFFFF,
inset -1px 0px 0px 0px #808080,
inset 2px 2px 0px 0px #DFDFDF,
inset -2px 0px 0px 0px #404040 !important;
}
/* Remove the modern accent underline from selected tab */
.tab-container button.selected::after,
.tabs button[role="tab"].selected::after,
.tabs button[role="tab"][aria-selected="true"]::after {
display: none !important;
}
/* Tab content panel */
.tabs > :not(.tab-wrapper):not(style) {
background: #C0C0C0 !important;
border: none !important;
border-top: 2px solid #808080 !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 0px 0px 0px #FFFFFF,
inset 0px 1px 0px 0px #FFFFFF,
-2px -2px 0px 0px #404040,
2px 2px 0px 0px #DFDFDF !important;
padding: 8px !important;
margin-top: 0 !important;
}
/* Overflow menu button */
.overflow-menu > button {
background: #C0C0C0 !important;
border: none !important;
border-radius: 0 !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #FFFFFF,
inset -2px -2px 0px 0px #404040,
inset 2px 2px 0px 0px #DFDFDF !important;
}
/* Overflow dropdown */
.overflow-dropdown {
background: #C0C0C0 !important;
border: none !important;
border-radius: 0 !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #FFFFFF,
inset -2px -2px 0px 0px #404040,
inset 2px 2px 0px 0px #DFDFDF,
2px 2px 4px rgba(0,0,0,0.3) !important;
}
.overflow-dropdown button {
background: #C0C0C0 !important;
color: #000000 !important;
}
.overflow-dropdown button:hover {
background: #000080 !important;
color: #FFFFFF !important;
}
.overflow-dropdown button.selected {
background: #000080 !important;
color: #FFFFFF !important;
}
/* ===== Windows 95 Scrollbars ===== */
* {
scrollbar-width: auto;
scrollbar-color: #C0C0C0 #DFDFDF;
}
*::-webkit-scrollbar {
width: 16px !important;
height: 16px !important;
}
*::-webkit-scrollbar-track {
background: #DFDFDF !important;
background-image: url("data:image/svg+xml,%3Csvg width='2' height='2' viewBox='0 0 2 2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h1v1H0zM1 1h1v1H1z' fill='%23C0C0C0'/%3E%3C/svg%3E") !important;
background-size: 2px 2px !important;
}
*::-webkit-scrollbar-thumb {
background: #C0C0C0 !important;
border: none !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #FFFFFF,
inset -2px -2px 0px 0px #404040,
inset 2px 2px 0px 0px #DFDFDF !important;
}
*::-webkit-scrollbar-button {
background: #C0C0C0 !important;
border: none !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #FFFFFF,
inset -2px -2px 0px 0px #404040,
inset 2px 2px 0px 0px #DFDFDF !important;
display: block !important;
height: 16px !important;
width: 16px !important;
}
/* ===== Windows 95 Tooltips ===== */
[data-tooltip],
[title],
.tooltip,
[role="tooltip"] {
--tooltip-bg: #FFFFE1 !important;
--tooltip-color: #000000 !important;
}
/* ===== Windows 95 Selection ===== */
::selection {
background: #000080 !important;
color: #FFFFFF !important;
}
::-moz-selection {
background: #000080 !important;
color: #FFFFFF !important;
}
/* ===== Windows 95 Focus Ring ===== */
*:focus {
outline: 1px dotted #000000 !important;
outline-offset: -4px !important;
}
button:focus,
input:focus,
textarea:focus,
select:focus {
outline: 1px dotted #000000 !important;
outline-offset: 2px !important;
}
/* ===== Windows 95 Disabled State ===== */
button:disabled,
input:disabled,
textarea:disabled,
select:disabled,
[disabled] {
color: #808080 !important;
text-shadow: 1px 1px 0px #FFFFFF !important;
cursor: not-allowed !important;
}
/* ===== Windows 95 Progress Bar ===== */
progress,
.progress-bar,
[role="progressbar"] {
background: #C0C0C0 !important;
border: none !important;
box-shadow:
inset 1px 1px 0px 0px #808080,
inset -1px -1px 0px 0px #FFFFFF,
inset 2px 2px 0px 0px #404040,
inset -2px -2px 0px 0px #DFDFDF !important;
height: 20px !important;
border-radius: 0 !important;
}
progress::-webkit-progress-bar {
background: #C0C0C0 !important;
border-radius: 0 !important;
}
progress::-webkit-progress-value {
background: repeating-linear-gradient(
90deg,
#000080 0px,
#000080 8px,
#C0C0C0 8px,
#C0C0C0 10px
) !important;
border-radius: 0 !important;
}
progress::-moz-progress-bar {
background: repeating-linear-gradient(
90deg,
#000080 0px,
#000080 8px,
#C0C0C0 8px,
#C0C0C0 10px
) !important;
border-radius: 0 !important;
}
/* ===== Windows 95 Accordion/Group Box ===== */
.accordion,
details,
fieldset,
.group {
border: none !important;
box-shadow:
inset 1px 1px 0px 0px #FFFFFF,
inset -1px -1px 0px 0px #808080 !important;
background: #C0C0C0 !important;
padding: 8px !important;
margin: 4px 0 !important;
}
/* ===== Windows 95 Dropdown/Select ===== */
select,
.dropdown,
[role="listbox"] {
background: #FFFFFF !important;
border: none !important;
box-shadow:
inset 1px 1px 0px 0px #808080,
inset -1px -1px 0px 0px #FFFFFF,
inset 2px 2px 0px 0px #404040,
inset -2px -2px 0px 0px #DFDFDF !important;
border-radius: 0 !important;
padding: 2px 4px !important;
}
/* ===== Windows 95 Slider/Range ===== */
input[type="range"] {
-webkit-appearance: none !important;
background: transparent !important;
height: 24px !important;
}
input[type="range"]::-webkit-slider-track {
background: #C0C0C0 !important;
height: 4px !important;
box-shadow:
inset 1px 1px 0px 0px #808080,
inset -1px -1px 0px 0px #FFFFFF !important;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none !important;
width: 12px !important;
height: 20px !important;
background: #C0C0C0 !important;
border: none !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #FFFFFF,
inset -2px -2px 0px 0px #404040,
inset 2px 2px 0px 0px #DFDFDF !important;
cursor: pointer !important;
margin-top: -8px !important;
}
/* ===== Windows 95 Labels with Icons ===== */
.label-wrap label::before,
.block-label span::before {
/* Could add a small icon here */
}
/* ===== Windows 95 Image/Media containers ===== */
.image-container,
.video-container,
.gallery {
box-shadow:
inset 1px 1px 0px 0px #808080,
inset -1px -1px 0px 0px #FFFFFF,
inset 2px 2px 0px 0px #404040,
inset -2px -2px 0px 0px #DFDFDF !important;
}
/* Exclude small icons from bezel effect */
footer img,
button img,
a img,
svg {
box-shadow: none !important;
}
/* ===== Windows 95 File Upload ===== */
.upload-container,
.file-upload,
[type="file"] {
background: #C0C0C0 !important;
border: 2px dashed #808080 !important;
border-radius: 0 !important;
}
/* ===== Windows 95 Loading/Hourglass Cursor ===== */
.pending,
.loading,
[aria-busy="true"] {
cursor: wait !important;
}
/* ===== Windows 95 Markdown/Prose ===== */
.prose h1,
.prose h2,
.prose h3,
.markdown h1,
.markdown h2,
.markdown h3,
h1, h2, h3 {
color: #000000 !important;
font-weight: bold !important;
border-bottom: none !important;
}
/* ===== Windows 95 Horizontal Rule ===== */
hr {
border: none !important;
height: 2px !important;
background: linear-gradient(to bottom, #808080 0%, #808080 50%, #FFFFFF 50%, #FFFFFF 100%) !important;
margin: 8px 0 !important;
}
/* ===== Windows 95 Blockquote ===== */
blockquote {
background: #FFFFFF !important;
border-left: 4px solid #000080 !important;
padding: 8px !important;
margin: 8px 0 !important;
box-shadow:
inset 1px 1px 0px 0px #808080,
inset -1px -1px 0px 0px #FFFFFF !important;
}
/* ===== Windows 95 Chatbot Messages ===== */
.message,
.chat-message,
[class*="message"] {
border-radius: 0 !important;
}
.user-message,
[class*="user"] {
background: #FFFFFF !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #DFDFDF !important;
}
.bot-message,
[class*="bot"],
[class*="assistant"] {
background: #FFFFC0 !important;
box-shadow:
inset -1px -1px 0px 0px #808080,
inset 1px 1px 0px 0px #DFDFDF !important;
}
/* ===== Windows 95 Loading Animation ===== */
@keyframes win95-loading {
0% { background-position: 0% 0%; }
100% { background-position: 100% 0%; }
}
.loading-indicator,
.loader {
background: repeating-linear-gradient(
90deg,
#000080 0px,
#000080 16px,
transparent 16px,
transparent 20px
) !important;
background-size: 200% 100% !important;
animation: win95-loading 1s linear infinite !important;
}
"""
class Windows95Gray(colors.Color):
"""Custom color palette matching Windows 95 system colors."""
def __init__(self):
super().__init__(
c50="#FFFFFF", # Window background / highlight
c100="#DFDFDF", # Light gray
c200="#C0C0C0", # Button face / 3D objects (classic silver)
c300="#A0A0A0", # Disabled text / inactive elements
c400="#808080", # Button shadow / 3D dark shadow
c500="#606060", # Dark elements
c600="#404040", # Darker elements
c700="#303030", # Very dark
c800="#202020", # Near black
c900="#000000", # Window text (black)
c950="#000000", # Pure black
name="win95gray",
)
class Windows95Blue(colors.Color):
"""Windows 95 navy blue for title bars and selections."""
def __init__(self):
super().__init__(
c50="#E6E6FF", # Lightest blue
c100="#CCCCFF", # Light blue
c200="#9999FF", # Medium light blue
c300="#6666FF", # Medium blue
c400="#3333CC", # Blue
c500="#000080", # Navy blue (active title bar)
c600="#000066", # Dark navy
c700="#000055", # Darker navy
c800="#000044", # Very dark navy
c900="#000033", # Nearly black navy
c950="#000022", # Darkest navy
name="win95blue",
)
class Windows95Teal(colors.Color):
"""Windows 95 teal accent color."""
def __init__(self):
super().__init__(
c50="#E0FFFF", # Lightest teal
c100="#B0FFFF", # Light teal
c200="#80FFFF", # Medium light teal
c300="#40E0E0", # Medium teal
c400="#20C0C0", # Teal
c500="#008080", # Classic teal (desktop default)
c600="#006666", # Dark teal
c700="#005555", # Darker teal
c800="#004444", # Very dark teal
c900="#003333", # Nearly black teal
c950="#002222", # Darkest teal
name="win95teal",
)
# Windows 95 3D border shadow effects
WIN95_SHADOW_RAISED = "inset -1px -1px 0px 0px #808080, inset 1px 1px 0px 0px #FFFFFF, inset -2px -2px 0px 0px #404040, inset 2px 2px 0px 0px #DFDFDF"
WIN95_SHADOW_SUNKEN = "inset 1px 1px 0px 0px #808080, inset -1px -1px 0px 0px #FFFFFF, inset 2px 2px 0px 0px #404040, inset -2px -2px 0px 0px #DFDFDF"
WIN95_SHADOW_PRESSED = "inset 1px 1px 0px 0px #808080, inset -1px -1px 0px 0px #DFDFDF"
WIN95_SHADOW_ETCHED = "inset 1px 1px 0px 0px #808080, inset -1px -1px 0px 0px #FFFFFF"
class Windows95(Base):
"""
A nostalgic theme inspired by Microsoft Windows 95.
Features the classic gray interface, 3D beveled buttons,
sunken input fields, and the iconic system font styling.
"""
def __init__(
self,
*,
primary_hue: colors.Color | str = None,
secondary_hue: colors.Color | str = None,
neutral_hue: colors.Color | str = None,
spacing_size: sizes.Size | str = sizes.spacing_md,
radius_size: sizes.Size | str = sizes.radius_none,
text_size: sizes.Size | str = sizes.text_md,
font: fonts.Font | str | Iterable[fonts.Font | str] = (
"MS Sans Serif",
"Tahoma",
"Segoe UI",
"Arial",
"sans-serif",
),
font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
"Fixedsys",
"Consolas",
"Courier New",
"monospace",
),
):
# Use our custom Windows 95 color palettes
if primary_hue is None:
primary_hue = Windows95Blue()
if secondary_hue is None:
secondary_hue = Windows95Teal()
if neutral_hue is None:
neutral_hue = Windows95Gray()
super().__init__(
primary_hue=primary_hue,
secondary_hue=secondary_hue,
neutral_hue=neutral_hue,
spacing_size=spacing_size,
radius_size=radius_size,
text_size=text_size,
font=font,
font_mono=font_mono
)
self.name = "windows95"
super().set(
# ===== Body / Background =====
# Classic gray desktop background
body_background_fill="#008080", # Teal desktop
body_background_fill_dark="#008080",
body_text_color="#000000",
body_text_color_dark="#000000",
body_text_color_subdued="#808080",
body_text_color_subdued_dark="#808080",
body_text_weight="400",
# ===== Core Element Colors =====
# Window/panel backgrounds
background_fill_primary="#C0C0C0", # Silver gray
background_fill_primary_dark="#C0C0C0",
background_fill_secondary="#C0C0C0",
background_fill_secondary_dark="#C0C0C0",
# Border colors
border_color_primary="#808080",
border_color_primary_dark="#808080",
border_color_accent="#000080", # Navy blue accent
border_color_accent_dark="#000080",
# Accent colors (selection, highlights)
color_accent="#000080", # Navy blue
color_accent_soft="#000080", # Navy blue for badges/tags
color_accent_soft_dark="#000080",
# ===== Links =====
link_text_color="#0000FF", # Classic blue links
link_text_color_dark="#0000FF",
link_text_color_hover="#0000FF",
link_text_color_hover_dark="#0000FF",
link_text_color_active="#800080", # Purple when active
link_text_color_active_dark="#800080",
link_text_color_visited="#800080", # Purple visited
link_text_color_visited_dark="#800080",
# ===== Text Styling =====
prose_text_size="*text_md",
prose_text_weight="400",
prose_header_text_weight="700",
code_background_fill="#FFFFFF",
code_background_fill_dark="#FFFFFF",
# ===== Shadows (3D Beveled Effects) =====
shadow_drop="none",
shadow_drop_lg="none",
shadow_inset=WIN95_SHADOW_SUNKEN,
shadow_spread="0px",
shadow_spread_dark="0px",
# ===== Block/Container Styling =====
# Main content blocks with raised 3D effect
block_background_fill="#C0C0C0",
block_background_fill_dark="#C0C0C0",
block_border_color="#808080",
block_border_color_dark="#808080",
block_border_width="2px",
block_border_width_dark="2px",
block_padding="*spacing_md",
block_radius="0px",
block_shadow=WIN95_SHADOW_RAISED,
block_shadow_dark=WIN95_SHADOW_RAISED,
# Block labels (like window title bars)
block_label_background_fill="#000080", # Navy title bar
block_label_background_fill_dark="#000080",
block_label_text_color="#FFFFFF", # White text on title bar
block_label_text_color_dark="#FFFFFF",
block_label_border_color="#000080",
block_label_border_color_dark="#000080",
block_label_border_width="0px",
block_label_border_width_dark="0px",
block_label_padding="*spacing_xs *spacing_sm",
block_label_margin="0",
block_label_radius="0px",
block_label_text_size="*text_sm",
block_label_text_weight="700",
block_label_shadow="none",
block_label_right_radius="0px",
# Block titles
block_title_background_fill="transparent",
block_title_background_fill_dark="transparent",
block_title_text_color="#000000",
block_title_text_color_dark="#000000",
block_title_border_color="transparent",
block_title_border_color_dark="transparent",
block_title_border_width="0px",
block_title_border_width_dark="0px",
block_title_padding="*spacing_xs 0",
block_title_radius="0px",
block_title_text_size="*text_sm",
block_title_text_weight="700",
# Block info
block_info_text_color="#000000",
block_info_text_color_dark="#000000",
block_info_text_size="*text_sm",
block_info_text_weight="400",
# ===== Panel Styling =====
panel_background_fill="#C0C0C0",
panel_background_fill_dark="#C0C0C0",
panel_border_color="#808080",
panel_border_color_dark="#808080",
panel_border_width="2px",
panel_border_width_dark="2px",
# ===== Layout =====
container_radius="0px",
form_gap_width="1px",
layout_gap="*spacing_md",
section_header_text_size="*text_md",
section_header_text_weight="700",
embed_radius="0px",
# ===== Input Fields (Sunken 3D Effect) =====
input_background_fill="#FFFFFF", # White input fields
input_background_fill_dark="#FFFFFF",
input_background_fill_focus="#FFFFFF",
input_background_fill_focus_dark="#FFFFFF",
input_background_fill_hover="#FFFFFF",
input_background_fill_hover_dark="#FFFFFF",
input_border_color="#808080",
input_border_color_dark="#808080",
input_border_color_focus="#000080", # Navy when focused
input_border_color_focus_dark="#000080",
input_border_color_hover="#808080",
input_border_color_hover_dark="#808080",
input_border_width="2px",
input_border_width_dark="2px",
input_padding="*spacing_sm",
input_radius="0px",
input_shadow=WIN95_SHADOW_SUNKEN,
input_shadow_dark=WIN95_SHADOW_SUNKEN,
input_shadow_focus=WIN95_SHADOW_SUNKEN,
input_shadow_focus_dark=WIN95_SHADOW_SUNKEN,
input_text_size="*text_md",
input_text_weight="400",
input_placeholder_color="#808080",
input_placeholder_color_dark="#808080",
# ===== Buttons (Raised 3D Effect) =====
button_border_width="2px",
button_border_width_dark="2px",
button_transition="none",
button_transform_hover="none",
button_transform_active="none",
# Large buttons
button_large_padding="*spacing_sm *spacing_lg",
button_large_radius="0px",
button_large_text_size="*text_md",
button_large_text_weight="400",
# Medium buttons
button_medium_padding="*spacing_xs *spacing_md",
button_medium_radius="0px",
button_medium_text_size="*text_md",
button_medium_text_weight="400",
# Small buttons
button_small_padding="*spacing_xs *spacing_sm",
button_small_radius="0px",
button_small_text_size="*text_sm",
button_small_text_weight="400",
# Primary button (like OK button)
button_primary_background_fill="#C0C0C0",
button_primary_background_fill_dark="#C0C0C0",
button_primary_background_fill_hover="#C0C0C0",
button_primary_background_fill_hover_dark="#C0C0C0",
button_primary_border_color="#000000",
button_primary_border_color_dark="#000000",
button_primary_border_color_hover="#000000",
button_primary_border_color_hover_dark="#000000",
button_primary_text_color="#000000",
button_primary_text_color_dark="#000000",
button_primary_text_color_hover="#000000",
button_primary_text_color_hover_dark="#000000",
button_primary_shadow=WIN95_SHADOW_RAISED,
button_primary_shadow_dark=WIN95_SHADOW_RAISED,
button_primary_shadow_hover=WIN95_SHADOW_RAISED,
button_primary_shadow_hover_dark=WIN95_SHADOW_RAISED,
button_primary_shadow_active=WIN95_SHADOW_PRESSED,
button_primary_shadow_active_dark=WIN95_SHADOW_PRESSED,
# Secondary button
button_secondary_background_fill="#C0C0C0",
button_secondary_background_fill_dark="#C0C0C0",
button_secondary_background_fill_hover="#C0C0C0",
button_secondary_background_fill_hover_dark="#C0C0C0",
button_secondary_border_color="#808080",
button_secondary_border_color_dark="#808080",
button_secondary_border_color_hover="#808080",
button_secondary_border_color_hover_dark="#808080",
button_secondary_text_color="#000000",
button_secondary_text_color_dark="#000000",
button_secondary_text_color_hover="#000000",
button_secondary_text_color_hover_dark="#000000",
button_secondary_shadow=WIN95_SHADOW_RAISED,
button_secondary_shadow_dark=WIN95_SHADOW_RAISED,
button_secondary_shadow_hover=WIN95_SHADOW_RAISED,
button_secondary_shadow_hover_dark=WIN95_SHADOW_RAISED,
button_secondary_shadow_active=WIN95_SHADOW_PRESSED,
button_secondary_shadow_active_dark=WIN95_SHADOW_PRESSED,
# Cancel button
button_cancel_background_fill="#C0C0C0",
button_cancel_background_fill_dark="#C0C0C0",
button_cancel_background_fill_hover="#C0C0C0",
button_cancel_background_fill_hover_dark="#C0C0C0",
button_cancel_border_color="#808080",
button_cancel_border_color_dark="#808080",
button_cancel_border_color_hover="#808080",
button_cancel_border_color_hover_dark="#808080",
button_cancel_text_color="#000000",
button_cancel_text_color_dark="#000000",
button_cancel_text_color_hover="#000000",
button_cancel_text_color_hover_dark="#000000",
button_cancel_shadow=WIN95_SHADOW_RAISED,
button_cancel_shadow_dark=WIN95_SHADOW_RAISED,
button_cancel_shadow_hover=WIN95_SHADOW_RAISED,
button_cancel_shadow_hover_dark=WIN95_SHADOW_RAISED,
button_cancel_shadow_active=WIN95_SHADOW_PRESSED,
button_cancel_shadow_active_dark=WIN95_SHADOW_PRESSED,
# ===== Checkboxes and Radio Buttons =====
checkbox_background_color="#FFFFFF",
checkbox_background_color_dark="#FFFFFF",
checkbox_background_color_focus="#FFFFFF",
checkbox_background_color_focus_dark="#FFFFFF",
checkbox_background_color_hover="#FFFFFF",
checkbox_background_color_hover_dark="#FFFFFF",
checkbox_background_color_selected="#FFFFFF",
checkbox_background_color_selected_dark="#FFFFFF",
checkbox_border_color="#808080",
checkbox_border_color_dark="#808080",
checkbox_border_color_focus="#000080",
checkbox_border_color_focus_dark="#000080",
checkbox_border_color_hover="#808080",
checkbox_border_color_hover_dark="#808080",
checkbox_border_color_selected="#808080",
checkbox_border_color_selected_dark="#808080",
checkbox_border_radius="0px",
checkbox_border_width="2px",
checkbox_border_width_dark="2px",
checkbox_shadow=WIN95_SHADOW_SUNKEN,
# Checkbox check mark (black check)
checkbox_check="url(\"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='black' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e\")",
# Radio button circle (black dot)
radio_circle="url(\"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='black' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='4'/%3e%3c/svg%3e\")",
# Checkbox labels (button-like appearance)
checkbox_label_background_fill="#C0C0C0",
checkbox_label_background_fill_dark="#C0C0C0",
checkbox_label_background_fill_hover="#C0C0C0",
checkbox_label_background_fill_hover_dark="#C0C0C0",
checkbox_label_background_fill_selected="#000080", # Navy when selected
checkbox_label_background_fill_selected_dark="#000080",
checkbox_label_border_color="#808080",
checkbox_label_border_color_dark="#808080",
checkbox_label_border_color_hover="#808080",
checkbox_label_border_color_hover_dark="#808080",
checkbox_label_border_color_selected="#000080",
checkbox_label_border_color_selected_dark="#000080",
checkbox_label_border_width="2px",
checkbox_label_border_width_dark="2px",
checkbox_label_padding="*spacing_xs *spacing_sm",
checkbox_label_gap="*spacing_sm",
checkbox_label_shadow=WIN95_SHADOW_RAISED,
checkbox_label_text_size="*text_md",
checkbox_label_text_weight="400",
checkbox_label_text_color="#000000",
checkbox_label_text_color_dark="#000000",
checkbox_label_text_color_selected="#FFFFFF", # White on navy
checkbox_label_text_color_selected_dark="#FFFFFF",
# ===== Tables =====
table_border_color="#808080",
table_border_color_dark="#808080",
table_even_background_fill="#FFFFFF",
table_even_background_fill_dark="#FFFFFF",
table_odd_background_fill="#C0C0C0",
table_odd_background_fill_dark="#C0C0C0",
table_radius="0px",
table_row_focus="#000080",
table_row_focus_dark="#000080",
table_text_color="#000000",
table_text_color_dark="#000000",
# ===== Accordion =====
accordion_text_color="#000000",
accordion_text_color_dark="#000000",
# ===== Slider =====
slider_color="#000080", # Navy slider
slider_color_dark="#000080",
# ===== Loader =====
loader_color="#000080", # Navy loading indicator
loader_color_dark="#000080",
# ===== Chatbot =====
chatbot_text_size="*text_md",
# ===== Errors =====
error_background_fill="#FFFFFF",
error_background_fill_dark="#FFFFFF",
error_border_color="#FF0000", # Red error border
error_border_color_dark="#FF0000",
error_border_width="2px",
error_border_width_dark="2px",
error_text_color="#FF0000", # Red error text
error_text_color_dark="#FF0000",
error_icon_color="#FF0000",
error_icon_color_dark="#FF0000",
# ===== Stats =====
stat_background_fill="#000080", # Navy stat bars
stat_background_fill_dark="#000080",
)
|