File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 8
8
display : block;
9
9
text-align : center;
10
10
border : 4px dashed lightgrey;
11
- height : 200px ;
12
- line-height : 200px ;
11
+ padding : 100px ;
13
12
font-family : sans-serif;
14
- font-size : 1.5em ;
15
13
}
16
14
file-attachment [hover ] {
17
15
border-color : gold;
18
16
}
17
+ input {
18
+ font-size : inherit;
19
+ }
19
20
</ style >
20
21
</ head >
21
22
< body >
22
- < file-attachment >
23
- Drop files here
23
+ < file-attachment input ="file ">
24
+ Drop files here or
25
+ < input type ="file " id ="file " multiple >
26
+ < pre > </ pre >
24
27
</ file-attachment >
25
28
26
29
<!-- GitHub Pages development script, uncomment when running example locally and comment out the production one -->
30
33
< script type ="module " src ="https://unpkg.com/@github/file-attachment-element@latest/dist/index.js "> </ script >
31
34
32
35
< script >
33
- const attach = document . querySelector ( 'file-attachment ' )
34
- attach . addEventListener ( 'file-attachment-accepted' , function ( event ) {
36
+ const pre = document . querySelector ( 'pre ' )
37
+ document . addEventListener ( 'file-attachment-accepted' , function ( event ) {
35
38
const { attachments} = event . detail
36
- attach . textContent = attachments . map ( a => a . file . name ) . join ( ', ' )
39
+ pre . textContent = attachments . map ( a => a . file . name ) . join ( '\n ' )
37
40
} )
38
41
</ script >
39
42
</ body >
You can’t perform that action at this time.
0 commit comments