PluginProbe
Code Snippets / 3.10.0
Code Snippets v3.10.0
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 3.0.1 All 64 releases
code-snippets / css / common / _switch.scss

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

121 lines 2.4 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: 34px;
21 text-align: start;
22 border: 1px solid theme.$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: theme.$accent;
32 border-radius: 50%;
33 margin: 2px;
34
35 @media (prefers-reduced-motion: reduce) {
36 transition-duration: 0.01s;
37 }
38 }
39 }
40
41 .active-snippet .snippet-activation-switch,
42 input[type='checkbox']='checkbox'].switch:checked {
43 background-color: theme.$accent;
44
45 // Travel distance: pill width minus the knob, its margins and the borders.
46 &::before {
47 background-color: white;
48 transform: translateX(calc((100% + 4px) * var(--cs-direction-multiplier)));
49 }
50 }
51
52 .erroneous-snippet .snippet-activation-switch::before {
53 content: '!';
54 transform: translateX(calc(50% * var(--cs-direction-multiplier)));
55 text-align: center;
56 font-weight: bold;
57 line-height: 1;
58 color: #1d2327;
59 }
60
61 a.snippet-condition-count {
62 border-radius: 50%;
63 border: 1.8px solid currentcolor;
64 block-size: 29px;
65 inline-size: 29px;
66 display: flex;
67 justify-content: center;
68 align-items: center;
69 box-sizing: border-box;
70
71 .inactive-snippet & {
72 color: #ccc;
73 }
74
75 .active-snippet & {
76 font-weight: bold;
77 color: theme.$accent;
78 }
79 }
80
81 .snippet-execution-button {
82 margin-inline-start: 11px;
83 margin-block-start: 9px;
84 inline-size: 0;
85 block-size: 0;
86 border-block: 9px solid transparent;
87 border-inline-start: 10px solid #ccc;
88
89 &::before {
90 content: '';
91 position: absolute;
92 inset: -14px -8px -14px -21px;
93 border-radius: 50%;
94 border: 1.8px solid #ccc;
95 z-index: 2;
96 }
97
98 &:hover {
99 border-inline-start-color: theme.$accent;
100 transition: border-inline-start-color 0.6s;
101
102 &::before {
103 border-color: theme.$accent;
104 transition: border-color 0.6s;
105 }
106
107 @media (prefers-reduced-motion: reduce) {
108 transition-duration: 0.01s;
109
110 &::before {
111 transition-duration: 0.01s;
112 }
113 }
114 }
115 }
116
117 .code-snippets-card .snippet-execution-button {
118 margin-block-start: 0;
119 margin-inline-end: 9px;
120 }
121