PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / css / common / _switch.scss

_switch.scss in Code Snippets trunk, at css/common/_switch.scss

130 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 @use 'theme';
2
3 .snippet-execution-button,
4 .snippet-activation-switch,
5 input[type='checkbox']='checkbox'].switch {
6 display: block;
7 position: relative;
8 }
9
10 // Activation switch: an accent-coloured 36x19 pill shared by the list-table
11 // activate column, snippet cards and settings toggles.
12 .snippet-activation-switch,
13 input[type='checkbox']='checkbox'].switch {
14 appearance: none;
15 outline: 0;
16 cursor: pointer;
17 margin: 0;
18 inline-size: 36px;
19 block-size: 19px;
20 border-radius: 999px;
21 text-align: start;
22 border: 1px solid var(--cs-color-accent);
23 box-sizing: border-box;
24
25 &::before {
26 transition: all .1s;
27 content: '';
28 block-size: 13px;
29 inline-size: 13px;
30 display: inline-block;
31 background-color: var(--cs-color-accent);
32 border-radius: 50%;
33 margin: 2px;
34
35 @media (prefers-reduced-motion: reduce) {
36 transition-duration: 0.01s;
37 }
38 }
39
40 &:focus {
41 box-shadow: none;
42 }
43
44 &:focus-visible {
45 outline: 2px solid var(--cs-color-accent);
46 }
47 }
48
49 .active-snippet .snippet-activation-switch,
50 input[type='checkbox']='checkbox'].switch:checked {
51 background-color: var(--cs-color-accent);
52
53 // Travel distance: pill width minus the knob, its margins and the borders.
54 &::before {
55 background-color: #fff;
56 transform: translateX(calc((100% + 4px) * var(--cs-direction-multiplier)));
57 }
58 }
59
60 .erroneous-snippet .snippet-activation-switch::before {
61 content: '!';
62 transform: translateX(calc(50% * var(--cs-direction-multiplier)));
63 text-align: center;
64 font-weight: bold;
65 line-height: 1;
66 color: var(--cs-color-text);
67 }
68
69 a.snippet-condition-count {
70 border-radius: 50%;
71 border: 1.8px solid currentcolor;
72 block-size: 29px;
73 inline-size: 29px;
74 display: flex;
75 justify-content: center;
76 align-items: center;
77 box-sizing: border-box;
78
79 .inactive-snippet & {
80 color: var(--cs-color-border);
81 }
82
83 .active-snippet & {
84 font-weight: bold;
85 color: var(--cs-color-accent);
86 }
87 }
88
89 .snippet-execution-button {
90 margin-inline-start: 11px;
91 margin-block-start: 9px;
92 inline-size: 0;
93 block-size: 0;
94 border-block: 9px solid transparent;
95 border-inline-start: 10px solid var(--cs-color-border);
96
97 &::before {
98 content: '';
99 position: absolute;
100 inset-block: -14px;
101 inset-inline: -21px -8px;
102 border-radius: 50%;
103 border: 1.8px solid var(--cs-color-border);
104 z-index: 2;
105 }
106
107 &:hover {
108 border-inline-start-color: var(--cs-color-accent);
109 transition: border-inline-start-color 0.6s;
110
111 &::before {
112 border-color: var(--cs-color-accent);
113 transition: border-color 0.6s;
114 }
115
116 @media (prefers-reduced-motion: reduce) {
117 transition-duration: 0.01s;
118
119 &::before {
120 transition-duration: 0.01s;
121 }
122 }
123 }
124 }
125
126 .code-snippets-card .snippet-execution-button {
127 margin-block-start: 0;
128 margin-inline-end: 9px;
129 }
130