-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
193 lines (193 loc) · 4.4 KB
/
Copy pathtest.html
File metadata and controls
193 lines (193 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>formalize.css test page</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/axgmc/formalize.css/formalize.full.css" />
<style>
body {
margin: 1em;
}
fieldset {
background-color: #eee;
text-align: right;
margin: auto;
}
dialog {
color: white;
background-color: rgba(0, 0, 128, .75);
top: 0;
margin: 0;
padding: .5em 1.5em;
position: fixed;
}
form.widths {
--formalize-input-width: 50%;
--formalize-button-width: 50%;
}
form.heights {
--formalize-input-height: 32px;
}
form.margins {
--formalize-input-margin: 2px;
}
form.paddings {
--formalize-input-padding: 6px;
--formalize-button-padding: 6px 12px;
}
form.borders {
--formalize-border-color: rgb(192, 192, 192);
--formalize-placeholder-color: rgb(168, 168, 168);
--formalize-border-radius: 5px;
}
</style>
</head>
<body>
<form>
<fieldset>
<div>
<label>Text:</label>
<input type="text" placeholder="placeholder" required />
</div>
<div>
<label>Date<sup>(1)</sup>:</label>
<input type="date" required />
</div>
<div>
<label>Date-time<sup>(2)</sup>:</label>
<input type="datetime" required />
</div>
<div>
<label>Number:</label>
<input type="number" required />
</div>
<div>
<label>Range<sup>(3)</sup>:</label>
<input type="range" required />
</div>
<div>
<label>Color<sup>(4)</sup>:</label>
<input type="color" required />
</div>
<div>
<label>File<sup>(5)</sup>:</label>
<input type="file" required />
</div>
<div>
<label>Month<sup>(6)</sup>:</label>
<input type="month" required />
</div>
<div>
<label>Password:</label>
<input type="password" required />
</div>
<div>
<label>Tel:</label>
<input type="tel" required />
</div>
<div>
<label>Time<sup>(1)</sup>:</label>
<input type="time" required />
</div>
<div>
<label>URL:</label>
<input type="url" required />
</div>
<div>
<label>Week<sup>(6)</sup>:</label>
<input type="week" required />
</div>
<div>
<label>Search:</label>
<input type="search" required />
</div>
<div>
<input type="checkbox" required />
<label>Checkbox</label>
</div>
<div>
<input type="radio" name="A" required />
<label>Radio</label>
</div>
<div>
<input type="radio" style="width: 45px; height: 45px;" name="B" required />
<label>Radio with size</label>
</div>
<div>
<label>Combo<sup>(7,8)</sup>:</label>
<select required>
<optgroup label="Group">
<option>Item 1</option>
<option>Item 2</option>
</optgroup>
</select>
</div>
<div>
<label>Text area:</label>
<textarea rows="4" required></textarea>
</div>
<div>
<button>Button</button>
</div>
<div>
<input type="button" value="Input button" />
</div>
<div>
<input type="image" />
</div>
<div>
<input type="submit" />
</div>
<div>
<input type="reset" />
</div>
</fieldset>
</form>
<footer>
<h3>Known issues</h3>
<ol>
<li>paddings not supported on iPhone (select input)</li>
<li>still not supported by browsers</li>
<li>outline not rounded in Firefox</li>
<li>no tab index in Safari</li>
<li>content not vertically centered when setting height</li>
<li>not supported in Safari and Firefox</li>
<li>paddings and options style not supported on MacOS</li>
<li>fixed border radius in Safari (5px)</li>
</ol>
</footer>
<dialog open>
<h3>Display options</h3>
<p>
<input id="widths" type="checkbox" />
<label for="widths">Fixed widths</label>
</p>
<p>
<input id="heights" type="checkbox" />
<label for="heights">Fixed heights</label>
</p>
<p>
<input id="margins" type="checkbox" />
<label for="margins">Extra margins</label>
</p>
<p>
<input id="paddings" type="checkbox" />
<label for="paddings">Extra paddings</label>
</p>
<p>
<input id="borders" type="checkbox" />
<label for="borders">Nicer borders and placeholders</label>
</p>
</div>
<script>
window.addEventListener('load', _ => {
document.querySelectorAll('dialog input[id]').forEach(i => {
i.addEventListener('click', function () {
document.forms[0].classList.toggle(this.id, this.checked);
});
});
});
</script>
</body>
</html>