Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit ef48b0a

Browse files
committed
chore(docs-app): update the header style
Also adds a new fixed strip / bar about the AngularJS version Closes #14963 Closes #15670
1 parent f57872b commit ef48b0a

File tree

9 files changed

+196
-105
lines changed

9 files changed

+196
-105
lines changed

docs/app/assets/css/angular-topnav.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/app/assets/css/docs.css

+97-6
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ h1,h2,h3,h4,h5,h6 {
5353
}
5454

5555
.header .brand {
56-
padding-top: 6px;
5756
padding-bottom: 0px;
5857
}
5958

6059
.header .brand img {
61-
margin-top: 5px;
62-
height: 30px;
60+
margin-top: 0;
61+
height: auto;
62+
vertical-align: top;
6363
}
6464

6565
.docs-search {
@@ -82,6 +82,11 @@ h1,h2,h3,h4,h5,h6 {
8282
margin-right: 10px;
8383
}
8484

85+
.navbar .navbar-search i {
86+
top: 13px;
87+
font-size: 12px;
88+
}
89+
8590
.docs-search > .search-query:focus {
8691
outline: 0;
8792
}
@@ -297,6 +302,7 @@ iframe.example {
297302
}
298303

299304
.search-results-container {
305+
position: relative;
300306
padding-bottom: 1em;
301307
border-top: 1px solid #111;
302308
background: #181818;
@@ -435,15 +441,17 @@ iframe.example {
435441
background: #f1f1f1;
436442
}
437443

438-
.sup-header {
444+
#navbar-sub {
439445
padding-top: 10px;
440446
padding-bottom: 5px;
441447
background: rgba(245,245,245,0.88);
442448
box-shadow: 0 0 2px #999;
449+
z-index: 1028;
450+
top: 83px;
443451
}
444452

445453
.main-body-grid {
446-
margin-top: 120px;
454+
margin-top: 144px;
447455
position: relative;
448456
}
449457

@@ -454,7 +462,7 @@ iframe.example {
454462

455463
.main-body-grid > .grid-left {
456464
position: fixed;
457-
top: 120px;
465+
top: 144px;
458466
bottom: 0;
459467
overflow: auto;
460468
}
@@ -827,3 +835,86 @@ ul.events > li {
827835
iframe[name="example-anchoringExample"] {
828836
height: 400px;
829837
}
838+
839+
/*
840+
angular-topnav.css and bootstrap overrides
841+
*/
842+
843+
.navbar .navbar-inner .container {
844+
padding: 0 16px;
845+
width: auto;
846+
height: auto;
847+
}
848+
849+
.navbar .nav > li {
850+
float: left;
851+
}
852+
853+
.navbar-nav .open .dropdown-menu {
854+
position: absolute;
855+
float: left;
856+
}
857+
858+
.navbar-nav .open .dropdown-menu > li > a {
859+
line-height: 48px;
860+
}
861+
862+
#navbar-main .navbar-inner, #navbar-notice .navbar-inner {
863+
box-shadow: none;
864+
}
865+
866+
#navbar-sub .container {
867+
max-width: 970px;
868+
}
869+
870+
.nav .open > a, .nav .open > a:hover, .nav .open > a:focus {
871+
background-color: inherit;
872+
}
873+
874+
@media handheld and (max-width:800px), screen and (max-device-width:800px), screen and (max-width:800px) {
875+
.navbar {
876+
min-height: auto;
877+
}
878+
879+
.search-results-container {
880+
top: 32px;
881+
overflow: auto;
882+
max-height: 85vh;
883+
padding-bottom: 0;
884+
position: static;
885+
}
886+
887+
.search-close {
888+
right: 1px;
889+
margin-left: 0;
890+
top: 41px;
891+
padding: 5px 10px;
892+
border-top-right-radius: 0;
893+
border-top-left-radius: 0;
894+
box-shadow: none;
895+
width: auto;
896+
bottom: auto;
897+
left: auto;
898+
}
899+
900+
.navbar-nav .open .dropdown-menu > li > a, .navbar-nav .open .dropdown-menu .dropdown-header {
901+
padding: 0 8px;
902+
}
903+
904+
.homepage #navbar-notice {
905+
top: 72px;
906+
}
907+
908+
#navbar-notice .navbar-inner {
909+
box-shadow: 0 0 3px rgba(0, 0, 0, .12), 0 3px 3px rgba(0, 0, 0, .24)
910+
}
911+
912+
#navbar-sub {
913+
position: relative;
914+
top: 17px;
915+
margin-top: 80px;
916+
padding-bottom: 0;
917+
margin-bottom: 0;
918+
}
919+
920+
}

docs/app/e2e/api-docs/api-pages.scenario.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ describe('doc.angularjs.org', function() {
1818
var ngBindLink = element(by.css('.definition-table td a[href="api/ng/directive/ngClick"]'));
1919
ngBindLink.click();
2020

21-
var pageBody = element(by.css('h1'));
22-
expect(pageBody.getText()).toEqual('ngClick');
21+
var mainHeader = element(by.css('.main-body h1 '));
22+
expect(mainHeader.getText()).toEqual('ngClick');
2323
});
2424

2525

docs/app/e2e/app.scenario.js

+11-9
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,31 @@ describe('docs.angularjs.org', function() {
4444
var ngBindLink = element(by.css('.definition-table td a[href="api/ng/directive/ngClick"]'));
4545
ngBindLink.click();
4646

47-
var pageBody = element(by.css('h1'));
48-
expect(pageBody.getText()).toEqual('ngClick');
47+
var mainHeader = element(by.css('.main-body h1 '));
48+
expect(mainHeader.getText()).toEqual('ngClick');
4949
});
5050

5151

5252

5353
it('should be resilient to trailing slashes', function() {
5454
browser.get('build/docs/index-production.html#!/api/ng/function/angular.noop/');
55-
var pageBody = element(by.css('h1'));
56-
expect(pageBody.getText()).toEqual('angular.noop');
55+
56+
var mainHeader = element(by.css('.main-body h1 '));
57+
expect(mainHeader.getText()).toEqual('angular.noop');
5758
});
5859

5960

6061
it('should be resilient to trailing "index"', function() {
6162
browser.get('build/docs/index-production.html#!/api/ng/function/angular.noop/index');
62-
var pageBody = element(by.css('h1'));
63-
expect(pageBody.getText()).toEqual('angular.noop');
63+
var mainHeader = element(by.css('.main-body h1 '));
64+
expect(mainHeader.getText()).toEqual('angular.noop');
6465
});
6566

6667

6768
it('should be resilient to trailing "index/"', function() {
6869
browser.get('build/docs/index-production.html#!/api/ng/function/angular.noop/index/');
69-
var pageBody = element(by.css('h1'));
70-
expect(pageBody.getText()).toEqual('angular.noop');
70+
var mainHeader = element(by.css('.main-body h1 '));
71+
expect(mainHeader.getText()).toEqual('angular.noop');
7172
});
7273

7374

@@ -78,7 +79,8 @@ describe('docs.angularjs.org', function() {
7879

7980
it('should display an error if the page does not exist', function() {
8081
browser.get('build/docs/index-production.html#!/api/does/not/exist');
81-
expect(element(by.css('h1')).getText()).toBe('Oops!');
82+
var mainHeader = element(by.css('.main-body h1 '));
83+
expect(mainHeader.getText()).toEqual('Oops!');
8284
});
8385

8486
});

docs/config/services/deployments/debug.js

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.exports = function debugDeployment(getVersion) {
3232
'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.css',
3333
'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css',
3434
'css/prettify-theme.css',
35+
'css/angular-topnav.css',
3536
'css/docs.css',
3637
'css/animations.css'
3738
]

docs/config/services/deployments/default.js

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.exports = function defaultDeployment(getVersion) {
3232
'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.min.css',
3333
'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css',
3434
'css/prettify-theme.css',
35+
'css/angular-topnav.css',
3536
'css/docs.css',
3637
'css/animations.css'
3738
]

docs/config/services/deployments/jquery.js

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module.exports = function jqueryDeployment(getVersion) {
3636
'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.min.css',
3737
'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css',
3838
'css/prettify-theme.css',
39+
'css/angular-topnav.css',
3940
'css/docs.css',
4041
'css/animations.css'
4142
]

docs/config/services/deployments/production.js

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ module.exports = function productionDeployment(getVersion) {
4949
'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.min.css',
5050
'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css',
5151
'css/prettify-theme.css',
52+
'css/angular-topnav.css',
5253
'css/docs.css',
5354
'css/animations.css'
5455
]

0 commit comments

Comments
 (0)