Skip to content

Commit 9e41895

Browse files
committed
docs: Use theme's variables to define tab colors
This makes it look nice for the dark themes too [doc only]
1 parent fa04592 commit 9e41895

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

docs/shared/glean.css

+30-6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,25 @@ a.header code:hover {
1515
background-color: rgba(230, 230, 230, 1);
1616
}
1717

18+
:root {
19+
--tab-bg: #f1f1f1;
20+
--tab-fg: #000;
21+
--tab-bg-disabled: var(--tab-bg);
22+
--tab-fg-disabled: #ccc;
23+
--tab-border: #ccc;
24+
--tab-bg-active: #ccc;
25+
--tab-fg-active: #000;
26+
}
27+
28+
.coal, .navy, .ayu {
29+
--tab-bg: var(--bg);
30+
--tab-fg: var(--fg);
31+
--tab-bg-disabled: var(--tab-bg);
32+
--tab-fg-disabled: #505254;
33+
--tab-bg-active: #e6e6e6;
34+
--tab-fg-active: #000;
35+
}
36+
1837
/* Style the tab */
1938
.tabs {
2039
display: flex;
@@ -23,15 +42,17 @@ a.header code:hover {
2342
}
2443

2544
.tabbar {
26-
border: 1px solid #ccc;
27-
background-color: #f1f1f1;
45+
border: 1px solid var(--tab-border);
46+
background-color: var(--tab-bg);
47+
color: var(--tab-fg);
2848
width: 100%;
2949
box-sizing: border-box;
3050
}
3151

3252
/* Style the buttons that are used to open the tab content */
3353
.tabbar button {
3454
background-color: inherit;
55+
color: var(--tab-fg);
3556
float: left;
3657
border: none;
3758
outline: none;
@@ -42,7 +63,8 @@ a.header code:hover {
4263

4364
/* Change background color of buttons on hover */
4465
.tabbar button:hover {
45-
background-color: #ddd;
66+
background-color: var(--tab-bg-active);
67+
color: var(--tab-fg-active);
4668
}
4769

4870
.tabbar button.disabled:hover {
@@ -51,11 +73,13 @@ a.header code:hover {
5173

5274
/* Create an active/current tablink class */
5375
.tabbar button.active {
54-
background-color: #ccc;
76+
background-color: var(--tab-bg-active);
77+
color: var(--tab-fg-active);
5578
}
5679

5780
.tabbar button.disabled {
58-
color: #ccc;
81+
background-color: var(--tab-bg-disabled);
82+
color: var(--tab-fg-disabled);
5983
cursor: default;
6084
}
6185

@@ -68,7 +92,7 @@ a.header code:hover {
6892
.tab {
6993
display: none;
7094
width: 100%;
71-
border: 1px solid #ccc;
95+
border: 1px solid var(--tab-border);
7296
border-top: none;
7397
padding: 6px 12px;
7498
box-sizing: border-box;

0 commit comments

Comments
 (0)