-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrySeparator.html
68 lines (51 loc) · 1.94 KB
/
TrySeparator.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
:root {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Helvetica Neue", "sans-serif";
}
.separator {
display: grid;
grid-template-columns: auto max-content auto;
grid-column-gap: .5em;
/* chrome, ff, not on safari*/
/*background: linear-gradient(black 50%, lightcyan);*/
/*-webkit-background-clip: text;*/
/*-webkit-text-fill-color: transparent;*/
}
.separator::before, .separator::after {
content: " ";
background-image: linear-gradient(transparent 47%, blue 47%, blue 47%, transparent 53% );
/* drop shadow on clip works in safari only */
/* it appears this due to the sequence of filtering/clipping */
filter: drop-shadow(0 0 2px cyan);
}
.separator::before {
/* chrome, ff, not on safari*/
/*background-image: linear-gradient(90deg, blue 60%, black );*/
/*clip-path: polygon(0% 50%, calc(100% - .5em) 45%, calc(100% - .5em) 55%);*/
}
.separator::after {
/*background-image: linear-gradient(90deg, black, blue 40%);*/
/*clip-path: polygon( .5em 45%, 100% 50%, .5em 55%);*/
}
</style>
</head>
<body>
<main>
<p>Layouting pseudo elements like flex/grid children works in all major browsers.</p>
<p>There are a number of things that you cannot in a pseudo element, e.g. using "em".</p>
<h1 class="separator">Section separator</h1>
<p>Clip path on pseudo elements work in chrome and firefox but not in safari.</p>
<h2 class="separator">Section separator </h2>
<p>Selective filters on pseudo elements works in safari but not in chrome and firefox.
</p>
</main>
</body>
</html>