Skip to content

Commit 28722fa

Browse files
authored
uppy.io/examples - stop css from affecting uppy (#266)
1 parent 07dc9cc commit 28722fa

File tree

2 files changed

+51
-56
lines changed

2 files changed

+51
-56
lines changed

src/pages/examples.module.css

+40-47
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,26 @@
33
margin: 4rem auto;
44
padding: 0 1rem;
55
}
6-
7-
.main h1 {
6+
.h1 {
87
font-size: 3rem;
98
}
10-
11-
.main h3 {
9+
.h3 {
1210
font-size: 1rem;
1311
font-family: var(--ifm-font-family-base);
1412
}
1513

16-
.main section {
14+
.dashboard-docs-stackblitz {
15+
display: flex;
16+
align-items: baseline;
17+
gap: 1rem;
18+
margin-top: 2rem;
19+
}
20+
.dashboard-docs-stackblitz h2,
21+
.dashboard-docs-stackblitz p {
22+
margin-bottom: 0.5rem;
23+
}
24+
25+
.options-and-uppy {
1726
position: relative;
1827
border-radius: 5px;
1928
margin-bottom: 1rem;
@@ -23,21 +32,33 @@
2332
rgba(0, 0, 0, 0.1) 0px 4px 6px -1px,
2433
rgba(0, 0, 0, 0.1) 0px 2px 4px -2px;
2534
}
26-
27-
.main input[type='checkbox'] {
35+
.options {
36+
display: grid;
37+
grid-template-columns: repeat(2, minmax(0, 1fr));
38+
gap: 1rem;
39+
min-height: 500px;
40+
max-width: 30rem;
41+
border-radius: 5px;
42+
padding: 1rem;
43+
}
44+
.options input[type='checkbox'] {
2845
accent-color: #f37;
46+
margin-right: 5px;
47+
margin-left: 0;
2948
}
30-
31-
.main input[type='checkbox']:not(:checked, :disabled):hover + label {
49+
.options-inner > div {
50+
display: flexl;
51+
align-items: center;
52+
margin: 0.25rem 0;
53+
}
54+
.options input[type='checkbox']:not(:checked, :disabled):hover + label {
3255
color: black;
3356
}
34-
35-
.main input[type='checkbox']:disabled:hover,
36-
.main input[type='checkbox']:disabled:hover + label {
57+
.options input[type='checkbox']:disabled:hover,
58+
.options input[type='checkbox']:disabled:hover + label {
3759
cursor: not-allowed;
3860
}
39-
40-
.main select {
61+
.options select {
4162
grid-column: 1 / 3;
4263
background: white;
4364
padding: 0.2rem 1rem;
@@ -46,32 +67,9 @@
4667
border-radius: 5px;
4768
}
4869

49-
.header {
50-
display: flex;
51-
align-items: baseline;
52-
gap: 1rem;
53-
margin-top: 2rem;
54-
}
55-
56-
.header h2,
57-
.header p {
58-
margin-bottom: 0.5rem;
59-
}
60-
61-
.options {
62-
display: grid;
63-
grid-template-columns: repeat(2, minmax(0, 1fr));
64-
gap: 1rem;
65-
min-height: 500px;
66-
max-width: 30rem;
67-
border-radius: 5px;
68-
padding: 1rem;
69-
}
70-
71-
.options-wrapper > div {
72-
display: flexl;
73-
align-items: center;
74-
margin: 0.25rem 0;
70+
.dashboard-inner {
71+
position: relative;
72+
z-index: 1;
7573
}
7674

7775
@media screen and (min-width: 60rem) {
@@ -86,17 +84,12 @@
8684
.options > div:first-of-type {
8785
grid-column: 1 / 3;
8886
}
89-
.options-wrapper[wrapper-for='Remote sources'] {
87+
.options-inner[wrapper-for='Remote sources'] {
9088
display: grid;
9189
grid-template-columns: repeat(2, minmax(0, 1fr));
9290
}
93-
.main > section {
91+
.options-and-uppy {
9492
display: grid;
9593
grid-template-columns: minmax(20rem, 1fr) 2fr;
9694
}
9795
}
98-
99-
.dashboard-inner {
100-
position: relative;
101-
z-index: 1;
102-
}

src/pages/examples.tsx

+11-9
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,12 @@ function Page() {
290290

291291
return (
292292
<Layout>
293-
<main className={styles.main}>
294-
<Heading as="h1">Examples</Heading>
293+
<main className={styles['main']}>
294+
<Heading className={styles['h1']} as="h1">
295+
Examples
296+
</Heading>
295297

296-
<div className={styles.header}>
298+
<div className={styles['dashboard-docs-stackblitz']}>
297299
<Heading as="h2">Dashboard</Heading>
298300
<p>
299301
<Link to="/docs/dashboard">Docs</Link>{' '}
@@ -311,24 +313,24 @@ function Page() {
311313
previews and upload progress, lets you edit metadata, and unites
312314
acquire plugins, such as Google Drive and Webcam, under one roof.
313315
</p>
314-
<section>
315-
<div className={styles.options}>
316+
<section className={styles['options-and-uppy']}>
317+
<div className={styles['options']}>
316318
{options.map((section) => {
317319
return (
318320
<div key={section.heading}>
319-
<Heading as="h3">{section.heading}</Heading>
321+
<Heading className={styles['h3']} as="h3">
322+
{section.heading}
323+
</Heading>
320324
<div
321325
wrapper-for={section.heading}
322-
className={styles['options-wrapper']}
326+
className={styles['options-inner']}
323327
>
324328
{section.options.map(
325329
({ label, value, type, disabled, title }) => (
326330
<div key={label}>
327331
<input
328332
type="checkbox"
329333
id={label}
330-
className={styles['framework-input']}
331-
name="framework"
332334
value={type}
333335
title={title}
334336
checked={

0 commit comments

Comments
 (0)