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

Commit afc2262

Browse files
Splaktarmmalerba
authored andcommitted
docs: better support for dark mode in docs and demos (#11381)
<!-- Filling out this template is required! Do not delete it when submitting a Pull Request! Without this information, your Pull Request may be auto-closed. --> ## PR Checklist Please check that your PR fulfills the following requirements: - [x] The commit message follows [our guidelines](https://github.com/angular/material/blob/master/.github/CONTRIBUTING.md#-commit-message-format) - [x] Tests for the changes have been added or this is not a bug fix / enhancement - [x] Docs have been added, updated, or were not required ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x". --> ``` [ ] Bugfix [ ] Enhancement [x] Documentation content changes [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Build related changes [ ] CI related changes [ ] Infrastructure changes [ ] Other... Please describe: ``` ## What is the current behavior? Button, chips, whiteframe, and tabs demos are significantly broken in dark mode. This makes testing theme or component changes in dark mode more difficult. <!-- Please describe the current behavior that you are modifying and link to one or more relevant issues. --> Issue Number: Relates to #11376 ## What is the new behavior? - better support for dark mode in docs and demos - style anchors to be more readable in dark mode - fix site-toolbar in dark mode and remove unused styles - fix supported browsers table in dark mode - fix button, chips, tabs, whiteframe demos in dark mode ## Does this PR introduce a breaking change? ``` [ ] Yes [x] No ``` <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. --> <!-- Note that breaking changes are highly unlikely to get merged to master unless the validation is clear and the use case is critical. --> ## Other information
1 parent 4cecebb commit afc2262

File tree

14 files changed

+24
-64
lines changed

14 files changed

+24
-64
lines changed

docs/app/css/style.css

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ a {
7575
text-decoration: none;
7676
font-weight: 400;
7777
transition: border-bottom 0.35s;
78+
color: #1e88e5;
79+
}
80+
a:visited {
81+
color: #7e57c2;
7882
}
7983
h1, h2, h3, h4, h5, h6 {
8084
margin-bottom: 1rem;
@@ -432,10 +436,6 @@ a.docs-logo {
432436
font-size: 24px !important;
433437
font-weight: 400 !important;
434438
}
435-
.md-breadcrumb md-icon {
436-
color: #666 !important;
437-
fill: #666 !important;
438-
}
439439
.md-breadcrumb-page {
440440
display: inline-block;
441441
word-wrap: break-word;
@@ -799,13 +799,6 @@ docs-demo .doc-demo-content {
799799
margin: 16px;
800800
}
801801
.site-content-toolbar {
802-
background: #f6f6f6 !important;
803-
color: #666 !important;
804-
z-index: 3;
805-
}
806-
.site-content-toolbar {
807-
background: #f6f6f6 !important;
808-
color: #202020 !important;
809802
z-index: 3;
810803
}
811804
.service-desc {
@@ -889,6 +882,7 @@ table.custom-table {
889882
box-shadow: 0 1px 2px rgba(10, 16, 20, 0.24), 0 0 2px rgba(10, 16, 20, 0.12);
890883
border-radius: 2px;
891884
background: #fafafa;
885+
color: rgba(0,0,0,0.87);
892886
border-spacing: 0;
893887
}
894888
table.custom-table thead > {

docs/app/js/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ function(SERVICES, COMPONENTS, DEMOS, PAGES,
6262
.primaryPalette('yellow')
6363
.dark();
6464

65+
$mdThemingProvider.theme('site-toolbar')
66+
.primaryPalette('grey', {
67+
'default': '100'
68+
});
69+
6570
$mdIconProvider.icon('md-toggle-arrow', 'img/icons/toggle-arrow.svg', 48);
6671
$mdIconProvider
6772
.iconSet('communication', 'img/icons/sets/communication-icons.svg', 24)

docs/config/template/index.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ <h2 class="menu-heading md-subhead" ng-if="section.type === 'heading'" id="headi
5454
</md-sidenav>
5555

5656
<div layout="column" tabIndex="-1" role="main" flex>
57-
<md-toolbar class="md-whiteframe-glow-z1 site-content-toolbar">
57+
<md-toolbar class="md-whiteframe-glow-z1 site-content-toolbar" md-theme="site-toolbar">
5858

5959
<div class="md-toolbar-tools docs-toolbar-tools" tabIndex="-1">
6060
<md-button class="md-icon-button" ng-click="openMenu()" hide-gt-sm aria-label="Toggle Menu">

src/components/button/demoBasicUsage/index.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<div ng-controller="AppCtrl" ng-cloak>
32
<md-content>
43

@@ -9,6 +8,7 @@
98
<md-button class="md-warn">{{title4}}</md-button>
109
<div class="label">Flat</div>
1110
</section>
11+
<md-divider></md-divider>
1212

1313
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
1414
<md-button class="md-raised">Button</md-button>
@@ -17,6 +17,7 @@
1717
<md-button class="md-raised md-warn">Warn</md-button>
1818
<div class="label">Raised</div>
1919
</section>
20+
<md-divider></md-divider>
2021

2122
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
2223
<md-button class="md-fab" aria-label="Eat cake">
@@ -44,14 +45,17 @@
4445
</md-button>
4546
<div class="label">FAB</div>
4647
</section>
48+
<md-divider></md-divider>
4749

4850
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
4951
<md-button ng-href="{{googleUrl}}" target="_blank">Default Link</md-button>
50-
<md-button class="md-primary" ng-href="{{googleUrl}}" target="_blank">Primary Link</md-button>
51-
52+
<md-button class="md-primary" ng-href="{{googleUrl}}" target="_blank">
53+
Primary Link
54+
</md-button>
5255
<md-button>Default Button</md-button>
5356
<div class="label">Link vs. Button</div>
5457
</section>
58+
<md-divider></md-divider>
5559

5660
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
5761
<md-button class="md-primary md-hue-1">Primary Hue 1</md-button>
@@ -60,6 +64,7 @@
6064
<md-button class="md-accent md-raised md-hue-1">Accent Hue 1</md-button>
6165
<div class="label">Themed</div>
6266
</section>
67+
<md-divider></md-divider>
6368

6469
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
6570
<md-button class="md-icon-button md-primary" aria-label="Settings">
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
2-
angular.module('buttonsDemo1', ['ngMaterial'])
3-
1+
angular.module('buttonsDemoBasic', ['ngMaterial'])
42
.controller('AppCtrl', function($scope) {
53
$scope.title1 = 'Button';
64
$scope.title4 = 'Warn';
75
$scope.isDisabled = true;
8-
96
$scope.googleUrl = 'http://google.com';
10-
117
});

src/components/button/demoBasicUsage/style.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
section {
2-
background: #f7f7f7;
32
border-radius: 3px;
43
text-align: center;
54
margin: 1em;
65
position: relative !important;
7-
padding-bottom: 10px;
8-
}
9-
md-content {
10-
margin-right: 7px;
116
}
127
section .md-button {
138
margin-top: 16px;

src/components/chips/demoCustomInputs/style.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ input[type=number] {
1212
}
1313
.veggie-option .md-item-text {
1414
padding: 8px;
15-
background: #f0f0f0;
1615
border-radius: 3px;
1716
}
1817
.veggie-option .md-item-text h3,

src/components/tabs/demoDynamicHeight/style.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
md-content {
2-
background-color: transparent !important;
3-
md-tabs {
4-
background: #f6f6f6;
5-
border: 1px solid #e1e1e1;
6-
md-tabs-wrapper {
7-
background: white;
8-
}
9-
}
102
h1:first-child {
113
margin-top: 0;
124
}

src/components/tabs/demoDynamicTabs/style.scss

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
md-content {
2-
background-color: transparent !important;
3-
md-tabs {
4-
border: 1px solid #e1e1e1;
5-
md-tab-content {
6-
background: #f6f6f6;
7-
}
8-
md-tabs-wrapper {
9-
background: white;
10-
}
11-
}
122
h1:first-child {
133
margin-top: 0;
144
}
@@ -26,16 +16,12 @@ md-input-container {
2616
.edit-form input {
2717
width: 100%;
2818
}
29-
md-tabs {
30-
border-bottom: 1px solid rgba(0,0,0,0.12);
31-
}
3219
md-tab[disabled] {
3320
opacity: 0.5;
3421
}
3522
label {
3623
text-align: left;
3724
}
38-
3925
.long > input {
4026
width: 264px;
4127
}

src/components/tabs/demoStaticTabs/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<div ng-controller="AppCtrl" ng-cloak>
22
<md-content class="md-padding">
3-
<md-tabs class="md-accent" md-selected="data.selectedIndex" md-align-tabs="{{data.bottom ? 'bottom' : 'top'}}">
3+
<md-tabs class="md-primary" md-selected="data.selectedIndex"
4+
md-align-tabs="{{data.bottom ? 'bottom' : 'top'}}">
45
<md-tab id="tab1">
56
<md-tab-label>Item One</md-tab-label>
67
<md-tab-body>

src/components/tabs/demoStaticTabs/style.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
md-content {
22
md-tabs {
3-
border: 1px solid #e1e1e1;
43
md-tab-content {
54
padding: 25px;
65
&:nth-child(1) {
@@ -23,14 +22,14 @@ md-content {
2322
}
2423
.after-tabs-area {
2524
> span {
26-
margin-top:25px;
25+
margin-top: 25px;
2726
padding-right: 15px;
2827
vertical-align: middle;
2928
line-height: 30px;
3029
height: 35px;
3130
}
3231
> md-checkbox {
33-
margin-top:26px;
32+
margin-top: 26px;
3433
margin-left: 0;
3534
}
3635
}

src/components/whiteframe/demoBasicClassUsage/style.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
md-whiteframe {
2-
background: #fff;
32
margin: 30px;
43
height: 100px;
54
}
@@ -9,7 +8,6 @@ md-whiteframe {
98
md-whiteframe {
109
margin: 7px;
1110
height: 50px;
12-
background-color: #c8e4fa;
1311
}
1412
md-whiteframe > span {
1513
font-size: 0.4em;
@@ -32,7 +30,6 @@ md-whiteframe {
3230
md-whiteframe {
3331
margin: 20px;
3432
height: 90px;
35-
background-color: #fcddde;
3633
}
3734
md-whiteframe > span {
3835
font-size: 0.9em;
@@ -44,7 +41,6 @@ md-whiteframe {
4441
md-whiteframe {
4542
margin: 25px;
4643
height: 100px;
47-
background-color: #F2FCE2;
4844
}
4945
md-whiteframe > span {
5046
font-size: 1.0em;

src/components/whiteframe/demoDirectiveAttributeUsage/style.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
md-whiteframe, div.padded {
2-
background: #fff;
32
margin: 30px;
43
height: 100px;
54
}
@@ -9,7 +8,6 @@ md-whiteframe, div.padded {
98
md-whiteframe, div.padded {
109
margin: 7px;
1110
height: 50px;
12-
background-color: #c8e4fa;
1311
}
1412
md-whiteframe > span, div.padded > span {
1513
font-size: 0.4em;
@@ -32,7 +30,6 @@ md-whiteframe, div.padded {
3230
md-whiteframe, div.padded {
3331
margin: 20px;
3432
height: 90px;
35-
background-color: #fcddde;
3633
}
3734
md-whiteframe > span, div.padded > span {
3835
font-size: 0.9em;
@@ -44,7 +41,6 @@ md-whiteframe, div.padded {
4441
md-whiteframe, div.padded {
4542
margin: 25px;
4643
height: 100px;
47-
background-color: #F2FCE2;
4844
}
4945
md-whiteframe > span, div.padded > span {
5046
font-size: 1.0em;

src/components/whiteframe/demoDirectiveInterpolation/style.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
md-whiteframe, div.padded {
2-
background: #fff;
32
height: 100px;
43
}
54

@@ -16,7 +15,6 @@ md-whiteframe:focus, div.padded:focus {
1615
md-whiteframe, div.padded {
1716
margin: 7px;
1817
height: 50px;
19-
background-color: #c8e4fa;
2018
}
2119
md-whiteframe > span, div.padded > span {
2220
font-size: 0.4em;
@@ -37,7 +35,6 @@ md-whiteframe:focus, div.padded:focus {
3735
@media (min-width: 960px ) and (max-width: 1279px) {
3836
md-whiteframe, div.padded {
3937
height: 90px;
40-
background-color: #fcddde;
4138
}
4239
md-whiteframe > span, div.padded > span {
4340
font-size: 0.9em;
@@ -48,7 +45,6 @@ md-whiteframe:focus, div.padded:focus {
4845
@media (min-width: 1280px) {
4946
md-whiteframe, div.padded {
5047
height: 100px;
51-
background-color: #F2FCE2;
5248
}
5349
md-whiteframe > span, div.padded > span {
5450
font-size: 1.0em;

0 commit comments

Comments
 (0)