-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrop-lines.css
162 lines (151 loc) · 3.39 KB
/
crop-lines.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
.crop-line-top,
.crop-line-left ,
.crop-line-bottom ,
.crop-line-right {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px; /* take the shape of the parent container box */
display: block;
}
.crop-line-top:before ,
.crop-line-top:after ,
.crop-line-left:before ,
.crop-line-left:after ,
.crop-line-bottom:before ,
.crop-line-bottom:after ,
.crop-line-right:before ,
.crop-line-right:after {
content: "";
position: absolute;
}
.crop-line-top:before ,
.crop-line-top:after ,
.crop-line-bottom:before ,
.crop-line-bottom:after {
width: 3.5em;
}
.crop-line-left:before ,
.crop-line-left:after ,
.crop-line-right:before ,
.crop-line-right:after {
height: 3.5em;
}
.crop-line-top:before ,
.crop-line-top:after {
top: 0px;
}
.crop-line-bottom:before ,
.crop-line-bottom:after {
bottom: 0px;
}
.crop-line-top:before ,
.crop-line-bottom:before {
left: -4em;
}
.crop-line-top:after ,
.crop-line-bottom:after {
right: -4em;
}
.crop-line-left:before ,
.crop-line-left:after {
left: 0px;
}
.crop-line-right:before ,
.crop-line-right:after {
right: 0px;
}
.crop-line-left:before ,
.crop-line-right:before {
top: -4em;
}
.crop-line-left:after ,
.crop-line-right:after {
bottom: -4em;
}
@media screen {
.crop-line-top:before ,
.crop-line-top:after ,
.crop-line-bottom:before ,
.crop-line-bottom:after {
height: 1px;
}
.crop-line-left:before ,
.crop-line-left:after ,
.crop-line-right:before ,
.crop-line-right:after {
width: 1px;
}
.crop-line-top:before ,
.crop-line-bottom:before {
background-image: repeating-linear-gradient(
270deg,
#000,
transparent);
}
.crop-line-top:after ,
.crop-line-bottom:after {
background-image: repeating-linear-gradient(
90deg,
#000,
transparent);
}
.crop-line-left:before ,
.crop-line-right:before {
background-image: repeating-linear-gradient(
0deg,
#000,
transparent);
}
.crop-line-left:after ,
.crop-line-right:after {
background-image: repeating-linear-gradient(
180deg,
#000,
transparent);
}
}
/* better PDF generation :
* - use "pt" unit for line's size (width/height)
* - avoid gradient
*/
@media print {
.crop-line-top:before ,
.crop-line-top:after ,
.crop-line-bottom:before ,
.crop-line-bottom:after {
height: 1px /*0.4pt;*/
}
.crop-line-left:before ,
.crop-line-left:after ,
.crop-line-right:before ,
.crop-line-right:after {
width: 1px; /*0.7pt;*/
}
.crop-line-top:before ,
.crop-line-bottom:before ,
.crop-line-top:after ,
.crop-line-bottom:after ,
.crop-line-left:before ,
.crop-line-right:before ,
.crop-line-left:after ,
.crop-line-right:after {
background-color: #000;
}
}
/* A ".crop-mask" element is created by the script 'crop-lines.js' when
* creating the crop-lines automatically.
* The mask is necessary to solve the problem of crop-lines overlapping
* another element.
*/
.crop-mask {
background-color: inherit;
/* the script 'crop-lines.js' will change the following properties
* - border-width,
* - border-color (will be detected dynamically from real background-color)
*/
border-style: solid;
border-color: transparent;
z-index: 0;
}