|
859 | 859 | } |
860 | 860 | .checkbox:hover .box { border-color: var(--accent); } |
861 | 861 |
|
| 862 | +/* Themed bare checkbox / radio. Paints EVERY raw <input type=checkbox|radio> |
| 863 | + that is NOT already wrapped by a styled component (.switch toggle, .checkbox |
| 864 | + with .box, .segmented radiogroup — those hide the native input via opacity:0 |
| 865 | + and draw their own control). One rule themes the model picker, batch-select, |
| 866 | + blocked-models editor, and every settings checkbox at once — existing and |
| 867 | + future — with no per-element markup. Uses theme vars so light/dark both work. */ |
| 868 | +input[type=checkbox]:not(.switch input):not(.checkbox input), |
| 869 | +input[type=radio]:not(.segmented input) { |
| 870 | + appearance: none; |
| 871 | + -webkit-appearance: none; |
| 872 | + width: 16px; |
| 873 | + height: 16px; |
| 874 | + margin: 0; |
| 875 | + flex-shrink: 0; |
| 876 | + vertical-align: -3px; |
| 877 | + border: 1.5px solid var(--border-strong); |
| 878 | + background: var(--bg-elev); |
| 879 | + cursor: pointer; |
| 880 | + transition: background .15s, border-color .15s, box-shadow .15s; |
| 881 | + position: relative; |
| 882 | +} |
| 883 | +input[type=checkbox]:not(.switch input):not(.checkbox input) { border-radius: 4px; } |
| 884 | +input[type=radio]:not(.segmented input) { border-radius: 50%; } |
| 885 | +input[type=checkbox]:not(.switch input):not(.checkbox input):hover, |
| 886 | +input[type=radio]:not(.segmented input):hover { border-color: var(--accent); } |
| 887 | +input[type=checkbox]:not(.switch input):not(.checkbox input):checked, |
| 888 | +input[type=radio]:not(.segmented input):checked { |
| 889 | + background: var(--accent); |
| 890 | + border-color: var(--accent); |
| 891 | +} |
| 892 | +/* checkbox tick (matches .checkbox .box::after) */ |
| 893 | +input[type=checkbox]:not(.switch input):not(.checkbox input):checked::after { |
| 894 | + content: ''; |
| 895 | + position: absolute; |
| 896 | + left: 4px; top: 1px; |
| 897 | + width: 4px; height: 8px; |
| 898 | + border: solid #fff; |
| 899 | + border-width: 0 2px 2px 0; |
| 900 | + transform: rotate(45deg); |
| 901 | +} |
| 902 | +/* radio inner dot */ |
| 903 | +input[type=radio]:not(.segmented input):checked::after { |
| 904 | + content: ''; |
| 905 | + position: absolute; |
| 906 | + left: 50%; top: 50%; |
| 907 | + width: 6px; height: 6px; |
| 908 | + border-radius: 50%; |
| 909 | + background: #fff; |
| 910 | + transform: translate(-50%, -50%); |
| 911 | +} |
| 912 | +input[type=checkbox]:not(.switch input):not(.checkbox input):focus-visible, |
| 913 | +input[type=radio]:not(.segmented input):focus-visible { |
| 914 | + outline: none; |
| 915 | + box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); |
| 916 | +} |
| 917 | +input[type=checkbox]:not(.switch input):not(.checkbox input):disabled, |
| 918 | +input[type=radio]:not(.segmented input):disabled { |
| 919 | + opacity: .45; |
| 920 | + cursor: not-allowed; |
| 921 | +} |
| 922 | + |
862 | 923 | /* Tab-style radio group */ |
863 | 924 | .segmented { |
864 | 925 | display: inline-flex; |
|
0 commit comments