Skip to content

Commit baf295c

Browse files
committed
more CSS stuff
1 parent 3bf6c3b commit baf295c

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

packages/site-kit/src/lib/components/Text.svelte

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
position: absolute;
6262
top: 0;
6363
height: var(--height);
64+
padding: 0.3rem;
6465
6566
&:has(.filename) {
6667
position: relative;
@@ -78,10 +79,53 @@
7879
color: var(--sk-text-2);
7980
}
8081
82+
.ts-toggle {
83+
appearance: none;
84+
display: flex;
85+
align-items: center;
86+
height: calc(var(--height) - 0.6rem);
87+
outline-offset: 0;
88+
border-radius: var(--sk-border-radius);
89+
padding: 0 0.4rem;
90+
91+
&::before,
92+
&::after {
93+
width: 2rem;
94+
display: flex;
95+
justify-content: center;
96+
align-items: center;
97+
font-size: 1.2rem;
98+
font-weight: 600;
99+
font-family: var(--sk-font-mono);
100+
}
101+
102+
&::before {
103+
content: 'JS';
104+
opacity: 0.8;
105+
}
106+
107+
&::after {
108+
content: 'TS';
109+
border-left: none;
110+
opacity: 0.2;
111+
}
112+
113+
&:checked {
114+
&::before {
115+
opacity: 0.2;
116+
}
117+
118+
&::after {
119+
opacity: 0.8;
120+
}
121+
}
122+
}
123+
81124
.copy-to-clipboard {
82-
height: var(--height);
125+
height: calc(var(--height) - 0.6rem);
83126
aspect-ratio: 1;
84127
background: url(../icons/copy-to-clipboard-empty-light.svg) no-repeat 50% 50% / 2rem 2rem;
128+
border-radius: var(--sk-border-radius);
85129
}
86130
}
87131

packages/site-kit/src/lib/markdown/renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export async function render_content_markdown(
163163
}
164164

165165
if (converted) {
166-
html += `<input class="ts-toggle" type="checkbox">`;
166+
html += `<input class="ts-toggle" type="checkbox" aria-label="Toggle JS/TS">`;
167167
}
168168

169169
if (options.copy) {

0 commit comments

Comments
 (0)