-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
demo.html
39 lines (38 loc) · 1.03 KB
/
demo.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Demo of component-name Web Component" />
<title>component-name Web Component Demo</title>
<script type="module" src="component-name.js"></script>
</head>
<body>
<h2>General usage example</h2>
<component-name>
<button>Button</button>
</component-name>
<hr />
<h2>Example using a fallback method</h2>
<component-name>
<button>Button</button>
<a href="#">Anchor</a>
</component-name>
<style>
component-name:not(:defined) button,
component-name:defined a {
display: none;
}
</style>
<hr />
<h2>Example using options or additional fallback method</h2>
<component-name attribute="value">
<button>Button</button>
</component-name>
<style>
component-name[attribute="value"] {
outline: 1px solid red;
}
</style>
</body>
</html>