summaryrefslogtreecommitdiffstats
path: root/devtools/client/aboutdebugging/src/components/sidebar/SidebarItem.css
blob: 3f129640124f7f691b9148d938dabfd6af7b94fe (plain)
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
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

.sidebar-item {
  color: var(--sidebar-text-color);
  border-radius: 2px;
  padding-inline-end: var(--category-padding);
  padding-inline-start: var(--category-padding);
  transition: background-color var(--category-transition-duration);
  user-select: none;
}

.sidebar-item--tall {
  height: var(--category-height);
}

.sidebar-item--condensed {
  height: calc(var(--base-unit) * 9);
}

.sidebar-item__link {
  display: block;
  height: 100%;
}

.sidebar-item__link,
.sidebar-item__link:hover {
  color: inherit; /* do not apply usual link colors, but grab this element parent's */
}

.sidebar-item:not(.sidebar-item--selectable) {
  color: var(--secondary-text-color);
}

.sidebar-item--selectable:hover {
  background-color: var(--sidebar-background-hover);
}

.sidebar-item--selected {
  color: var(--sidebar-selected-color);
}

.sidebar-item--breathe {
  margin-block-start: calc(6 * var(--base-unit));
  margin-block-end: calc(2 * var(--base-unit));
}

@media (prefers-contrast) {
  /* Color transitions (black <-> white) look bad in high contrast */
  .sidebar-item {
    transition: background 0s;
  }

  .sidebar-item--selected,
  .sidebar-item--selected:hover {
    background-color: ButtonText;
  }

  /* `color: inherit` should not be used in high contrast mode
     otherwise the link inherits the <a> color from ua.css */
  .sidebar-item__link,
  .sidebar-item__link:hover {
    color: ButtonText;
  }

  .sidebar-item--selected .sidebar-item__link,
  .sidebar-item--selected .sidebar-item__link:hover {
    color: ButtonFace;
  }
}