forked from ahmadnassri/css-diagonal-separators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
40 lines (32 loc) · 1.18 KB
/
style.css
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
:root {
--width: 300px;
--height: 100px;
--top-color: #f44336;
--bottom-color: #2196F3;
}
.separator {
--svg: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"%3E%3Cpolygon fill="%23f44336" points="0 100 0 0 100 0"/%3E%3Cpolygon fill="%232196F3" points="100 0 100 100 0 100"/%3E%3C/svg%3E');
width: var(--width);
height: var(--height);
background-image: var(--svg);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.separator.external {
background-image: url(source.svg);
}
.separator.shadow {
background-image: url(shadow.svg);
}
.separator.reverse {
transform: rotateY(180deg);
}
.vertical .separator.reverse {
transform: rotateX(180deg);
}
.image.above .separator {
--svg: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"%3E%3Cpolygon fill="%232196F3" points="100 0 100 100 0 100"/%3E%3C/svg%3E');
}
.image.below .separator {
--svg: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"%3E%3Cpolygon fill="%23f44336" points="0 100 0 0 100 0"/%3E%3C/svg%3E');
}