-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
117 lines (102 loc) · 2.63 KB
/
index.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
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
<!DOCTYPE html>
<html>
<head>
<title>Safari Theme Preview</title>
<meta charset="UTF-8">
<meta name="description" content="An example of prefers-color-scheme that works on Safari Preview">
<meta name="keywords" content="Safari Preview, Safari, prefers-color-scheme, CSS">
<meta name="author" content="Seth Corker">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: whitesmoke;
display: grid;
grid-template-rows: repeat(3, 1fr);
grid-template-columns: repeat(4, 1fr);
height: 100vh;
box-sizing: border-box;
margin: 0;
width: 100vw;
align-items: center;
justify-items: baseline;
font-family: -apple-system, sans-serif;
}
.title {
color: midnightblue;
grid-column: 2;
grid-row: 2;
font-size: 6em;
margin: 1rem 4rem;
}
.indicator {
border-color: midnightblue;
width: 5rem;
height: 5rem;
}
.indicator.left {
border-left-style: solid;
border-left-width: 0.5rem;
}
.indicator.top {
border-top-style: solid;
border-top-width: 0.5rem;
}
.indicator.right {
border-right-style: solid;
border-right-width: 0.5rem;
}
.indicator.bottom {
border-bottom-style: solid;
border-bottom-width: 0.5rem;
}
.indicator.top.left {
grid-column: 3;
grid-row: 3;
align-self: flex-start;
}
.indicator.bottom.right {
grid-column: 1;
grid-row: 1;
align-self: flex-end;
justify-self: end;
}
.info {
color:lightslategray;
grid-column: 4;
grid-row: 2;
width: 90%;
font-size: 1.35em;
margin-left: -35%;
}
.highlight {
color:darkslateblue;
}
@media (prefers-color-scheme: dark) {
body {
background-color: midnightblue;
}
.title {
color: whitesmoke;
}
.indicator {
border-color: whitesmoke;
}
.info {
color:aliceblue;
}
.highlight {
color:coral;
}
}
</style>
</head>
<body>
<h1 class="title">Hello Theming</h1>
<div class="indicator right bottom"></div>
<div class="indicator top left"></div>
<aside class="info">
Using <code class="highlight">prefers-color-scheme</code> media query in <nobr>Safari Preview</nobr> to adapt the
page styling based on user's theme.
</aside>
</body>
</html>