-
Notifications
You must be signed in to change notification settings - Fork 1
/
prism-collapse.less
79 lines (63 loc) · 1.21 KB
/
prism-collapse.less
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
pre code {
.collapse.collapsed {
color: black;
text-align: center;
background-color: #eee;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding: calc(~"0.25em - 1px") 0;
margin: 0 -1em;
> .collapse-code {
display: none;
}
&:hover {
opacity: .6;
cursor: pointer;
}
&:before {
display: block;
content: '⇅ EXPAND ⇅';
margin: 0 auto;
width: 1em;
height: 1em;
line-height: 1em;
}
}
}
pre.line-numbers code {
> .line-numbers-rows > .collapse.collapsed {
border: none;
padding: 0;
margin: 0;
height: 1.5em;
opacity: 0;
> .collapse-lines {
position: absolute;
height: 0;
overflow: hidden;
}
&:before {
display: none;
}
}
}
/* conditional positioning of colored bar */
pre[data-line] code .collapse.collapsed {
margin-left: -3.8em;
}
pre.line-numbers code .collapse.collapsed {
margin-left: -4em;
}
/* line-numbers overwrites so that spans can be nested */
.line-numbers-rows span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
.line-numbers-rows span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: .8em;
text-align: right;
}