Skip to content

Commit 5df2a81

Browse files
Add navbar-user for showing a logged in user
1 parent 1cd7d73 commit 5df2a81

File tree

5 files changed

+64
-22
lines changed

5 files changed

+64
-22
lines changed

dist/csh-material-bootstrap.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/csh-material-bootstrap.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,20 @@ <h1 id="navbar">Navbar</h1>
324324
<button type="submit" class="btn btn-default">Submit</button>
325325
</form>
326326
<ul class="nav navbar-nav navbar-right">
327-
<li><a href="#">Link</a></li>
327+
<li class="dropdown navbar-user">
328+
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
329+
aria-expanded="false">
330+
<img src="https://profiles.csh.rit.edu/image/test">
331+
Testing Tester
332+
<span class="caret"></span>
333+
</a>
334+
<ul class="dropdown-menu" role="menu">
335+
<li><a href="#">Profile</a></li>
336+
<li><a href="#">Settings</a></li>
337+
<li class="divider"></li>
338+
<li><a href="#">Logout</a></li>
339+
</ul>
340+
</li>
328341
</ul>
329342
</div>
330343
</div>
@@ -370,7 +383,20 @@ <h1 id="navbar">Navbar</h1>
370383
<button type="submit" class="btn btn-default">Submit</button>
371384
</form>
372385
<ul class="nav navbar-nav navbar-right">
373-
<li><a href="#">Link</a></li>
386+
<li class="dropdown navbar-user">
387+
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
388+
aria-expanded="false">
389+
<img src="https://profiles.csh.rit.edu/image/test">
390+
Testing Tester
391+
<span class="caret"></span>
392+
</a>
393+
<ul class="dropdown-menu" role="menu">
394+
<li><a href="#">Profile</a></li>
395+
<li><a href="#">Settings</a></li>
396+
<li class="divider"></li>
397+
<li><a href="#">Logout</a></li>
398+
</ul>
399+
</li>
374400
</ul>
375401
</div>
376402
</div>

sass/csh-material-bootstrap.scss

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// CSH Material Bootstrap 3.3.6
22
// Main Theme
33
// -----------------------------------------------------
4-
54
@import "variables";
65
@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap";
76

@@ -12,14 +11,30 @@ $web-font-path: "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"
1211

1312
.navbar {
1413
border: none;
15-
@include box-shadow(0 1px 2px rgba(0,0,0,.3));
14+
@include box-shadow(0 1px 2px rgba(0, 0, 0, .3));
1615

1716
&-brand {
1817
font-size: 24px;
1918
padding-left: 60px;
2019
background: $navbar-default-logo 11px 11px/40px 40px no-repeat;
2120
}
2221

22+
&-user {
23+
@media (min-width: $grid-float-breakpoint) {
24+
& > a {
25+
padding-top: 16px !important;
26+
padding-bottom: 16px !important;
27+
}
28+
}
29+
30+
& a > img {
31+
width: 32px;
32+
height: 32px;
33+
border-radius: 50%;
34+
margin-right: 5px;
35+
}
36+
}
37+
2338
&-inverse {
2439
.navbar-brand {
2540
background-image: $navbar-inverse-logo;
@@ -43,7 +58,7 @@ $web-font-path: "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"
4358

4459
// Buttons ====================================================================
4560

46-
@mixin btn($class,$bg){
61+
@mixin btn($class,$bg) {
4762
.btn-#{$class} {
4863
background-size: 200% 200%;
4964
background-position: 50%;
@@ -61,23 +76,23 @@ $web-font-path: "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"
6176
background-color: darken($bg, 12%);
6277
@include gradient-radial(darken($bg, 12%) 10%, $bg 11%);
6378
background-size: 1000% 1000%;
64-
@include box-shadow(2px 2px 4px rgba(0,0,0,.4));
79+
@include box-shadow(2px 2px 4px rgba(0, 0, 0, .4));
6580
}
6681
}
6782
}
6883

69-
@include btn(default,$btn-default-bg);
70-
@include btn(primary,$btn-primary-bg);
71-
@include btn(success,$btn-success-bg);
72-
@include btn(info,$btn-info-bg);
73-
@include btn(warning,$btn-warning-bg);
74-
@include btn(danger,$btn-danger-bg);
75-
@include btn(link,#fff);
84+
@include btn(default, $btn-default-bg);
85+
@include btn(primary, $btn-primary-bg);
86+
@include btn(success, $btn-success-bg);
87+
@include btn(info, $btn-info-bg);
88+
@include btn(warning, $btn-warning-bg);
89+
@include btn(danger, $btn-danger-bg);
90+
@include btn(link, #fff);
7691

7792
.btn {
7893
text-transform: uppercase;
7994
border: none;
80-
@include box-shadow(1px 1px 4px rgba(0,0,0,.4));
95+
@include box-shadow(1px 1px 4px rgba(0, 0, 0, .4));
8196
@include transition(all 0.4s);
8297

8398
&-link {
@@ -206,7 +221,8 @@ select.form-control {
206221
-moz-appearance: none;
207222
appearance: none;
208223
padding-left: 0;
209-
padding-right: 0\9; // remove padding for < ie9 since default arrow can't be removed
224+
padding-right: 0 \9
225+
; // remove padding for < ie9 since default arrow can't be removed
210226
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAAJ1BMVEVmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmaP/QSjAAAADHRSTlMAAgMJC0uWpKa6wMxMdjkoAAAANUlEQVR4AeXJyQEAERAAsNl7Hf3X6xt0QL6JpZWq30pdvdadme+0PMdzvHm8YThHcT1H7K0BtOMDniZhWOgAAAAASUVORK5CYII=);
211227
background-size: 13px;
212228
background-repeat: no-repeat;
@@ -481,7 +497,7 @@ input[type="checkbox"],
481497
.dropdown-menu {
482498
margin-top: 0;
483499
border: none;
484-
@include box-shadow(0 1px 4px rgba(0,0,0,.3));
500+
@include box-shadow(0 1px 4px rgba(0, 0, 0, .3));
485501
}
486502

487503
// Indicators =================================================================
@@ -602,7 +618,7 @@ input[type="checkbox"],
602618
.panel {
603619
border: none;
604620
border-radius: 2px;
605-
@include box-shadow(0 1px 4px rgba(0,0,0,.3));
621+
@include box-shadow(0 1px 4px rgba(0, 0, 0, .3));
606622

607623
&-heading {
608624
border-bottom: none;
@@ -615,7 +631,7 @@ input[type="checkbox"],
615631

616632
.popover {
617633
border: none;
618-
@include box-shadow(0 1px 4px rgba(0,0,0,.3));
634+
@include box-shadow(0 1px 4px rgba(0, 0, 0, .3));
619635
}
620636

621637
.carousel {

sass/variables.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@ $navbar-inverse-brand-color: $navbar-inverse-link-color !default;
415415
$navbar-inverse-brand-hover-color: #fff !default;
416416
$navbar-inverse-brand-hover-bg: transparent !default;
417417

418-
// Inverted navbar toggle\
418+
// Inverted navbar toggle
419419
$navbar-inverse-toggle-hover-bg: transparent !default;
420-
$navbar-inverse-toggle-icon-bar-bg: rgba(0,0,0,0.5) !default;
420+
$navbar-inverse-toggle-icon-bar-bg: $navbar-inverse-link-hover-color !default;
421421
$navbar-inverse-toggle-border-color: transparent !default;
422422

423423

0 commit comments

Comments
 (0)