Skip to content

Commit

Permalink
feat(fab): Introduces new floating action buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Sep 20, 2016
1 parent a98e209 commit e16d3e9
Show file tree
Hide file tree
Showing 22 changed files with 643 additions and 176 deletions.
58 changes: 0 additions & 58 deletions src/components/button/button-fab.scss

This file was deleted.

8 changes: 0 additions & 8 deletions src/components/button/button.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,6 @@ $button-ios-fab-border-radius: 50% !default;
}


// iOS FAB Button
// --------------------------------------------------

.button-fab-ios {
border-radius: $button-ios-fab-border-radius;
}


// Generate iOS Button Colors
// --------------------------------------------------

Expand Down
17 changes: 0 additions & 17 deletions src/components/button/button.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -394,23 +394,6 @@ $button-md-fab-box-shadow-activated: 0 5px 15px 0 rgba(0, 0, 0, .4),
border-radius: $button-md-round-border-radius;
}


// Material Design FAB Button
// --------------------------------------------------

.button-fab-md {
border-radius: $button-md-fab-border-radius;
box-shadow: $button-md-fab-box-shadow;

transition: box-shadow $button-md-transition-duration $button-md-transition-timing-function,
background-color $button-md-transition-duration $button-md-transition-timing-function,
color $button-md-transition-duration $button-md-transition-timing-function;
}

.button-fab-md.activated {
box-shadow: $button-md-fab-box-shadow-activated;
}

.button-md [icon-only] {
padding: 0;
}
Expand Down
8 changes: 0 additions & 8 deletions src/components/button/button.wp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,6 @@ $button-wp-fab-border-radius: 50% !default;
border-radius: $button-wp-round-border-radius;
}


// Windows FAB Button
// --------------------------------------------------

.button-fab-wp {
border-radius: $button-wp-fab-border-radius;
}

.button-wp [icon-only] {
padding: 0;
}
Expand Down
30 changes: 0 additions & 30 deletions src/components/button/test/fab/app-module.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/components/button/test/fab/e2e.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/components/button/test/fab/main.html

This file was deleted.

21 changes: 8 additions & 13 deletions src/components/content/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,17 @@ ion-content.js-scroll > .scroll-content {
right: 0;
bottom: 0;
left: 0;
z-index: $z-index-scroll-content;
display: block;
}

[ion-fixed] {
position: absolute;

z-index: $z-index-fixed-content;

transform: translateZ(0);
}


// Content Padding
// --------------------------------------------------
Expand Down Expand Up @@ -165,15 +172,3 @@ ion-content.js-scroll > .scroll-content {
margin-left: $content-margin;
}
}


// Content Fixed
// --------------------------------------------------

ion-fixed {
position: absolute;

z-index: $z-index-fixed-content;

transform: translateZ(0);
}
4 changes: 2 additions & 2 deletions src/components/content/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ import { isTrueProperty } from '../../util/util';
selector: 'ion-content',
template:
'<div class="fixed-content">' +
'<ng-content select="[ion-fixed]"></ng-content>' +
'<ng-content select="[ion-fixed],ion-fab"></ng-content>' +
'</div>' +
'<div class="scroll-content">' +
'<ng-content></ng-content>' +
Expand Down Expand Up @@ -182,7 +182,7 @@ export class Content extends Ion {
* @private
*/
ngOnInit() {
this._fixedEle = this._elementRef.nativeElement.children[0];
this._fixedEle = this._elementRef.nativeElement.children[0];
this._scrollEle = this._elementRef.nativeElement.children[1];

this._zone.runOutsideAngular(() => {
Expand Down
37 changes: 37 additions & 0 deletions src/components/fab/fab.ios.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@import "../../themes/ionic.globals.ios";

// iOS FAB Button
// --------------------------------------------------

/// @prop - Border radius of the FAB button
$button-ios-fab-border-radius: 50% !default;

.fab-button {
border-radius: $button-ios-fab-border-radius;
}

// iOS does not use the button effect
ion-button-effect {
display: none;
}


// Generate iOS FAB colors
// --------------------------------------------------

@each $color-name, $color-base, $color-contrast in get-colors($colors-ios) {

$background-color: $color-base;
$background-color-activated: color-shade($background-color);
$fg-color: $color-contrast;

.fab-ios-#{$color-name} {
color: $fg-color;
background-color: $background-color;
}

.fab-ios-#{$color-name}.activated {
background-color: $background-color-activated;
}
}

51 changes: 51 additions & 0 deletions src/components/fab/fab.md.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@import "../../themes/ionic.globals.md";

// Material Design FAB Button
// --------------------------------------------------

/// @prop - Border radius of the FAB button
$button-md-fab-border-radius: 50% !default;

/// @prop - Box shadow of the FAB button
$button-md-fab-box-shadow: 0 4px 6px 0 rgba(0, 0, 0, .14), 0 4px 5px rgba(0, 0, 0, .1) !default;

/// @prop - Box shadow of the activated FAB button
$button-md-fab-box-shadow-activated: 0 5px 15px 0 rgba(0, 0, 0, .4), 0 4px 7px 0 rgba(0, 0, 0, .1) !default;


.fab-button {
border-radius: $button-md-fab-border-radius;
box-shadow: $button-md-fab-box-shadow;

transition: box-shadow $button-md-transition-duration $button-md-transition-timing-function,
background-color $button-md-transition-duration $button-md-transition-timing-function,
color $button-md-transition-duration $button-md-transition-timing-function;

&.activated {
box-shadow: $button-md-fab-box-shadow-activated;
}
}

[icon-only] {
padding: 0;
}

// Generate iOS FAB colors
// --------------------------------------------------

@each $color-name, $color-base, $color-contrast in get-colors($colors-md) {

$background-color: $color-base;
$background-color-activated: color-shade($background-color);
$fg-color: $color-contrast;

.fab-md-#{$color-name} {
color: $fg-color;
background-color: $background-color;
}

.fab-md-#{$color-name}.activated {
background-color: $background-color-activated;
}
}

0 comments on commit e16d3e9

Please sign in to comment.