summaryrefslogtreecommitdiffstats
path: root/assets/sass/@primer/css/navigation/sidenav.scss
blob: 35bffdd67fc7095aa02eb71630e213e67f3e89d4 (plain) (blame)
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
// Side Nav
//
// A vertical list of navigational links, typically used on the left side of a page.

.SideNav {
  background-color: $bg-gray-light;
}

.SideNav-item {
  position: relative;
  display: block;
  width: 100%;
  padding: $spacer-3;
  color: $text-gray;
  text-align: left;
  background-color: transparent;
  border: 0;
  border-top: $border;

  &:first-child {
    border-top: 0;
  }

  &:last-child {
    // makes sure there is a "bottom border" in case the list is not long enough
    // stylelint-disable-next-line primer/box-shadow
    box-shadow: 0 $border-width 0 $border-color;
  }

  // Bar on the left
  &::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    width: 3px;
    pointer-events: none;
    content: "";
  }
}

// States

.SideNav-item:hover,
.SideNav-item:focus {
  color: $text-gray-dark;
  text-decoration: none;
  background-color: $bg-gray;
  outline: none;

  // Bar on the left
  &::before {
    // stylelint-disable-next-line primer/colors
    background-color: $gray-300;
  }
}

.SideNav-item:active {
  background-color: $bg-white;
}

.SideNav-item[aria-current="page"],
.SideNav-item[aria-selected="true"] {
  font-weight: $font-weight-semibold;
  color: $text-gray-dark;
  background-color: $bg-white;

  // Bar on the left
  &::before {
    // stylelint-disable-next-line primer/colors
    background-color: $orange-600;
  }
}

// Icon
//
// Makes sure multiple icons are vertically aligned

.SideNav-icon {
  width: 16px;
  color: $text-gray-light;
}

// Sub Nav
//
// A more lightweight version, suited as a sub nav

.SideNav-subItem {
  position: relative;
  display: block;
  width: 100%;
  padding: $spacer-1 0;
  color: $text-blue;
  text-align: left;
  background-color: transparent;
  border: 0;
}

.SideNav-subItem:hover,
.SideNav-subItem:focus {
  color: $text-gray-dark;
  text-decoration: none;
  outline: none;
}

.SideNav-subItem[aria-current="page"],
.SideNav-subItem[aria-selected="true"] {
  font-weight: $font-weight-semibold;
  color: $text-gray-dark;
}