| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516 |
- @import "../../themes/ionic.globals.md";
-
- // Material Design Button
- // --------------------------------------------------
-
- // deprecated
- $button-md-margin: null !default;
-
- /// @prop - Margin top of the button
- $button-md-margin-top: .4rem !default;
-
- /// @prop - Margin end of the button
- $button-md-margin-end: .2rem !default;
-
- /// @prop - Margin bottom of the button
- $button-md-margin-bottom: .4rem !default;
-
- /// @prop - Margin start of the button
- $button-md-margin-start: .2rem !default;
-
- // deprecated
- $button-md-padding: null !default;
-
- /// @prop - Padding top of the button
- $button-md-padding-top: 0 !default;
-
- /// @prop - Padding end of the button
- $button-md-padding-end: 1.1em !default;
-
- /// @prop - Padding bottom of the button
- $button-md-padding-bottom: $button-md-padding-top !default;
-
- /// @prop - Padding start of the button
- $button-md-padding-start: $button-md-padding-end !default;
-
- /// @prop - Height of the button
- $button-md-height: 3.6rem !default;
-
- /// @prop - Border radius of the button
- $button-md-border-radius: 2px !default;
-
- /// @prop - Font size of the button text
- $button-md-font-size: 1.4rem !default;
-
- /// @prop - Font weight of the button text
- $button-md-font-weight: 500 !default;
-
- /// @prop - Capitalization of the button text
- $button-md-text-transform: uppercase !default;
-
- /// @prop - Background color of the button
- $button-md-background-color: color($colors-md, primary) !default;
-
- /// @prop - Text color of the button
- $button-md-text-color: color-contrast($colors-md, $button-md-background-color) !default;
-
- /// @prop - Box shadow of the button
- $button-md-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12) !default;
-
- /// @prop - Duration of the transition of the button
- $button-md-transition-duration: 300ms !default;
-
- /// @prop - Speed curve of the transition of the button
- $button-md-transition-timing-function: cubic-bezier(.4, 0, .2, 1) !default;
-
- /// @prop - Background color of the button on hover
- $button-md-background-color-hover: $button-md-background-color !default;
-
- /// @prop - Background color of the activated button
- $button-md-background-color-activated: color-shade($button-md-background-color) !default;
-
- /// @prop - Opacity of the activated button
- $button-md-opacity-activated: 1 !default;
-
- /// @prop - Box shadow of the activated button
- $button-md-box-shadow-activated: 0 3px 5px rgba(0, 0, 0, .14), 0 3px 5px rgba(0, 0, 0, .21), 0 0 0 0 transparent !default;
-
- /// @prop - Background color of the ripple on the button
- $button-md-ripple-background-color: #555 !default;
-
-
- // Material Design Large Button
- // --------------------------------------------------
-
- // deprecated
- $button-md-large-padding: null !default;
-
- /// @prop - Padding top of the large button
- $button-md-large-padding-top: 0 !default;
-
- /// @prop - Padding end of the large button
- $button-md-large-padding-end: 1em !default;
-
- /// @prop - Padding bottom of the large button
- $button-md-large-padding-bottom: $button-md-large-padding-top !default;
-
- /// @prop - Padding start of the large button
- $button-md-large-padding-start: $button-md-large-padding-end !default;
-
- /// @prop - Height of the large button
- $button-md-large-height: 2.8em !default;
-
- /// @prop - Font size of the large button
- $button-md-large-font-size: 2rem !default;
-
-
- // Material Design Small Button
- // --------------------------------------------------
-
- // deprecated
- $button-md-small-padding: null !default;
-
- /// @prop - Padding top of the small button
- $button-md-small-padding-top: 0 !default;
-
- /// @prop - Padding end of the small button
- $button-md-small-padding-end: .9em !default;
-
- /// @prop - Padding bottom of the small button
- $button-md-small-padding-bottom: $button-md-small-padding-top !default;
-
- /// @prop - Padding start of the small button
- $button-md-small-padding-start: $button-md-small-padding-end !default;
-
- /// @prop - Height of the small button
- $button-md-small-height: 2.1em !default;
-
- /// @prop - Font size of the small button
- $button-md-small-font-size: 1.3rem !default;
-
- /// @prop - Font size of an icon in the small button
- $button-md-small-icon-font-size: 1.4em !default;
-
-
- // Material Design Outline Button
- // --------------------------------------------------
-
- /// @prop - Border width of the outline button
- $button-md-outline-border-width: 1px !default;
-
- /// @prop - Border style of the outline button
- $button-md-outline-border-style: solid !default;
-
- /// @prop - Border color of the outline button
- $button-md-outline-border-color: $button-md-background-color !default;
-
- /// @prop - Text color of the outline button
- $button-md-outline-text-color: $button-md-background-color !default;
-
- /// @prop - Background color of the outline button
- $button-md-outline-background-color: transparent !default;
-
- /// @prop - Box shadow of the outline button
- $button-md-outline-box-shadow: none !default;
-
- /// @prop - Background color of the outline button on hover
- $button-md-outline-background-color-hover: rgba(158, 158, 158, .1) !default;
-
- /// @prop - Background color of the activated outline button
- $button-md-outline-background-color-activated: transparent !default;
-
- /// @prop - Box shadow of the activated outline button
- $button-md-outline-box-shadow-activated: none !default;
-
- /// @prop - Opacity of the activated outline button
- $button-md-outline-opacity-activated: 1 !default;
-
- /// @prop - Background color of the ripple on the outline button
- $button-md-outline-ripple-background-color: $button-md-background-color !default;
-
-
- // Material Design Clear Button
- // --------------------------------------------------
-
- /// @prop - Border color of the clear button
- $button-md-clear-border-color: transparent !default;
-
- /// @prop - Text color of the clear button
- $button-md-clear-text-color: $button-md-background-color !default;
-
- /// @prop - Background color of the clear button
- $button-md-clear-background-color: transparent !default;
-
- /// @prop - Box shadow of the clear button
- $button-md-clear-box-shadow: none !default;
-
- /// @prop - Opacity of the clear button
- $button-md-clear-opacity: 1 !default;
-
- /// @prop - Background color of the activated clear button
- $button-md-clear-background-color-activated: rgba(158, 158, 158, .2) !default;
-
- /// @prop - Box shadow of the activated clear button
- $button-md-clear-box-shadow-activated: $button-md-clear-box-shadow !default;
-
- /// @prop - Background color of the clear button on hover
- $button-md-clear-background-color-hover: rgba(158, 158, 158, .1) !default;
-
- /// @prop - Background color of the ripple on the clear button
- $button-md-clear-ripple-background-color: #999 !default;
-
-
- // Material Design Round Button
- // --------------------------------------------------
-
- // deprecated
- $button-md-round-padding: null !default;
-
- /// @prop - Padding top of the round button
- $button-md-round-padding-top: $button-round-padding-top !default;
-
- /// @prop - Padding end of the round button
- $button-md-round-padding-end: $button-round-padding-end !default;
-
- /// @prop - Padding bottom of the round button
- $button-md-round-padding-bottom: $button-round-padding-bottom !default;
-
- /// @prop - Padding start of the round button
- $button-md-round-padding-start: $button-round-padding-start !default;
-
- /// @prop - Border radius of the round button
- $button-md-round-border-radius: $button-round-border-radius !default;
-
-
- // Material Design Decorator Button
- // --------------------------------------------------
-
- /// @prop - Font weight of the strong button
- $button-md-strong-font-weight: bold !default;
-
-
- // Material Design Default Button
- // --------------------------------------------------
-
- .button-md {
- @include border-radius($button-md-border-radius);
-
- overflow: hidden;
-
- height: $button-md-height;
-
- font-size: $button-md-font-size;
- font-weight: $button-md-font-weight;
-
- text-transform: $button-md-text-transform;
- color: $button-md-text-color;
- background-color: $button-md-background-color;
- box-shadow: $button-md-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;
-
- @include deprecated-variable(margin, $button-md-margin) {
- @include margin($button-md-margin-top, $button-md-margin-end, $button-md-margin-bottom, $button-md-margin-start);
- }
-
- @include deprecated-variable(padding, $button-md-padding) {
- @include padding($button-md-padding-top, $button-md-padding-end, $button-md-padding-bottom, $button-md-padding-start);
- }
- }
-
- .button-md:hover:not(.disable-hover) {
- background-color: $button-md-background-color-hover;
- }
-
- .button-md.activated {
- background-color: $button-md-background-color-activated;
- box-shadow: $button-md-box-shadow-activated;
- }
-
- .button-md .button-effect {
- background-color: $button-md-text-color;
- }
-
-
- // Material Design Default Button Color Mixin
- // --------------------------------------------------
-
- @mixin md-button-default($color-name, $color-base, $color-contrast) {
- $bg-color: $color-base;
- $bg-color-activated: color-shade($bg-color);
- $fg-color: $color-contrast;
-
- .button-md-#{$color-name} {
- color: $fg-color;
- background-color: $bg-color;
- }
-
- .button-md-#{$color-name}:hover:not(.disable-hover) {
- background-color: $bg-color;
- }
-
- .button-md-#{$color-name}.activated {
- background-color: $bg-color-activated;
- opacity: $button-md-opacity-activated;
- }
-
- .button-md-#{$color-name} .button-effect {
- background-color: $fg-color;
- }
- }
-
-
- // Material Design Button Sizes
- // --------------------------------------------------
-
- .button-large-md {
- height: $button-md-large-height;
-
- font-size: $button-md-large-font-size;
-
- @include deprecated-variable(padding, $button-md-large-padding) {
- @include padding($button-md-large-padding-top, $button-md-large-padding-end, $button-md-large-padding-bottom, $button-md-large-padding-start);
- }
- }
-
- .button-small-md {
- height: $button-md-small-height;
-
- font-size: $button-md-small-font-size;
-
- @include deprecated-variable(padding, $button-md-small-padding) {
- @include padding($button-md-small-padding-top, $button-md-small-padding-end, $button-md-small-padding-bottom, $button-md-small-padding-start);
- }
- }
-
- .button-small-md[icon-only] ion-icon {
- font-size: $button-md-small-icon-font-size;
- }
-
- // Material Design Block Button
- // --------------------------------------------------
-
- .button-block-md {
- @include margin-horizontal(0);
- }
-
- // Material Design Full Button
- // --------------------------------------------------
-
- .button-full-md {
- @include margin-horizontal(0);
- @include border-radius(0);
-
- border-right-width: 0;
- border-left-width: 0;
- }
-
- // Material Design Outline Button
- // --------------------------------------------------
-
- .button-outline-md {
- border-width: $button-md-outline-border-width;
- border-style: $button-md-outline-border-style;
- border-color: $button-md-outline-border-color;
- color: $button-md-outline-text-color;
- background-color: $button-md-outline-background-color;
- box-shadow: $button-md-outline-box-shadow;
- }
-
- .button-outline-md:hover:not(.disable-hover) {
- background-color: $button-md-outline-background-color-hover;
- }
-
- .button-outline-md.activated {
- background-color: $button-md-outline-background-color-activated;
- box-shadow: $button-md-outline-box-shadow-activated;
- opacity: $button-md-outline-opacity-activated;
- }
-
- .button-outline-md .button-effect {
- background-color: $button-md-outline-ripple-background-color;
- }
-
-
- // Material Design Outline Button Color Mixin
- // --------------------------------------------------
-
- @mixin md-button-outline($color-name, $color-base, $color-contrast) {
- $fg-color: color-shade($color-base, 5%);
-
- .button-outline-md-#{$color-name} {
- border-color: $fg-color;
- color: $fg-color;
- background-color: $button-md-outline-background-color;
- }
-
- .button-outline-md-#{$color-name}:hover:not(.disable-hover) {
- background-color: $button-md-outline-background-color-hover;
- }
-
- .button-outline-md-#{$color-name}.activated {
- background-color: $button-md-outline-background-color-activated;
- }
-
- .button-outline-md-#{$color-name} .button-effect {
- background-color: $fg-color;
- }
- }
-
-
- // Material Design Clear Button
- // --------------------------------------------------
-
- .button-clear-md {
- border-color: $button-md-clear-border-color;
- color: $button-md-background-color;
- background-color: $button-md-clear-background-color;
- box-shadow: $button-md-clear-box-shadow;
- opacity: $button-md-clear-opacity;
- }
-
- .button-clear-md.activated {
- background-color: $button-md-clear-background-color-activated;
- box-shadow: $button-md-clear-box-shadow-activated;
- }
-
- .button-clear-md:hover:not(.disable-hover) {
- background-color: $button-md-clear-background-color-hover;
- }
-
- .button-clear-md .button-effect {
- background-color: $button-md-clear-ripple-background-color;
- }
-
-
- // Material Design Clear Button Color Mixin
- // --------------------------------------------------
-
- @mixin md-button-clear($color-name, $color-base, $color-contrast) {
- $fg-color: $color-base;
-
- .button-clear-md-#{$color-name} {
- border-color: $button-md-clear-border-color;
- color: $fg-color;
- background-color: $button-md-clear-background-color;
- }
-
- .button-clear-md-#{$color-name}.activated {
- background-color: $button-md-clear-background-color-activated;
- box-shadow: $button-md-clear-box-shadow-activated;
- }
-
- .button-clear-md-#{$color-name}:hover:not(.disable-hover) {
- color: $fg-color;
- }
- }
-
-
- // Material Design Round Button
- // --------------------------------------------------
-
- .button-round-md {
- @include border-radius($button-md-round-border-radius);
-
- @include deprecated-variable(padding, $button-md-round-padding) {
- @include padding($button-md-round-padding-top, $button-md-round-padding-end, $button-md-round-padding-bottom, $button-md-round-padding-start);
- }
- }
-
- .button-md [icon-only] {
- @include padding(0);
- }
-
-
- // Material Design Ripple Effect
- // --------------------------------------------------
- // Only Material uses the button effect, so by default
- // it's display none, and .md sets to display block.
-
- .button-effect {
- @include border-radius(50%);
- @include transform-origin(center, center);
-
- position: absolute;
- z-index: 0;
- display: none;
-
- background-color: $button-md-ripple-background-color;
- opacity: .2;
-
- transition-timing-function: ease-in-out;
-
- pointer-events: none;
-
- @include multi-dir() {
- // scss-lint:disable PropertySpelling
- top: 0;
-
- left: 0;
- }
- }
-
- .md button .button-effect {
- display: block;
- }
-
-
- // Generate Material Design Button Colors
- // --------------------------------------------------
-
- @each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
- @include md-button-default($color-name, $color-base, $color-contrast);
- @include md-button-outline($color-name, $color-base, $color-contrast);
- @include md-button-clear($color-name, $color-base, $color-contrast);
- }
-
-
- // MD strong Button
- // --------------------------------------------------
-
- .button-strong-md {
- font-weight: $button-md-strong-font-weight;
- }
|