Skip to content

Commit c6819c4

Browse files
wlftalistair3149
andauthored
feat(core): ✨ add upload file page styles (#1784)
Co-authored-by: alistair3149 <alistair31494322@gmail.com>
1 parent a4824e6 commit c6819c4

2 files changed

Lines changed: 134 additions & 0 deletions

File tree

skin.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@
995995
"+mediawiki.special.userlogin.common.styles": "skinStyles/mediawiki/special/mediawiki.special.userlogin.common.styles.less",
996996
"+mediawiki.special.userlogin.login.styles": "skinStyles/mediawiki/special/mediawiki.special.userlogin.login.styles.less",
997997
"+mediawiki.special.userlogin.signup.styles": "skinStyles/mediawiki/special/mediawiki.special.userlogin.signup.styles.less",
998+
"+mediawiki.special.upload": "skinStyles/mediawiki/special/mediawiki.special.upload.styles.less",
998999
"+mediawiki.ui": "skinStyles/mediawiki/ui/mediawiki.ui.less",
9991000
"+mediawiki.ui.checkbox": "skinStyles/mediawiki/ui/mediawiki.ui.checkbox.less",
10001001
"+mediawiki.ui.radio": "skinStyles/mediawiki/ui/mediawiki.ui.radio.less",
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
@import '../../../resources/mixins.less';
2+
@import '../../../resources/variables.less';
3+
4+
#mw-upload-form {
5+
fieldset {
6+
border-radius: var( --border-radius-medium );
7+
8+
/* Source field */
9+
&:first-of-type {
10+
display: flex;
11+
flex-wrap: wrap;
12+
gap: var( --space-lg );
13+
padding: var( --space-md );
14+
margin: var( --space-xl ) 0;
15+
color: var( --color-subtle );
16+
}
17+
}
18+
19+
#mw-htmlform-source {
20+
flex-grow: 1;
21+
order: -1;
22+
.mixin-citizen-font-styles( 'small' );
23+
24+
&,
25+
tbody,
26+
tr,
27+
td {
28+
display: block;
29+
}
30+
31+
.mw-htmlform-field-UploadSourceField {
32+
margin-bottom: var( --space-xs );
33+
34+
.mw-label {
35+
display: none;
36+
}
37+
}
38+
}
39+
40+
#wpUploadFile {
41+
/* `align-content` and `text-align-last` are the only levers that reach the UA shadow content:
42+
flex and grid do not, and Blink and WebKit force `text-align: start !important` on file inputs. */
43+
align-content: center;
44+
width: 100%;
45+
height: @size-1600;
46+
color: inherit;
47+
text-align-last: center;
48+
cursor: pointer;
49+
border-style: dashed;
50+
border-radius: var( --border-radius-medium );
51+
52+
&:hover {
53+
background-color: var( --background-color-button-quiet--hover );
54+
}
55+
56+
&:active {
57+
background-color: var( --background-color-button-quiet--active );
58+
}
59+
60+
&::before {
61+
width: @size-250 !important;
62+
height: @size-250 !important;
63+
margin-bottom: var( --space-sm );
64+
content: '';
65+
mask-size: @size-250 !important;
66+
.cdx-mixin-css-icon( @cdx-icon-upload );
67+
}
68+
69+
&::file-selector-button,
70+
&::-webkit-file-upload-button {
71+
display: block;
72+
min-height: @min-size-interactive-pointer;
73+
padding-inline: @spacing-horizontal-button;
74+
margin-inline: auto;
75+
margin-bottom: var( --space-sm );
76+
font-family: inherit;
77+
font-size: var( --font-size-medium );
78+
font-weight: var( --font-weight-semi-bold );
79+
appearance: none;
80+
cursor: pointer;
81+
background: transparent;
82+
border: 1px solid var( --border-color-interactive );
83+
border-radius: var( --border-radius-base );
84+
.mixin-citizen-button-quiet();
85+
}
86+
}
87+
88+
#mw-upload-thumbnail {
89+
margin: 0 auto;
90+
text-align: center;
91+
.mixin-citizen-font-styles( 'small' );
92+
93+
canvas {
94+
border: var( --border-base );
95+
border-radius: var( --border-radius-medium );
96+
}
97+
}
98+
99+
&:has( #mw-upload-thumbnail ) {
100+
#wpUploadFile {
101+
&::before {
102+
.cdx-mixin-css-icon( @cdx-icon-success, @color-success );
103+
}
104+
}
105+
}
106+
107+
#mw-upload-permitted > p {
108+
margin: 0;
109+
}
110+
111+
.mw-htmlform-field-HTMLCheckField .mw-input * {
112+
cursor: pointer;
113+
}
114+
115+
input#wpDestFile,
116+
textarea,
117+
select#wpLicense {
118+
font-family: inherit;
119+
.mixin-citizen-cdx-input();
120+
}
121+
122+
input[ name='wpUpload' ] {
123+
width: 100%;
124+
min-height: @min-size-interactive-touch;
125+
padding-inline: @spacing-horizontal-button;
126+
font-size: var( --font-size-medium );
127+
font-weight: var( --font-weight-semi-bold );
128+
cursor: pointer;
129+
border: 1px solid transparent;
130+
border-radius: var( --border-radius-base );
131+
.mixin-citizen-button-progressive();
132+
}
133+
}

0 commit comments

Comments
 (0)