-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIf-function.html
More file actions
56 lines (51 loc) · 1.47 KB
/
Copy pathIf-function.html
File metadata and controls
56 lines (51 loc) · 1.47 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
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>If Function</title>
<style>
/* :root {
--color: black;
}
body {
background: grey;
} */
#box {
/* color: var(--color);
background-color: if(style(--color: white): black; else: white); */
width: 300px;
height: 300px;
padding: if(media(width >= 768px): 2rem; else: 1rem);
border: 1px solid #000;
}
/* body {
background-color: if(
supports(color: oklch(0.7 0.185 232)): oklch(0.7 0.185 232) ;
else: red;
);
}
body::after {
content: if(
supports(color: oklch(0.7 0.185 232)): "Your browser supports OKLCH" ;
else: "Your browser does not supports OKLCH" ;
);
} */
h1 {
font-size: if(
media(width >= 1200px): 3rem; media(width >= 768px): 2.5rem;
media(width >= 480px): 2rem; else: 1.75rem
);
}
</style>
</head>
<body>
<h1>If() Function</h1>
<div id="box">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit
laudantium suscipit nihil tenetur neque libero fugiat cumque veniam totam
deserunt maiores iste asperiores sequi culpa ullam voluptate, aperiam,
incidunt maxime?
</div>
</body>
</html>