summaryrefslogtreecommitdiffstats
path: root/assets/sass/@primer/css/navigation/menu.scss
blob: cc7e858f24dac73129665c2490a823bcd0e8d988 (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// Side menu
//
// A menu on the side of a page, defaults to left side. e.g. github.com/about

.menu {
  // stylelint-disable-next-line primer/spacing
  margin-bottom: 15px;
  list-style: none;
  background-color: $bg-white;
  border: $border-width $border-style $border-gray-dark;
  border-radius: $border-radius;
}

.menu-item {
  position: relative;
  display: block;
  padding: $spacer-2 10px;
  border-bottom: $border;

  &:first-child {
    border-top: 0;
    // stylelint-disable-next-line primer/borders
    border-top-left-radius: 2px;
    // stylelint-disable-next-line primer/borders
    border-top-right-radius: 2px;

    // stylelint-disable-next-line primer/borders
    &::before { border-top-left-radius: 2px; }
  }

  &:last-child {
    border-bottom: 0;
    // stylelint-disable-next-line primer/borders
    border-bottom-right-radius: 2px;
    // stylelint-disable-next-line primer/borders
    border-bottom-left-radius: 2px;

    // stylelint-disable-next-line primer/borders
    &::before { border-bottom-left-radius: 2px; }
  }

  &:hover {
    text-decoration: none;
    background-color: $bg-gray;
  }

  &.selected,
  &[aria-selected=true],
  &[aria-current] {
    font-weight: $font-weight-bold;
    color: $text-gray-dark;
    cursor: default;
    background-color: $bg-white;

    &::before {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 2px;
      content: "";
      // stylelint-disable-next-line primer/colors
      background-color: $orange-600;
    }
  }

  .octicon {
    width: 16px;
    // stylelint-disable-next-line primer/spacing
    margin-right: 5px;
    color: $text-gray-dark;
    text-align: center;
  }

  .Counter {
    float: right;
    // stylelint-disable-next-line primer/spacing
    margin-left: 5px;
  }

  .menu-warning {
    float: right;
    // stylelint-disable-next-line primer/colors
    color: $red-900;
  }

  .avatar {
    float: left;
    // stylelint-disable-next-line primer/spacing
    margin-right: 5px;
  }

  &.alert {
    .Counter {
      color: $text-red;
    }
  }
}

.menu-heading {
  display: block;
  padding: $spacer-2 10px;
  margin-top: 0;
  margin-bottom: 0;
  // stylelint-disable-next-line primer/typography
  font-size: 13px;
  font-weight: $font-weight-bold;
  // stylelint-disable-next-line primer/typography
  line-height: 20px;
  color: $text-gray;
  // stylelint-disable-next-line primer/colors
  background-color: darken($gray-100, 1%);
  border-bottom: $border;

  &:hover {
    text-decoration: none;
  }

  &:first-child {
    // stylelint-disable-next-line primer/borders
    border-top-left-radius: 2px;
    // stylelint-disable-next-line primer/borders
    border-top-right-radius: 2px;
  }

  &:last-child {
    border-bottom: 0;
    // stylelint-disable-next-line primer/borders
    border-bottom-right-radius: 2px;
    // stylelint-disable-next-line primer/borders
    border-bottom-left-radius: 2px;
  }
}