-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathbullet_threading.scss
164 lines (141 loc) · 3.89 KB
/
bullet_threading.scss
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
163
164
:root {
--ls-block-bullet-active-color: var(
--ls-block-bullet-threading-active-color-overwrite,
var(--ls-link-text-color)
);
--ls-block-bullet-threading-width: var(
--ls-block-bullet-threading-width-overwrite,
1px
);
}
.block-control {
z-index: 1;
}
.block-children {
border-left-color: var(--ls-guideline-color);
// Must override this to make it compatible with other themes
border-left-width: var(--ls-block-bullet-threading-width) !important;
}
.block-children-container {
position: relative;
}
.block-children-left-border {
z-index: 1;
position: absolute;
height: 100%;
width: 4px;
padding-right: 0px;
border-radius: 2px;
background-color: transparent;
left: -1px;
transition: background-color 0.2s;
}
.block-children-left-border:hover {
background-color: var(--ls-block-bullet-active-color);
}
.block-content-wrapper {
position: relative;
overflow-x: visible !important; /* Fixme: overflow? */
}
.bullet-container {
height: 14px !important;
width: 14px !important;
position: relative;
transform: translate(1px, -1px);
}
/* Block bullet path should only show in a nested block */
.ls-block {
.bullet {
background-color: var(--ls-block-bullet-active-color);
box-shadow: 0 0 0 1px var(--ls-block-bullet-active-color);
}
div.items-center {
position: relative;
height: 26px !important;
}
/* Fix for headings like h1, h2 etc */
> .items-baseline {
align-items: initial;
}
&:not(:focus-within) .bullet {
background-color: var(--ls-block-bullet-color);
transform: scale(1);
box-shadow: none;
}
&:not(:focus-within) > .items-baseline {
align-items: baseline;
}
/* Basic "curve" */
.ls-block > div > div.items-center::before {
pointer-events: none;
content: "";
left: calc(var(--ls-block-bullet-threading-width) * -1);
right: 20px;
top: calc(-50% + var(--ls-block-bullet-threading-width) * 0.5 - 1px);
bottom: 50%;
/* shift left 1px for border */
position: absolute;
border-left: var(--ls-block-bullet-threading-width) solid transparent;
border-bottom: var(--ls-block-bullet-threading-width) solid transparent;
border-bottom-left-radius: 10px;
}
.ls-block:focus-within > div > div.items-center::before {
border-color: var(--ls-block-bullet-active-color);
}
.block-children > .ls-block::before {
pointer-events: none;
content: "";
top: -1rem;
bottom: 0;
border-left: var(--ls-block-bullet-threading-width) solid transparent;
left: calc(var(--ls-block-bullet-threading-width) * -1);
position: absolute;
}
.block-children:focus-within > .ls-block:not(:focus-within)::before {
border-color: var(--ls-block-bullet-active-color);
}
.block-children:focus-within > .ls-block:focus-within ~ .ls-block::before {
border-color: transparent;
}
/* Fix multi-line blocks with children */
&[haschild] {
> div > .block-content-wrapper::before {
pointer-events: none;
content: "";
top: 12px;
bottom: 0;
left: -21px;
position: absolute;
border-left: var(--ls-block-bullet-threading-width) solid transparent;
}
&:focus-within > div > .block-content-wrapper::before {
border-color: var(--ls-block-bullet-active-color);
}
}
}
// A dirty fix for removing threading for the root blocks in embedded
:is(.embed-block > div, .embed-page)
> div
> div
> div
> div.ls-block
> div
> div.items-center::before {
border-color: transparent !important;
}
// Fix https://github.com/pengx17/logseq-plugin-bullet-threading/issues/1
@media (max-width: 640px) {
.ls-block[haschild] > div > .block-content-wrapper::before {
left: -11px;
}
}
/* Disable for doc mode */
.doc-mode div.items-center::before,
.doc-mode div.items-center::after,
.doc-mode .ls-block::before,
.doc-mode .ls-block::after {
display: none;
}
.doc-mode .block-children {
border-left-width: 0px !important;
}