Skip to content

Commit c0353e1

Browse files
committed
fix(speeddial): closer to sepcs
1 parent 1222d90 commit c0353e1

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

src/speeddial/index.ts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,41 +40,53 @@ function transformAnimationValues(values: AnimationDefinition[]) {
4040
});
4141
}
4242

43+
const defaultSpeedDialItemTitleRippleColor = new Color('#797979');
44+
const defaultSpeedDialItemTitleBackgroundColor = new Color('white');
45+
4346
@CSSType('MDSpeedDialItemTitle')
4447
export class SpeedDialItemTitle extends Button {
4548
constructor() {
4649
super();
4750
this.verticalAlignment = 'middle';
4851
this.style['css:text-transform'] = 'none';
49-
this.style['css:background-color'] = 'white';
50-
this.style['css:ripple-color'] = '#797979';
51-
this.style['css:color'] = '#797979';
52-
this.style['css:elevation'] = 2;
52+
this.style['css:background-color'] = defaultSpeedDialItemTitleBackgroundColor;
53+
this.style['css:ripple-color'] = defaultSpeedDialItemTitleRippleColor;
54+
this.style['css:color'] = defaultSpeedDialItemTitleRippleColor;
55+
this.style['css:elevation'] = 1;
5356
this.style['css:border-radius'] = 6;
5457
this.style['css:font-size'] = 10;
5558
this.style['css:min-width'] = 0;
5659
this.style['css:min-height'] = 0;
5760
this.style['css:padding'] = 4;
5861
}
62+
getDefaultElevation(): number {
63+
return 1;
64+
}
65+
66+
getDefaultDynamicElevationOffset(): number {
67+
return 2;
68+
}
5969
}
6070
@CSSType('MDSpeedDialItemButton')
6171
export class SpeedDialItemButton extends Button {
6272
constructor() {
6373
super();
6474
this.verticalAlignment = 'middle';
6575
this.style['css:font-size'] = 26;
66-
// this.style['css:border-radius'] = 28;
67-
// this.style['css:width'] = 56;
68-
// this.style['css:height'] = 56;
69-
// this.style['css:margin'] = 16;
70-
// this.style['css:dynamic-elevation-offset'] = 2;
71-
// this.style['css:font-size'] = 26;
76+
this.style['css:elevation'] = 6;
77+
// this.style['css:dynamic-elevation-offset'] = 6;
78+
}
79+
getDefaultElevation(): number {
80+
return 6;
81+
}
82+
83+
getDefaultDynamicElevationOffset(): number {
84+
return 6;
7285
}
7386
}
7487
@CSSType('MDSpeedDialButton')
75-
export class SpeedDialButton extends SpeedDialItemButton {
88+
export class SpeedDialButton extends SpeedDialItemButton {}
7689

77-
}
7890
@CSSType('MDSpeedDialItem')
7991
export class SpeedDialItem extends SpeedDialItemBase {
8092
public actualActive: boolean = false;
@@ -99,13 +111,11 @@ export class SpeedDialItem extends SpeedDialItemBase {
99111
this.button.style['css:width'] = 40;
100112
this.button.style['css:height'] = 40;
101113
this.button.style['css:margin'] = 16;
102-
this.button.style['css:dynamic-elevation-offset'] = 2;
103114
} else {
104115
this.button.style['css:border-radius'] = 28;
105116
this.button.style['css:width'] = 56;
106117
this.button.style['css:height'] = 56;
107118
this.button.style['css:margin'] = 16;
108-
this.button.style['css:dynamic-elevation-offset'] = 4;
109119
}
110120
(this as any).columns = this.fabColumns;
111121
this.addChild(this.titleView);

0 commit comments

Comments
 (0)