CSS: file-drop
.instui-file-drop — Egy fájl lehozási zóna lebegtetés, elfogadott és elutasított állapotokkal.
Forrás: file-drop.css
Akadálymentesség
Csomagoljon egy natív <input type="file">-t a <label> lehozási zónában, hogy valódi, címkézett fájl vezérlő maradjon, amelyet a billentyűzet és a kisegítő lehetőségek kezelhetnek.
Használat
css
@import "@pantoken/components/components.css";
@import "@pantoken/components/file-drop.css";Példák
html
<label class="instui-file-drop" id="fd">
<span class="instui-icon -icon-cloud-upload"></span>
<div class="instui-text"><strong>Drag an image here</strong>, or click to browse.</div>
<div class="instui-text -size-sm instui-fg-muted" id="fd-msg">PNG or JPG up to 5 MB.</div>
<input type="file" id="fd-input">
</label>Felépítés
text
.instui-file-drop
[class*="-icon-"] (0..1)
text (component)
strong
text (component)
inputflowchart TD
n0[".instui-file-drop"]:::cssdoc-root
n1("[class*="-icon-"]"):::cssdoc-part
n2(["text"]):::cssdoc-component
n3("strong"):::cssdoc-part
n4(["text"]):::cssdoc-component
n5("input"):::cssdoc-part
n0 -.->|0..1| n1
n2 --> n3
n0 --> n2
n0 --> n4
n0 --> n5
click n2 "/api/css/text.md"
click n4 "/api/css/text.md"
classDef cssdoc-root stroke-width:1px;
classDef cssdoc-part stroke-width:1px;
classDef cssdoc-slot stroke-width:1px;
classDef cssdoc-component stroke-width:1px;
Módosítók
| Módosító | Leírás |
|---|---|
.-accepted | Húzás állapota egy elfogadható fájlhoz. |
.-hover | Lebegtetés vagy húzás-fölött állapot. |
.-icon-* | A vezető lehozási zóna glyfa ikon megjelenítése. |
.-rejected | Húzás állapota egy elutasított fájlhoz. |
Felhasznált tokenek
| Token | Típus | Érték |
|---|---|---|
--instui-color-text-base | <color> | light-dark(#273540, #F2F4F5)LightDark |
--instui-component-file-drop-accepted-color | <color> | light-dark(#1D354F, #EEF4FD)LightDark |
--instui-component-file-drop-background-color | <color> | light-dark(#ffffff, #1C222B)LightDark |
--instui-component-file-drop-border-color | <color> | light-dark(#7E8792, #5F6E7A)LightDark |
--instui-component-file-drop-border-radius | <length> | 1rem |
--instui-component-file-drop-border-style | none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset | dashed |
--instui-component-file-drop-border-width | <length> | 0.0625rem |
--instui-component-file-drop-hover-border-color | <color> | light-dark(#1D354F, #EEF4FD)LightDark |
--instui-component-file-drop-rejected-color | <color> | light-dark(#CF1F24, #F56050)LightDark |
--instui-spacing-space-lg | <length> | 1rem |