Skip to content

Commit ec93b1c

Browse files
committed
book/super-example: update styling
* Reduce padding. * Make corners square. * Make copy button fully opaque when visible.
1 parent 5cb0058 commit ec93b1c

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

book/copy-button/copy-button.css

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
pre:has(> code),
22
.editor {
33
position: relative;
4-
&:hover,
5-
&:focus-within {
6-
& .copy-button {
7-
opacity: 0.3;
8-
}
9-
}
104
}
115

126
.copy-button {
137
align-items: center;
14-
background: none;
8+
background-color: var(--bg);
159
border-color: var(--fg);
16-
border-radius: 4px;
1710
border-style: solid;
1811
border-width: 1px;
1912
color: var(--fg);
@@ -29,10 +22,10 @@ pre:has(> code),
2922
padding-inline: 0.3em;
3023
padding: 0.5em 1em;
3124
position: absolute;
32-
right: clamp(0.875rem, 0.8487rem + 0.1316vi, 0.9375rem);
25+
right: 0.5em;
3326
text-decoration: none;
3427
text-transform: uppercase;
35-
top: clamp(0.5625rem, 0.5362rem + 0.1316vi, 0.625rem);
28+
top: 0.5em;
3629
transition-duration: 300ms;
3730
white-space: nowrap;
3831

@@ -47,9 +40,6 @@ pre:has(> code),
4740
}
4841

4942
&[aria-pressed='true'] {
50-
background-color: var(--bg);
51-
border-color: var(--bg);
52-
color: var(--fg);
5343
display: block;
5444
opacity: 1;
5545
}

book/super-example/super-example.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
--color-text-code: var(--fg);
55
--color-text-meta: var(--fg);
66
--label-size: 1rem;
7-
--radius: 16px;
87
--space-2xs: clamp(0.5625rem, 0.5362rem + 0.1316vi, 0.625rem);
98
--space-s: clamp(1.125rem, 1.0724rem + 0.2632vi, 1.25rem);
109

@@ -16,7 +15,6 @@
1615
grid-template-areas:
1716
'query query'
1817
'input result';
19-
border-radius: var(--radius);
2018

2119
&[data-layout~='no-labels'] {
2220
label {
@@ -59,7 +57,6 @@
5957
display: grid;
6058
grid-template-columns: minmax(0, 1fr);
6159
grid-template-rows: min-content auto;
62-
padding-block-start: 1em;
6360

6461
& header {
6562
align-items: end;
@@ -93,7 +90,7 @@
9390
overflow: auto;
9491
max-height: 40rem;
9592
scrollbar-color: var(--color-text-meta) var(--color-bg-code);
96-
padding-block: 0.75em;
93+
padding-block: 0.2em;
9794
}
9895

9996
& .cm-selectionBackground {

0 commit comments

Comments
 (0)