_main-nav.scss 6.09 KB
Newer Older
Evonne Cheung's avatar
Evonne Cheung committed
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
/*
 * Primary navigation menu
 */
.main-nav {
    padding-top: 30px;
    @media (max-width: $screen-sm-min) {
        padding-top: 0;
    }
    .container {
        @media (max-width: $screen-sm-min) {
            padding:0;
        }
    }
    ul {
        min-width: 0;
        margin:0;
    }
    .navbar-header{
        margin:0;
    }
    li {
        margin: 0;
        a {
            color: $text-color;
        }
    }

    .navbar-brand {
Evonne Cheung's avatar
Evonne Cheung committed
29
30
31
32
33
34
        padding: 8px 25px;
        width: 100%;
        height: auto;
        font-size: $font-size-base;
        background-color: darken(#0162a7, 2%);
        
Evonne Cheung's avatar
Evonne Cheung committed
35
        @media (min-width: $screen-sm-min) {
Evonne Cheung's avatar
Evonne Cheung committed
36
37
38
39
            width: auto;
            padding: 8px;
            margin-right: 5px;
            background-color: transparent;
Evonne Cheung's avatar
Evonne Cheung committed
40
        }
Evonne Cheung's avatar
Evonne Cheung committed
41
42
43
44
45
46
47
        
       &:focus,
       &:hover {
           background-color: rgba(#FFFFFF, 0.2);
           border-radius: 3px;
           color: #FFFFFF;
       }
Evonne Cheung's avatar
Evonne Cheung committed
48
49
50
51
52
53
54
55
56
57
58
59
60
61
       .icon {
            top:3px;
       }
    }

    .nav > li > a {
        padding: 10px 29px;
        line-height: 20px;
        font-weight:normal;
        @media (min-width: $screen-sm-min) {
            border:none;
            padding: 10px 20px;
        }
        @media (min-width: $screen-sm-min) and (max-width: $screen-md-min - 1) {
Evonne Cheung's avatar
Evonne Cheung committed
62
            padding: 10px 10px;
Evonne Cheung's avatar
Evonne Cheung committed
63
64
65
66
67
68
69
70
71
72
        }
        &:hover, &:focus {
            text-decoration:none;
        }
    }
    // Only shown on mobile, or when dropdowns are turned on
    .child-nav {
        min-width: 200px;
        max-width: 100%;
        overflow: hidden;
Evonne Cheung's avatar
Evonne Cheung committed
73
74
        padding: 0px;
        font-size: $font-size-base;
Evonne Cheung's avatar
Evonne Cheung committed
75
76
77
78

        li {
            display: block;
            a { //styles that need to override bootstrap specificity
Evonne Cheung's avatar
Evonne Cheung committed
79
                padding: 10px 29px 10px 50px;
Evonne Cheung's avatar
Evonne Cheung committed
80
                font-weight: normal;
Evonne Cheung's avatar
Evonne Cheung committed
81
82
                color: #FFFFFF;
                
Evonne Cheung's avatar
Evonne Cheung committed
83
84
                &:hover, &:focus {
                    text-decoration:none;
Evonne Cheung's avatar
Evonne Cheung committed
85
                    background-color: rgba(#FFFFFF, 0.2);
Evonne Cheung's avatar
Evonne Cheung committed
86
87
88
89
90
91
92
                }
            }
        }

       // If this link is the current page or section
        .active > a {
            font-weight: bold;
Evonne Cheung's avatar
Evonne Cheung committed
93
94
95
            background-color: rgba(#FFFFFF, 0.8) !important;
            color: #000;
            
Evonne Cheung's avatar
Evonne Cheung committed
96
97
            @media (min-width: $screen-sm-min) {
                background-color: $brand-default;
Evonne Cheung's avatar
Evonne Cheung committed
98
99
                
                &:focus,
Evonne Cheung's avatar
Evonne Cheung committed
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
134
135
                &:hover {
                    color: $text-color;
                }
            }
        }

        a  { // styles that don't need to override bootstrap specificity
            display:block;
            width:100%;
            @include text-overflow;
            @media (min-width: $screen-sm-min) {
                border:0;
                max-width: 300px;
                color:$link-color;
            }
        }
    }


    // on hover, if dropdown. show
    @media (min-width: $screen-sm-min) {
        ul.nav > li:hover > ul.has-dropdown.child-nav {
            display: block;
            visibility: visible;
        }
    }

    .has-dropdown {
        @media (min-width: $screen-sm-min) {
            max-width: 350px;
            position: absolute;
            top: 100%;
            left: 0;
            z-index: $zindex-dropdown;
            display: none; // none by default, but block on "open" of the menu
            float: left;
Evonne Cheung's avatar
Evonne Cheung committed
136
137
            padding: 0;
            margin: 0; // override default ul
Evonne Cheung's avatar
Evonne Cheung committed
138
139
140
141
            list-style: none;
            font-size: $font-size-base;
            text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
            background-color: $dropdown-bg;
Evonne Cheung's avatar
Evonne Cheung committed
142
            border:0;
Evonne Cheung's avatar
Evonne Cheung committed
143
144
145
146
            @include box-shadow(0 6px 12px rgba(0,0,0,.175));
            background-clip: padding-box;

            // Links within the dropdown menu
Evonne Cheung's avatar
Evonne Cheung committed
147
148
            > li a {
                padding: 4px 20px;
Evonne Cheung's avatar
Evonne Cheung committed
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
                clear: both;
                font-weight: normal;
                line-height: $line-height-base;
                white-space: nowrap; // prevent links from randomly breaking onto new lines
                color: $dropdown-link-color;
            }
            .dropdown-tertiary {
                padding:0;
                margin: 0;
                font-size: $font-size-base - 2;
            }
        }
    }
}

.dropdown-menu .btn-link:not(.btn-link-danger) {
    color: $text-color;
}
Evonne Cheung's avatar
Evonne Cheung committed
167

168
169

// admin menu with static second nav
Evonne Cheung's avatar
Evonne Cheung committed
170
171
.adminnav {
    .nav {
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
        > li {
            > a {
                font-size: $font-size-base;
                
                &:focus,
                &:hover {
                    background-color: rgba(#FFFFFF, 0.2);
                }
            }
            &.active {
                > a {
                    &:focus,
                    &:hover {
                        color: $brand-primary;
                    }
                }
            }
            .child-nav {
                font-size: $font-size-base;
            }
            
            .navbar-toggle {
                background-color: darken(#0162a7, 2%);
            }
        }
    }
}

// admin menu with dropdown
.dropdown-adminnav {
    .navbar-nav {
Evonne Cheung's avatar
Evonne Cheung committed
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
        > li {
            > a {
                font-size: $font-size-base;
                
                &:focus,
                &:hover {
                    background-color: rgba(#FFFFFF, 0.2);
                }
            }
            &.active {
                > a {
                    &:focus,
                    &:hover {
                        color: #000000;
                    }
                }
            }
            .child-nav {
                font-size: $font-size-base;
222
223
224
225
226
227
228
229
230
231
232
233
234
                > li { 
                    a:focus,
                    a:hover {
                        color: #FFFFFF;
                        background-color: $brand-primary;
                    }  
                    &.active {
                        a:focus,
                        a:hover {
                            color: $brand-primary;
                        }  
                    }
                }
Evonne Cheung's avatar
Evonne Cheung committed
235
236
237
238
239
240
241
242
243
            }
            
            .navbar-toggle {
                background-color: darken(#0162a7, 2%);
            }
        }
    }
}