Skip to content

Commit 5e6b7ab

Browse files
committed
WIP: New Styling
1 parent 4a3c7a4 commit 5e6b7ab

File tree

2 files changed

+81
-15
lines changed

2 files changed

+81
-15
lines changed

main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function createTooltip (content, isMarked = false) {
7272
Object.assign(
7373
arrow.style,
7474
{
75-
left: `${(rect.left) + 5}px`,
75+
left: `${(rect.left) + 25}px`,
7676
top: `${newtop + 195}px` // newtop + height of tooltip
7777
}
7878
)

styles/main.scss

Lines changed: 80 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,68 @@
1+
$color-dark: #ffffff;
2+
$background-dark: #000000;
3+
$anchor-color-dark: #9cb2f5;
4+
$code-color-dark: #ffffff;
5+
$code-background-dark: #313131;
6+
$code-shadow-dark: rgba(0, 0, 0, 0.50);
7+
8+
$color-light: #000000;
9+
$background-light: #ffffff;
10+
$anchor-color-light: #4169e1;
11+
$code-color-light: #000000;
12+
$code-background-light: #d3d3d3;
13+
$code-shadow-light: rgba(255, 255, 255, 0.5);
14+
15+
:root {
16+
--color: #{$color-dark};
17+
--background: #{$background-dark};
18+
--anchor-color: #{$anchor-color-dark};
19+
--code-color: #{$code-color-dark};
20+
--code-background: #{$code-background-dark};
21+
--code-shadow: #{$code-shadow-dark};
22+
}
23+
24+
@media (prefers-color-scheme: dark) {
25+
:root {
26+
--color: #{$color-dark};
27+
--background: #{$background-dark};
28+
--anchor-color: #{$anchor-color-dark};
29+
--code-color: #{$code-color-dark};
30+
--code-background: #{$code-background-dark};
31+
--code-shadow: #{$code-shadow-dark};
32+
}
33+
}
34+
35+
36+
@media (prefers-color-scheme: light) {
37+
:root {
38+
--color: #{$color-light};
39+
--background: #{$background-light};
40+
--anchor-color: #{$anchor-color-light};
41+
--code-color: #{$code-color-light};
42+
--code-background: #{$code-background-light};
43+
--code-shadow: #{$code-shadow-light};
44+
}
45+
}
46+
147
#tldr-chrome
248
{
349
*
450
{
551
all: initial;
652
font-family: monospace;
7-
color: #ffffff;
53+
color: var(--color);
854
}
955

56+
scrollbar-width: none; /* Firefox */
57+
-ms-overflow-style: none; /* Internet Explorer 10+ */
58+
&::-webkit-scrollbar { /* WebKit */
59+
width: 0;
60+
height: 0;
61+
}
1062
z-index: 1000;
1163
padding: 10px;
1264
box-sizing: border-box;
13-
background: #4A4A4A;
65+
background: var(--background);
1466
box-shadow: 0 2px 4px;
1567
border-radius: 8px;
1668
transition: .2s;
@@ -19,15 +71,18 @@
1971
height: 195px;
2072
width: 500px;
2173

74+
a {
75+
color: var(--anchor-color);
76+
}
2277
code
2378
{
2479
font-family: monospace;
2580
font-size: 12px;
26-
background: white;
81+
background: var(--code-background);
2782
border-radius: 2px;
28-
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.50);
83+
box-shadow: 0 1px 2px 0 var(--code-shadow);
2984
padding: 2px;
30-
color: #4A4A4A;
85+
color: var(--code-color);
3186
}
3287
ul
3388
{
@@ -65,8 +120,8 @@
65120
}
66121
a
67122
{
123+
color: var(--anchor-color);
68124
cursor: pointer;
69-
color: royalblue;
70125
}
71126
.large
72127
{
@@ -79,13 +134,24 @@
79134

80135
#tldr-chrome-arrow
81136
{
82-
all: initial;
83-
84-
z-index: 1000;
85-
width: 0;
86-
height: 0;
87-
border-left: 10px solid transparent;
88-
border-right: 10px solid transparent;
89-
border-top: 10px solid #4A4A4A;
137+
z-index: 1001;
138+
width: 50px;
139+
height: 25px;
90140
position: absolute;
141+
top: 100%;
142+
left: 70%;
143+
transform: translateX(-50%);
144+
overflow: hidden;
145+
146+
&::after {
147+
content: "";
148+
position: absolute;
149+
width: 20px;
150+
height: 20px;
151+
background: var(--background);
152+
transform: translateX(-50%) translateY(-50%) rotate(45deg);
153+
top: 0;
154+
left: 50%;
155+
box-shadow: 1px 1px 20px 0px;
156+
}
91157
}

0 commit comments

Comments
 (0)