Spaces:
Sleeping
Sleeping
Commit ·
de84dc6
1
Parent(s): d0c65cb
Remove the dropzone's cream background entirely
Browse filesShrinking the box still left a full-width tinted rectangle around the upload
control. Drop its background, border and padding so only the upload button and
the chosen file show. The tint came from the theme's secondaryBackgroundColor,
which expanders also use, so this is scoped to the dropzone rather than changed
in config.toml.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -220,14 +220,19 @@ st.markdown(
|
|
| 220 |
the padding so the box is the size of what it holds. The dropzone's test
|
| 221 |
id was renamed between Streamlit versions, so both spellings are matched
|
| 222 |
and whichever one is absent costs nothing. */
|
| 223 |
-
/*
|
| 224 |
-
|
| 225 |
-
overriding it: it is a <section>, not a
|
| 226 |
-
injected at render time, so !important is
|
| 227 |
-
changed across versions, so match on the
|
|
|
|
|
|
|
|
|
|
| 228 |
[data-testid="stFileUploaderDropzone"] {
|
|
|
|
|
|
|
| 229 |
min-height: 0 !important;
|
| 230 |
-
padding:
|
| 231 |
gap: .7rem !important;
|
| 232 |
align-items: center !important;
|
| 233 |
}
|
|
|
|
| 220 |
the padding so the box is the size of what it holds. The dropzone's test
|
| 221 |
id was renamed between Streamlit versions, so both spellings are matched
|
| 222 |
and whichever one is absent costs nothing. */
|
| 223 |
+
/* Strip the dropzone's cream slab entirely: no background, no border, no
|
| 224 |
+
padding, so what shows is the upload button and, once chosen, the file
|
| 225 |
+
itself. Three things matter when overriding it: it is a <section>, not a
|
| 226 |
+
<div>; its emotion styles are injected at render time, so !important is
|
| 227 |
+
needed to win; and the tag has changed across versions, so match on the
|
| 228 |
+
test id alone. The backgroundColor it used is the theme's
|
| 229 |
+
secondaryBackgroundColor, which expanders still use, so this is scoped to
|
| 230 |
+
the dropzone rather than changed in config.toml. */
|
| 231 |
[data-testid="stFileUploaderDropzone"] {
|
| 232 |
+
background: transparent !important;
|
| 233 |
+
border: none !important;
|
| 234 |
min-height: 0 !important;
|
| 235 |
+
padding: 0 !important;
|
| 236 |
gap: .7rem !important;
|
| 237 |
align-items: center !important;
|
| 238 |
}
|