-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.html
More file actions
executable file
·212 lines (205 loc) · 7.39 KB
/
Copy pathbutton.html
File metadata and controls
executable file
·212 lines (205 loc) · 7.39 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="data:,">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Accesserty UI Kit Button</title>
<link rel="stylesheet" href="../src/css/au-style.css" />
<link rel="stylesheet" href="demo.css" />
</head>
<body>
<header><a href="../demo/index.html" title="go to home page">Home</a></header>
<main>
<h1>
Accesserty UI Kit Button
</h1>
<section>
<h2>We recommand using original button</h2>
<p>Creating a button as a web component, I've found, does not offer significant benefits. The majority of changes
involved with buttons concern their appearance, which can be effectively handled with CSS. Additionally,
creating a web component requires attention to callbacks, attribute inheritance, and incorporating images within
buttons, along with writing unit tests. It is only worthwhile to develop such components if many special
functionalities are added. As a basic component, if it needs to be complex in design, it is typically used as
the basis for developing another component.</p>
<p>Therefore, <b>I do not recommend developing or using a Web Component for buttons.</b> Adhering to the principle
that what can be solved with native HTML should be handled natively is best. If you're only looking to provide a
different appearance, writing CSS is sufficient.</p>
<p>Additionally, there is a button with a background pattern in the example, which I learned from studying data
visualization accessibility. The intent is to ensure buttons are not solely distinguished by color, which can be
problematic for those with visual impairments. I believe this approach aids accessibility, but it has not yet
been practically tested. If you are considering using this method, please evaluate its suitability carefully, as
the intensity and shape of the patterns could also cause visual discomfort.</p>
</section>
<section>
<h2>Size</h2>
<button data-size="small">Small</button>
<button>Medium(Default)</button>
<button data-size="large">Large</button>
</section>
<section>
<h2>Custom</h2>
<button data-size="small" class="custom-btn--primary-outline">Small</button>
<button class="custom-btn--primary-outline">Medium(Default)</button>
<button data-size="large" class="custom-btn--primary-outline">Large</button>
</section>
<section>
<h2>A11Y</h2>
<button data-size="small" class="custom-btn--primary-flat a11y">Small</button>
<button class="custom-btn--primary-flat a11y">Medium(Default)</button>
<button data-size="large" class="custom-btn--primary-flat a11y">Large</button>
</section>
<section>
<h2>CSS Variables</h2>
<table>
<tr>
<th scope="col">CSS Variables name</th>
<th scope="col">Description</th>
<th scope="col">Default value</th>
</tr>
<tr>
<td>--au-btn-padding-vertical</td>
<td>padding-top and padding-bottom</td>
<td>0.625rem</td>
</tr>
<tr>
<td>--au-btn-padding-horizontal</td>
<td>padding-left and padding-right</td>
<td>1rem</td>
</tr>
<tr>
<td>--au-btn-text-color</td>
<td>text color</td>
<td>oklch(0.1398 0 0)</td>
</tr>
<tr>
<td>--au-btn-text-size</td>
<td>font size</td>
<td>1rem</td>
</tr>
<tr>
<td>--au-btn-text-family</td>
<td>font family</td>
<td>--</td>
</tr>
<tr>
<td>--au-btn-text-line-height</td>
<td>font line height</td>
<td>1.5</td>
</tr>
<tr>
<td>--au-btn-border-width</td>
<td>border width</td>
<td>1px</td>
</tr>
<tr>
<td>--au-btn-border-style</td>
<td>border style</td>
<td>solid</td>
</tr>
<tr>
<td>--au-btn-border-color</td>
<td>border color</td>
<td>oklch(0.55 0 0)</td>
</tr>
<tr>
<td>--au-btn-border-radius</td>
<td>border radius</td>
<td>0</td>
</tr>
<tr>
<td>--au-btn-bg</td>
<td>background color</td>
<td>oklch(0.994 0 0)</td>
</tr>
<tr>
<td>--au-btn-small-padding-vertical</td>
<td>padding-top and padding-bottom at small size</td>
<td>0.25rem</td>
</tr>
<tr>
<td>--au-btn-small-padding-horizontal</td>
<td>padding-left and padding-right at small size</td>
<td>0.375rem</td>
</tr>
<tr>
<td>--au-btn-large-padding-vertical</td>
<td>padding-top and padding-bottom at large size</td>
<td>1rem</td>
</tr>
<tr>
<td>--au-btn-large-padding-horizontal</td>
<td>padding-left and padding-right at large size</td>
<td>1.625rem</td>
</tr>
<tr>
<td>--au-btn-large-text-size</td>
<td>font size at large size</td>
<td>1.25rem</td>
</tr>
<tr>
<td>--au-btn-hover-bg</td>
<td>background color (hover)</td>
<td>oklch(0.9466 0 0)</td>
</tr>
<tr>
<td>--au-btn-hover-border-color</td>
<td>border color (hover)</td>
<td>oklch(0.55 0 0)</td>
</tr>
<tr>
<td>--au-btn-active-bg</td>
<td>background color (active)</td>
<td>oklch(0.8689 0 0)</td>
</tr>
<tr>
<td>--au-btn-active-border-color</td>
<td>border color (active)</td>
<td>oklch(0.55 0 0)</td>
</tr>
<tr>
<td>--au-btn-focus-shadow-width</td>
<td>focus border width(actually box-shadow)</td>
<td>3px</td>
</tr>
<tr><td>--au-btn-focus-outline-color</td><td>Keyboard focus outline color</td><td>oklch(0.45 0.15 260)</td></tr>
<tr><td>--au-btn-focus-outline-width</td><td>Keyboard focus outline width (minimum 2px)</td><td>2px</td></tr>
<tr>
<td>--au-btn-focus-shadow-color</td>
<td>Decorative inset shadow; the focus outline above is the indicator</td>
<td>oklch(0.8315 0.15681888825079074 78.05241467152487)</td>
</tr>
<tr>
<td>--au-btn-a11y-text-shadow</td>
<td>enhance button, using text shadow</td>
<td>none</td>
</tr>
<tr>
<td>--au-btn-a11y-bg-image</td>
<td>enhance button, using a background image</td>
<td>none</td>
</tr>
<tr>
<td>--au-btn-a11y-bg-size</td>
<td>enhance button, adjust size of background image</td>
<td>1.5rem 1.5rem</td>
</tr>
<tr>
<td>--au-btn-a11y-bg-position</td>
<td>enhance button, adjust position of background image</td>
<td>center center</td>
</tr>
<tr>
<td>--au-btn-a11y-hover-bg-image</td>
<td>enhance button, using a background image(hover)</td>
<td>none</td>
</tr>
<tr>
<td>--au-btn-a11y-active-bg-image</td>
<td>enhance button, using a background image(active)</td>
<td>none</td>
</tr>
</table>
</section>
</body>
</html>