Skip to content

Commit 45a1975

Browse files
committed
feat(scroll): styling scroll
feat(getmdl-select): stylization fix(dropdown): profile info cuts dropdown #7
1 parent f52d776 commit 45a1975

File tree

10 files changed

+85
-4
lines changed

10 files changed

+85
-4
lines changed

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"src/theme/styles.scss"
2424
],
2525
"scripts": [
26-
"node_modules/material-design-lite/material.js"
26+
"node_modules/material-design-lite/material.js",
27+
"node_modules/getmdl-select/getmdl-select.min.js"
2728
]
2829
},
2930
"configurations": {

src/app/pages/ui/forms/forms.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h5 class="mdl-card__title-text text-color--white">PROFILE INFO</h5>
7070
</div>
7171
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label getmdl-select full-size">
7272
<input class="mdl-textfield__input" type="text" id="location" readonly tabIndex="-1"/>
73-
73+
<input type="hidden" value="" name="location">
7474
<label class="mdl-textfield__label" for="location">Location</label>
7575

7676
<ul class="mdl-menu mdl-menu--bottom-left mdl-js-menu dark_dropdown" for="location">
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, HostBinding } from '@angular/core';
1+
import { AfterViewInit, Component, HostBinding } from '@angular/core';
22

33
import { UpgradableComponent } from 'theme/components/upgradable';
44

@@ -7,11 +7,16 @@ import { UpgradableComponent } from 'theme/components/upgradable';
77
templateUrl: './forms.component.html',
88
styleUrls: ['./forms.component.scss'],
99
})
10-
export class FormsComponent extends UpgradableComponent {
10+
export class FormsComponent extends UpgradableComponent implements AfterViewInit {
1111
@HostBinding('class.mdl-grid') private readonly mdlGrid = true;
1212
@HostBinding('class.mdl-cell') private readonly mdlCell = true;
1313
@HostBinding('class.mdl-cell--12-col-desktop') private readonly mdlCell12ColDesktop = true;
1414
@HostBinding('class.mdl-cell--12-col-tablet') private readonly mdlCell12ColTablet = true;
1515
@HostBinding('class.mdl-cell--4-col-phone') private readonly mdlCell4ColPhone = true;
1616
@HostBinding('class.mdl-cell--top') private readonly mdlCellTop = true;
17+
18+
public ngAfterViewInit() {
19+
getmdlSelect.init('.getmdl-select');
20+
componentHandler.upgradeDom();
21+
}
1722
}

src/theme/components/card/card.component.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.mdl-card__supporting-text {
88
line-height: 22px;
99
width: calc(100% - #{$card-horizontal-padding*2});
10+
overflow: visible;
1011
}
1112

1213
.mdl-card__actions {
@@ -15,4 +16,5 @@
1516

1617
.mdl-card {
1718
height: 100%;
19+
overflow: visible;
1820
}

src/theme/scss/_variables.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,7 @@ $weather-shadow-4px: 4px 4px 4px $weather-shadow-color;
275275

276276
/* row */
277277
$row-col-padding: 30px;
278+
279+
/* scroll */
280+
$scrollbar-thumb: $color-smooth-gray;
281+
$scrollbar-track: $color-smoke;

src/theme/scss/getmdl-select.scss

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.getmdl-select {
2+
width: 100%;
3+
4+
.mdl-textfield__input:focus {
5+
outline: none;
6+
}
7+
8+
.selected {
9+
background-color: $default-dropdown-bg-color;
10+
}
11+
12+
&.is-focused {
13+
.mdl-icon-toggle__label {
14+
color: $color-primary;
15+
}
16+
}
17+
18+
.mdl-menu__item {
19+
color: $text-color-primary;
20+
}
21+
22+
// custom scroll
23+
::-webkit-scrollbar {
24+
width: 0.5rem;
25+
height: 0.5rem;
26+
}
27+
28+
::-webkit-scrollbar-thumb {
29+
background: $scrollbar-thumb;
30+
cursor: pointer;
31+
}
32+
33+
::-webkit-scrollbar-track {
34+
background: $scrollbar-track;
35+
}
36+
}

src/theme/scss/layout.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,21 @@ main {
167167
}
168168
}
169169

170+
// custom scroll
171+
::-webkit-scrollbar {
172+
width: 0.5rem;
173+
height: 0.5rem;
174+
}
175+
176+
::-webkit-scrollbar-thumb {
177+
background: $scrollbar-thumb;
178+
cursor: pointer;
179+
}
180+
181+
::-webkit-scrollbar-track {
182+
background: $scrollbar-track;
183+
}
184+
170185
@media screen and (max-width: $layout-screen-size-threshold) {
171186
.mdl-layout--fixed-drawer {
172187
main {

src/theme/scss/textfield.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33

44
.mdl-textfield__input {
55
@include typo-textfield-input;
6+
7+
&:-webkit-autofill {
8+
border-color: #6b6b6b !important;
9+
}
10+
11+
&:-webkit-autofill,
12+
&:-webkit-autofill:hover,
13+
&:-webkit-autofill:focus,
14+
&:-webkit-autofill:active {
15+
-webkit-box-shadow: 0 0 0 30px $background-color inset;
16+
-webkit-text-fill-color: $color-white !important;
17+
border-color: $color-primary;
18+
}
619
}
720

821
&.full-size {

src/theme/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import '~nvd3/build/nv.d3.css';
33
@import '~material-design-lite/src/material-design-lite.scss';
44
@import '~getmdl-select/src/scss/getmdl-select.scss';
5+
@import './scss/getmdl-select';
56
@import './scss/layout';
67
@import './scss/chip';
78
@import './scss/badge';

src/typings.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ declare var module: NodeModule;
33
interface NodeModule {
44
id: string;
55
}
6+
7+
declare var getmdlSelect: {
8+
init: any;
9+
};

0 commit comments

Comments
 (0)