-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
191 lines (164 loc) · 5.82 KB
/
Copy pathindex.html
File metadata and controls
191 lines (164 loc) · 5.82 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
<!DOCTYPE html>
<html lang="en" style="color-scheme: light dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Demo of slide-deck Web Component" />
<title>Browser-Support Web Component Demo</title>
<style>
@layer reset, props, base;
not-browser-support {
border: medium solid gray;
border-radius: 0.5em;
background: Canvas;
color: CanvasText;
display: grid;
gap: 0.5lh;
padding: 1em 0.5lh;
> * { margin: unset; }
}
@layer base {
html {
font-family: var(--serif);
color-scheme: light dark;
}
body {
font-size: var(--text-normal);
padding: var(--gap);
}
code:not(pre *) {
background: linear-gradient(
-80deg,
transparent 0.5ch,
var(--pink-bg) 0.5ch calc(100% - 0.5ch),
transparent calc(100% - 0.5ch)
) no-repeat 0 1ex;
text-shadow: 2px 2px 0 Canvas;
}
}
@layer props {
html {
--pink-dark-: #B6236C;
--pink-light-: #FE84B4;
--blue-dark-: #205769;
--blue-light-: #8EC6DA;
--pink: light-dark(var(--pink-dark-), var(--pink-light-));
--pink-bg: color-mix(in oklab,
light-dark(var(--pink-light-), var(--pink-dark-)),
Canvas
);
--blue: light-dark(var(--blue-dark-), var(--blue-light-));
--blue-bg: color-mix(in oklab,
light-dark(var(--blue-light-), var(--blue-dark-)),
Canvas
);
@supports not (fill: color-mix(in hsl, light-dark(red, red), red)) {
--pink: var(--pink-dark-);
--blue: var(--blue-dark-);
--pink-bg: var(--pink-light-);
--blue-bg: var(--blue-light-);
@media (prefers-color-scheme: dark) {
--pink: var(--pink-light-);
--blue: var(--blue-light-);
--pink-bg: var(--pink-dark-);
--blue-bg: var(--blue-dark-);
}
}
/* from https://modernfontstacks.com/ */
/* old style, industrial, slab */
--serif: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
--sans: Bahnschrift, 'DIN Alternate', 'Franklin Gothic Medium', 'Nimbus Sans Narrow', sans-serif-condensed, sans-serif;
--slab: Rockwell, 'Rockwell Nova', 'Roboto Slab', 'DejaVu Serif', 'Sitka Small', serif;
}
body {
--text-small: clamp(0.938rem, 0.824rem + 0.568cqi, 1.25rem);
--text-normal: clamp(1.25rem, 1.023rem + 1.136cqi, 1.875rem);
--text-large: clamp(1.35rem, 0.818rem + 2.659cqi, 2.813rem);
--text-xlarge: clamp(1.7rem, 0.784rem + 4.58cqi, 4.219rem);
--gap: clamp(2cqi, 0.5lh, 5cqi);
}
}
@layer reset {
* { box-sizing: border-box; }
html { block-size: 100%; }
body { margin: unset; }
h1, h2, h3, h4, h5, h6 {
text-wrap: balance;
}
p, li {
text-wrap: pretty;
}
picture { display: contents; }
img { display: block; }
img,
svg {
max-inline-size: 100%;
block-size: auto;
}
input,
button,
textarea,
select {
font: inherit;
}
pre {
max-inline-size: 100%;
overflow: auto;
border: thin solid;
> code {
display: block;
padding: 1em;
}
}
}
</style>
<script type="module" src="browser-support.js"></script>
</head>
<body>
<h1>A browser-support component</h1>
<p>
Using the web platform features data behind MDN & Baseline,
along with some of the Baseline language and icons.
I imagine there are a lot of improvements
that could be made here,
and I'd be very glad for
<a href="https://github.com/oddbird/browser-support/issues">
suggestions and improvements</a>!
</p>
<ul>
<li>Stand-alone component, without Lit or other frameworks</li>
<li>Responsive to font sizes, available space, and light/dark schemes</li>
<li>Allows customization of the title markup (<code>h2</code> by default)</li>
<li>'Newly supported' web features show a timeline towards broad support</li>
<li>Allows for simple light-dom fallback & progressive enhancement</li>
</ul>
<browser-support data-feature="container-queries"></browser-support>
<browser-support data-feature="container-style-queries"></browser-support>
<browser-support data-feature="relative-color"></browser-support>
<h2>Progressive Enhancement</h2>
<pre><code><browser-support>
<h3 slot="title">CSS Grid Layout</h3>
<a href="https://web-platform-dx.github.io/web-features-explorer/features/grid/">
Browser support for CSS <code>grid</code> layout
</a>
</browser-support></code></pre>
<not-browser-support>
<h3 slot="title">CSS Grid Layout</h3>
<a href="https://web-platform-dx.github.io/web-features-explorer/features/grid/">
Browser support for CSS <code>grid</code> layout
</a>
</not-browser-support>
<browser-support>
<h3 slot="title">CSS Grid Layout</h3>
<a href="https://web-platform-dx.github.io/web-features-explorer/features/grid/">
Browser support for CSS <code>grid</code> layout
</a>
</browser-support>
<browser-support>
<h3 slot="title">The <code>:fake()</code> selector</h3>
<a href="https://web-platform-dx.github.io/web-features-explorer/features/fake/">
Browser support for the <code>:fake</code> selector
</a>
</browser-support>
</body>
</html>