UNPKG

1.86 kBCSSView Raw
1body {
2 font-family: monospace;
3 height: 100vh;
4 width: 100vw;
5 text-align: center;
6 padding: 0;
7 margin: 0;
8}
9
10p {
11 max-width: 660px;
12 margin: 0 auto;
13 font-weight: 300;
14 font-size: 1.2rem;
15 line-height: 1.5;
16 text-align: left;
17}
18
19h1 {
20 font-size: 4rem;
21 display: inline-block;
22 font-weight: 100;
23 margin: 1rem auto;
24 width: 100%;
25 max-width: 760px;
26 position: relative;
27}
28
29h2 {
30 font-size: 2.5rem;
31 font-weight: 100;
32 display: inline-block;
33 position: relative;
34}
35
36@supports (background: paint(something)) {
37 h1 {
38 /*
39 Optionally set property values.
40 This can be done at root or local scope
41 */
42 --extra-crossColor: #fc0; /* default: black */
43 --extra-crossWidth: 2; /* default: 1 */
44
45 background: paint(extra-crossOut);
46 line-height: 1.5;
47 }
48
49 h2 {
50 margin: 10rem auto;
51 display: block;
52 width: 80vw;
53 max-width: 900px;
54 height: 400px;
55 display: flex;
56 justify-content: center;
57 align-items: center;
58 }
59
60 h2:before {
61 --extra-crossColor: #fa4; /* default: black */
62 --extra-crossWidth: 30; /* default: 1 */
63 content: '';
64 width: 100%;
65 height: 100%;
66 display: block;
67 position: absolute;
68 left: 0;
69 top: 0;
70 z-index: -1;
71 background: paint(extra-crossOut);
72 transform: rotate(20deg);
73 mix-blend-mode: lighten;
74 }
75 h2:after {
76 --extra-crossColor: #b4f; /* default: black */
77 --extra-crossWidth: 50; /* default: 1 */
78 content: '';
79 width: 100%;
80 height: 100%;
81 display: block;
82 position: absolute;
83 left: 0;
84 top: 0;
85 z-index: -2;
86 background: paint(extra-crossOut);
87 transform: rotate(-20deg)
88 }
89
90 span {
91 --extra-crossColor: #d4f;/* default: black */
92 --extra-crossSpread: 10; /* default: 100, which is 100% of the height of the element */
93
94 background: paint(extra-crossOut);
95 }
96}
\No newline at end of file