mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
216 lines
4.9 KiB
SCSS
216 lines
4.9 KiB
SCSS
@import "../../../globals.ios";
|
|
@import "../button";
|
|
|
|
// iOS Button
|
|
// --------------------------------------------------
|
|
|
|
$button-ios-margin: 0.4rem 0.2rem !default;
|
|
$button-ios-padding: 0 1em !default;
|
|
$button-ios-font-size: 1.6rem !default;
|
|
$button-ios-height: 2.8em !default;
|
|
$button-ios-color: map-get($colors-ios, primary) !default;
|
|
$button-ios-color-activated: color-shade($button-ios-color) !default;
|
|
$button-ios-text-color: inverse($button-ios-color) !default;
|
|
$button-ios-hover-opacity: 0.8 !default;
|
|
$button-ios-border-radius: 4px !default;
|
|
|
|
$button-ios-large-font-size: 2rem !default;
|
|
$button-ios-large-height: 2.8em !default;
|
|
$button-ios-large-padding: 1.0em !default;
|
|
$button-ios-small-font-size: 1.3rem !default;
|
|
$button-ios-small-height: 2.1em !default;
|
|
$button-ios-small-padding: 0.9em !default;
|
|
$button-ios-small-icon-font-size: 1.3em !default;
|
|
|
|
|
|
// iOS Default Button
|
|
// --------------------------------------------------
|
|
|
|
.button {
|
|
margin: $button-ios-margin;
|
|
padding: $button-ios-padding;
|
|
|
|
min-height: $button-ios-height;
|
|
font-size: $button-ios-font-size;
|
|
|
|
border-radius: $button-ios-border-radius;
|
|
color: $button-ios-text-color;
|
|
background-color: $button-ios-color;
|
|
|
|
&:hover:not(.disable-hover) {
|
|
opacity: $button-ios-hover-opacity;
|
|
text-decoration: none;
|
|
}
|
|
|
|
&.activated {
|
|
opacity: 1;
|
|
background-color: $button-ios-color-activated;
|
|
}
|
|
}
|
|
|
|
|
|
// iOS Default Button Color Mixin
|
|
// --------------------------------------------------
|
|
|
|
@mixin ios-button-default($color-name, $color-value) {
|
|
|
|
.button-#{$color-name} {
|
|
$bg-color: $color-value;
|
|
$bg-color-activated: color-shade($bg-color);
|
|
$fg-color: inverse($bg-color);
|
|
|
|
color: $fg-color;
|
|
background-color: $bg-color;
|
|
|
|
&.activated {
|
|
background-color: $bg-color-activated;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// iOS Button Sizes
|
|
// --------------------------------------------------
|
|
|
|
.button-large {
|
|
padding: 0 $button-ios-large-padding;
|
|
min-height: $button-ios-large-height;
|
|
font-size: $button-ios-large-font-size;
|
|
}
|
|
|
|
.button-small {
|
|
padding: 0 $button-ios-small-padding;
|
|
min-height: $button-ios-small-height;
|
|
font-size: $button-ios-small-font-size;
|
|
}
|
|
|
|
.button-small.button-icon-only icon {
|
|
font-size: $button-ios-small-icon-font-size;
|
|
}
|
|
|
|
// iOS Block Button
|
|
// --------------------------------------------------
|
|
|
|
.button-block {
|
|
// This fixes an issue with flexbox and button on iOS Safari. See #225
|
|
display: block;
|
|
line-height: 2.8em;
|
|
}
|
|
|
|
|
|
// iOS Full Button
|
|
// --------------------------------------------------
|
|
|
|
.button-full {
|
|
margin-right: 0;
|
|
margin-left: 0;
|
|
border-radius: 0;
|
|
border-left: none;
|
|
border-right: none;
|
|
}
|
|
|
|
|
|
// iOS Outline Button
|
|
// --------------------------------------------------
|
|
|
|
.button-outline {
|
|
border: 1px solid $button-ios-color;
|
|
background-color: transparent;
|
|
color: $button-ios-color;
|
|
|
|
&.activated {
|
|
opacity: 1;
|
|
color: $background-ios-color;
|
|
background-color: $button-ios-color;
|
|
}
|
|
}
|
|
|
|
|
|
// iOS Outline Button Color Mixin
|
|
// --------------------------------------------------
|
|
|
|
@mixin ios-button-outline($color-name, $color-value) {
|
|
|
|
.button-outline-#{$color-name} {
|
|
$fg-color: color-shade($color-value, 5%);
|
|
border-color: $fg-color;
|
|
background-color: transparent;
|
|
color: $fg-color;
|
|
|
|
&.activated {
|
|
color: $background-ios-color;
|
|
background-color: $fg-color;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// iOS Clear Button
|
|
// --------------------------------------------------
|
|
|
|
.button-clear {
|
|
border-color: transparent;
|
|
color: color-shade($button-ios-color);
|
|
background-color: transparent;
|
|
|
|
&.activated {
|
|
opacity: 0.4;
|
|
background-color: transparent;
|
|
}
|
|
|
|
&:hover:not(.disable-hover) {
|
|
opacity: 0.6;
|
|
color: color-shade($button-ios-color);
|
|
}
|
|
}
|
|
|
|
|
|
// iOS Clear Button Color Mixin
|
|
// --------------------------------------------------
|
|
|
|
@mixin ios-button-clear($color-name, $color-value) {
|
|
|
|
.button-clear-#{$color-name} {
|
|
$fg-color: color-shade($color-value);
|
|
border-color: transparent;
|
|
background-color: transparent;
|
|
color: $fg-color;
|
|
|
|
&.activated {
|
|
opacity: 0.4;
|
|
background-color: transparent;
|
|
}
|
|
|
|
&:hover:not(.disable-hover) {
|
|
color: color-shade($fg-color);
|
|
}
|
|
}
|
|
}
|
|
|
|
// iOS Round Button
|
|
// --------------------------------------------------
|
|
|
|
.button-round {
|
|
padding: $button-round-padding;
|
|
border-radius: $button-round-border-radius;
|
|
}
|
|
|
|
|
|
// Generate iOS Button Colors
|
|
// --------------------------------------------------
|
|
|
|
@each $color-name, $color-value in $colors-ios {
|
|
@include ios-button-default($color-name, $color-value);
|
|
@include ios-button-outline($color-name, $color-value);
|
|
@include ios-button-clear($color-name, $color-value);
|
|
}
|
|
|
|
|
|
// Core Button Overrides
|
|
// --------------------------------------------------
|
|
|
|
@import "../button-fab";
|
|
@import "../button-icon";
|