Skip to content

Commit 63a0161

Browse files
[ui] [codeblock] fully redesigned codeblocks with better color for accessiblity on both dark and light mode
1 parent c3524e6 commit 63a0161

File tree

1 file changed

+52
-3
lines changed

1 file changed

+52
-3
lines changed

docs/.vitepress/theme/custom.css

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
/* Style tabs to match table appearance with complete border and rounded corners */
1111
.plugin-tabs {
12-
border: 2px solid var(--coollabs-border-zinc-300-20) !important;
12+
border: 2px solid var(--vp-c-divider) !important;
1313
border-radius: 8px !important;
1414
overflow: hidden !important;
1515
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
1616
margin: 1.5rem 0 !important;
1717
}
1818

1919
.plugin-tabs--tab-list {
20-
background: var(--coollabs-bg-zinc-300-5) !important;
20+
background: var(--vp-c-bg-soft) !important;
2121
border-bottom: 1.5px solid var(--vp-c-divider) !important;
2222
}
2323

@@ -31,7 +31,7 @@
3131
}
3232

3333
.dark .plugin-tabs--tab-list {
34-
background: var(--coollabs-bg-zinc-300-5) !important;
34+
background: var(--vp-c-bg-soft) !important;
3535
border-bottom: 1px solid var(--vp-c-divider) !important;
3636
}
3737

@@ -40,6 +40,55 @@
4040
border: none !important;
4141
}
4242

43+
/* Improve codeblock styling */
44+
.vp-doc div[class*='language-'],
45+
.vp-doc [class*='language-'],
46+
.vp-doc pre[class*='language-'] {
47+
background-color: var(--coollabs-bg-zinc-300-5) !important;
48+
border: 0.5px solid rgba(0, 0, 0, 0.15) !important;
49+
border-radius: 10px !important;
50+
padding: 0 0 0 0.850rem !important;
51+
margin: 0 !important;
52+
line-height: 1.3 !important;
53+
}
54+
55+
.vp-doc div[class*='language-'] code,
56+
.vp-doc [class*='language-'] code,
57+
.vp-doc pre[class*='language-'] code {
58+
font-weight: 700 !important;
59+
line-height: 1.3 !important;
60+
padding-left: 0 !important;
61+
}
62+
63+
.dark .vp-doc div[class*='language-'],
64+
.dark .vp-doc [class*='language-'],
65+
.dark .vp-doc pre[class*='language-'] {
66+
background-color: var(--coollabs-bg-zinc-300-5) !important;
67+
border: 0.5px solid rgba(255, 255, 255, 0.15) !important;
68+
border-radius: 10px !important;
69+
padding: 0 0 0 0.850rem !important;
70+
margin: 0 !important;
71+
line-height: 1.3 !important;
72+
}
73+
74+
.dark .vp-doc div[class*='language-'] code,
75+
.dark .vp-doc [class*='language-'] code,
76+
.dark .vp-doc pre[class*='language-'] code {
77+
font-weight: 600 !important;
78+
line-height: 1.5 !important;
79+
padding-left: 0 !important;
80+
}
81+
82+
/* Right-align copy button at the end of codeblocks */
83+
.vp-doc div[class*='language-'] > button.copy,
84+
.vp-doc div[class*='language-'] > button.copy-code,
85+
.vp-doc [class*='language-'] > button.copy,
86+
.vp-doc [class*='language-'] > button.copy-code,
87+
.vp-doc pre[class*='language-'] > button.copy,
88+
.vp-doc pre[class*='language-'] > button.copy-code {
89+
right: 8px !important;
90+
}
91+
4392
@media (min-width: 1440px) {
4493
.VPContent.has-sidebar {
4594
padding-right: 0px !important;

0 commit comments

Comments
 (0)