refactor(alert): add extra div to use as radio mark, fix Sass

Added spaces to separate groups of css, added variables, removed unused
css

BREAKING CHANGE: added Sass variables for alert

fixes #5577
This commit is contained in:
Brandy Carney
2016-03-14 12:54:10 -04:00
parent 96375b6e83
commit 131c8c366a
7 changed files with 436 additions and 199 deletions

View File

@ -13,7 +13,7 @@ linters:
enabled: true enabled: true
ignore_unspecified: false ignore_unspecified: false
min_properties: 2 min_properties: 2
separate_groups: false separate_groups: true
order: order:
# Box # Box

View File

@ -9,67 +9,91 @@ $alert-ios-border-radius: 13px !default;
$alert-ios-background: #f8f8f8 !default; $alert-ios-background: #f8f8f8 !default;
$alert-ios-box-shadow: none !default; $alert-ios-box-shadow: none !default;
$alert-ios-head-text-align: center !default;
$alert-ios-head-padding: 12px 16px 7px !default; $alert-ios-head-padding: 12px 16px 7px !default;
$alert-ios-head-text-align: center !default;
$alert-ios-title-margin-top: 8px !default; $alert-ios-title-margin-top: 8px !default;
$alert-ios-title-font-weight: 600 !default;
$alert-ios-title-font-size: 17px !default; $alert-ios-title-font-size: 17px !default;
$alert-ios-title-font-weight: 600 !default;
$alert-ios-sub-title-font-size: 14px !default; $alert-ios-sub-title-font-size: 14px !default;
$alert-ios-sub-title-text-color: #666 !default; $alert-ios-sub-title-text-color: #666 !default;
$alert-ios-message-padding: 0 16px 21px !default; $alert-ios-message-padding: 0 16px 21px !default;
$alert-ios-message-text-color: inherit !default;
$alert-ios-message-text-align: center !default;
$alert-ios-message-font-size: 13px !default; $alert-ios-message-font-size: 13px !default;
$alert-ios-message-text-align: center !default;
$alert-ios-message-text-color: inherit !default;
$alert-ios-message-padding-empty: 0 0 12px 0 !default; $alert-ios-message-padding-empty: 0 0 12px 0 !default;
$alert-ios-content-max-height: 240px !default; $alert-ios-content-max-height: 240px !default;
$alert-ios-input-padding: 6px !default;
$alert-ios-input-margin-top: 10px !default; $alert-ios-input-margin-top: 10px !default;
$alert-ios-input-background-color: #fff !default; $alert-ios-input-padding: 6px !default;
$alert-ios-input-border-color: #ccc !default; $alert-ios-input-border-color: #ccc !default;
$alert-ios-input-border: 1px solid $alert-ios-input-border-color !default; $alert-ios-input-border: 1px solid $alert-ios-input-border-color !default;
$alert-ios-input-border-radius: 4px !default; $alert-ios-input-border-radius: 4px !default;
$alert-ios-input-background-color: #fff !default;
$alert-ios-button-group-flex-wrap: wrap !default; $alert-ios-button-group-flex-wrap: wrap !default;
$alert-ios-button-margin: 0 !default;
$alert-ios-button-flex: 1 1 auto !default; $alert-ios-button-flex: 1 1 auto !default;
$alert-ios-button-min-height: 44px !default; $alert-ios-button-margin: 0 !default;
$alert-ios-button-min-width: 50% !default; $alert-ios-button-min-width: 50% !default;
$alert-ios-button-min-height: 44px !default;
$alert-ios-button-font-size: 17px !default; $alert-ios-button-font-size: 17px !default;
$alert-ios-button-text-color: map-get($colors-ios, primary) !default; $alert-ios-button-text-color: map-get($colors-ios, primary) !default;
$alert-ios-button-background-color: transparent !default; $alert-ios-button-background-color: transparent !default;
$alert-ios-button-background-color-activated: #e9e9e9 !default; $alert-ios-button-background-color-activated: #e9e9e9 !default;
$alert-ios-button-border-radius: 0 !default;
$alert-ios-button-border-width: 1px !default; $alert-ios-button-border-width: 1px !default;
$alert-ios-button-border-style: solid !default; $alert-ios-button-border-style: solid !default;
$alert-ios-button-border-color: #dbdbdf !default; $alert-ios-button-border-color: #dbdbdf !default;
$alert-ios-button-border-radius: 0 !default;
$alert-ios-button-main-font-weight: bold !default; $alert-ios-button-main-font-weight: bold !default;
$alert-ios-radio-label-padding: 13px !default; $alert-ios-list-border-top: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color !default;
$alert-ios-radio-icon-min-width: 30px !default;
$alert-ios-checkbox-icon-size: 21px !default; $alert-ios-radio-label-padding: 13px !default;
$alert-ios-checkbox-icon-border-radius: 50% !default;
$alert-ios-checkbox-icon-border-width: 1px !default; $alert-ios-radio-min-width: 30px !default;
$alert-ios-checkbox-icon-border-style: solid !default;
$alert-ios-checkbox-icon-border-color-off: $list-ios-border-color !default; $alert-ios-radio-icon-top: 13px !default;
$alert-ios-checkbox-icon-border-color-on: map-get($colors-ios, primary) !default; $alert-ios-radio-icon-left: 7px !default;
$alert-ios-radio-icon-width: 6px !default;
$alert-ios-radio-icon-height: 12px !default;
$alert-ios-radio-icon-border-width: 2px !default;
$alert-ios-radio-icon-border-style: solid !default;
$alert-ios-radio-icon-border-color: $alert-ios-button-text-color !default;
$alert-ios-radio-icon-transform: rotate(45deg) !default;
$alert-ios-checkbox-label-padding: 13px !default;
$alert-ios-checkbox-margin: 10px 6px 10px 16px !default;
$alert-ios-checkbox-size: 21px !default;
$alert-ios-checkbox-border-width: 1px !default;
$alert-ios-checkbox-border-style: solid !default;
$alert-ios-checkbox-border-radius: 50% !default;
$alert-ios-checkbox-border-color-off: $list-ios-border-color !default;
$alert-ios-checkbox-border-color-on: map-get($colors-ios, primary) !default;
$alert-ios-checkbox-background-color-off: $list-ios-background-color !default; $alert-ios-checkbox-background-color-off: $list-ios-background-color !default;
$alert-ios-checkbox-background-color-on: map-get($colors-ios, primary) !default; $alert-ios-checkbox-background-color-on: map-get($colors-ios, primary) !default;
$alert-ios-checkbox-icon-checkmark-width: $alert-ios-checkbox-icon-border-width !default;
$alert-ios-checkbox-icon-checkmark-style: $alert-ios-checkbox-icon-border-style !default; $alert-ios-checkbox-icon-top: 4px !default;
$alert-ios-checkbox-icon-checkmark-color: $background-ios-color !default; $alert-ios-checkbox-icon-left: 7px !default;
$alert-ios-checkbox-icon-width: 4px !default;
$alert-ios-checkbox-icon-height: 9px !default;
$alert-ios-checkbox-icon-border-width: $alert-ios-checkbox-border-width !default;
$alert-ios-checkbox-icon-border-style: $alert-ios-checkbox-border-style !default;
$alert-ios-checkbox-icon-border-color: $background-ios-color !default;
$alert-ios-checkbox-icon-transform: rotate(45deg) !default;
.alert-wrapper { .alert-wrapper {
overflow: hidden; overflow: hidden;
max-width: $alert-ios-max-width; max-width: $alert-ios-max-width;
border-radius: $alert-ios-border-radius; border-radius: $alert-ios-border-radius;
background-color: $alert-ios-background; background-color: $alert-ios-background;
@ -82,11 +106,13 @@ $alert-ios-checkbox-icon-checkmark-color: $background-ios-color !default;
.alert-head { .alert-head {
padding: $alert-ios-head-padding; padding: $alert-ios-head-padding;
text-align: $alert-ios-head-text-align; text-align: $alert-ios-head-text-align;
} }
.alert-title { .alert-title {
margin-top: $alert-ios-title-margin-top; margin-top: $alert-ios-title-margin-top;
font-size: $alert-ios-title-font-size; font-size: $alert-ios-title-font-size;
font-weight: $alert-ios-title-font-weight; font-weight: $alert-ios-title-font-weight;
} }
@ -103,6 +129,7 @@ $alert-ios-checkbox-icon-checkmark-color: $background-ios-color !default;
.alert-message, .alert-message,
.alert-input-group { .alert-input-group {
padding: $alert-ios-message-padding; padding: $alert-ios-message-padding;
font-size: $alert-ios-message-font-size; font-size: $alert-ios-message-font-size;
text-align: $alert-ios-message-text-align; text-align: $alert-ios-message-text-align;
color: $alert-ios-message-text-color; color: $alert-ios-message-text-color;
@ -123,9 +150,11 @@ $alert-ios-checkbox-icon-checkmark-color: $background-ios-color !default;
.alert-input { .alert-input {
margin-top: $alert-ios-input-margin-top; margin-top: $alert-ios-input-margin-top;
padding: $alert-ios-input-padding; padding: $alert-ios-input-padding;
border: $alert-ios-input-border; border: $alert-ios-input-border;
border-radius: $alert-ios-input-border-radius; border-radius: $alert-ios-input-border-radius;
background-color: $alert-ios-input-background-color; background-color: $alert-ios-input-background-color;
-webkit-appearance: none; -webkit-appearance: none;
} }
@ -136,12 +165,15 @@ $alert-ios-checkbox-icon-checkmark-color: $background-ios-color !default;
.alert-radio-group, .alert-radio-group,
.alert-checkbox-group { .alert-checkbox-group {
overflow: scroll; overflow: scroll;
max-height: $alert-ios-content-max-height; max-height: $alert-ios-content-max-height;
border-top: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color;
border-top: $alert-ios-list-border-top;
} }
.alert-tappable { .alert-tappable {
display: flex; display: flex;
min-height: $alert-ios-button-min-height; min-height: $alert-ios-button-min-height;
} }
@ -151,81 +183,113 @@ $alert-ios-checkbox-icon-checkmark-color: $background-ios-color !default;
.alert-radio-label { .alert-radio-label {
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
order: 0; order: 0;
padding: $alert-ios-radio-label-padding; padding: $alert-ios-radio-label-padding;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
// iOS Alert Radio Checkmark: Unchecked
// -----------------------------------------
.alert-radio-icon { .alert-radio-icon {
position: relative; position: relative;
order: 1; order: 1;
min-width: $alert-ios-radio-icon-min-width;
min-width: $alert-ios-radio-min-width;
} }
.alert-radio[aria-checked=true] { .alert-radio[aria-checked=true] {
color: $alert-ios-button-text-color; color: $alert-ios-button-text-color;
.alert-radio-icon::after {
position: absolute;
top: 13px;
left: 7px;
width: 4px;
height: 10px;
border-width: 2px;
border-top-width: 0;
border-left-width: 0;
border-style: solid;
border-color: $alert-ios-button-text-color;
content: "";
transform: rotate(45deg);
}
} }
// iOS Alert Checkbox // iOS Alert Radio Checkmark: Checked
// -----------------------------------------
.alert-radio[aria-checked=true] .alert-radio-inner {
position: absolute;
top: $alert-ios-radio-icon-top;
left: $alert-ios-radio-icon-left;
width: $alert-ios-radio-icon-width;
height: $alert-ios-radio-icon-height;
border-width: $alert-ios-radio-icon-border-width;
border-top-width: 0;
border-left-width: 0;
border-style: $alert-ios-radio-icon-border-style;
border-color: $alert-ios-radio-icon-border-color;
transform: $alert-ios-radio-icon-transform;
}
// iOS Alert Checkbox Label
// -------------------------------------------------- // --------------------------------------------------
.alert-checkbox-label { .alert-checkbox-label {
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
order: 0;
padding: 13px; padding: $alert-ios-checkbox-label-padding;
text-align: auto;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
// iOS Alert Checkbox Outer Circle: Unchecked
// -----------------------------------------
.alert-checkbox-icon { .alert-checkbox-icon {
position: relative; position: relative;
margin: 10px 6px 10px 16px;
width: $alert-ios-checkbox-icon-size; margin: $alert-ios-checkbox-margin;
height: $alert-ios-checkbox-icon-size;
border-width: $alert-ios-checkbox-icon-border-width; width: $alert-ios-checkbox-size;
border-style: $alert-ios-checkbox-icon-border-style; height: $alert-ios-checkbox-size;
border-radius: $alert-ios-checkbox-icon-border-radius;
border-color: $alert-ios-checkbox-icon-border-color-off; border-width: $alert-ios-checkbox-border-width;
border-style: $alert-ios-checkbox-border-style;
border-radius: $alert-ios-checkbox-border-radius;
border-color: $alert-ios-checkbox-border-color-off;
background-color: $alert-ios-checkbox-background-color-off; background-color: $alert-ios-checkbox-background-color-off;
} }
.alert-checkbox[aria-checked=true] .alert-checkbox-icon {
border-color: $alert-ios-checkbox-icon-border-color-on;
background-color: $alert-ios-checkbox-background-color-on;
.alert-checkbox-inner { // iOS Alert Checkbox Outer Circle: Checked
position: absolute; // -----------------------------------------
top: 4px;
left: 7px; .alert-checkbox[aria-checked=true] .alert-checkbox-icon {
width: 4px; border-color: $alert-ios-checkbox-border-color-on;
height: 9px; background-color: $alert-ios-checkbox-background-color-on;
border-width: $alert-ios-checkbox-icon-checkmark-width; }
border-top-width: 0;
border-left-width: 0;
border-style: $alert-ios-checkbox-icon-checkmark-style; // iOS Alert Checkbox Inner Checkmark: Checked
border-color: $alert-ios-checkbox-icon-checkmark-color; // -----------------------------------------
transform: rotate(45deg);
} .alert-checkbox[aria-checked=true] .alert-checkbox-inner {
position: absolute;
top: $alert-ios-checkbox-icon-top;
left: $alert-ios-checkbox-icon-left;
width: $alert-ios-checkbox-icon-width;
height: $alert-ios-checkbox-icon-height;
border-width: $alert-ios-checkbox-icon-border-width;
border-top-width: 0;
border-left-width: 0;
border-style: $alert-ios-checkbox-icon-border-style;
border-color: $alert-ios-checkbox-icon-border-color;
transform: $alert-ios-checkbox-icon-transform;
} }
@ -234,15 +298,20 @@ $alert-ios-checkbox-icon-checkmark-color: $background-ios-color !default;
.alert-button-group { .alert-button-group {
flex-wrap: $alert-ios-button-group-flex-wrap; flex-wrap: $alert-ios-button-group-flex-wrap;
margin-right: -$alert-ios-button-border-width; margin-right: -$alert-ios-button-border-width;
} }
.alert-button { .alert-button {
overflow: hidden; overflow: hidden;
flex: $alert-ios-button-flex; flex: $alert-ios-button-flex;
margin: $alert-ios-button-margin; margin: $alert-ios-button-margin;
min-width: $alert-ios-button-min-width; min-width: $alert-ios-button-min-width;
height: $alert-ios-button-min-height; height: $alert-ios-button-min-height;
border-top: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color; border-top: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color;
border-right: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color; border-right: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color;
border-radius: $alert-ios-button-border-radius; border-radius: $alert-ios-button-border-radius;

View File

@ -10,14 +10,15 @@ $alert-md-background-color: #fafafa !default;
$alert-md-box-shadow-color: rgba(0, 0, 0, .4) !default; $alert-md-box-shadow-color: rgba(0, 0, 0, .4) !default;
$alert-md-box-shadow: 0 16px 20px $alert-md-box-shadow-color !default; $alert-md-box-shadow: 0 16px 20px $alert-md-box-shadow-color !default;
$alert-md-head-text-align: left !default;
$alert-md-head-padding: 24px 24px 20px 24px !default; $alert-md-head-padding: 24px 24px 20px 24px !default;
$alert-md-head-text-align: left !default;
$alert-md-title-font-size: 22px !default; $alert-md-title-font-size: 22px !default;
$alert-md-sub-title-font-size: 16px !default; $alert-md-sub-title-font-size: 16px !default;
$alert-md-message-font-size: 15px !default;
$alert-md-message-padding: 0 24px 24px 24px !default; $alert-md-message-padding: 0 24px 24px 24px !default;
$alert-md-message-font-size: 15px !default;
$alert-md-message-text-color: rgba(0, 0, 0, .5) !default; $alert-md-message-text-color: rgba(0, 0, 0, .5) !default;
$alert-md-message-padding-empty: 0 !default; $alert-md-message-padding-empty: 0 !default;
@ -51,9 +52,54 @@ $alert-md-button-border-radius: 2px !default;
$alert-md-button-text-transform: uppercase !default; $alert-md-button-text-transform: uppercase !default;
$alert-md-button-text-align: right !default; $alert-md-button-text-align: right !default;
$alert-md-list-border-top: 1px solid $alert-md-input-border-color !default;
$alert-md-list-border-bottom: $alert-md-list-border-top !default;
$alert-md-radio-label-padding: 13px 26px !default;
$alert-md-radio-top: 13px !default;
$alert-md-radio-left: 13px !default;
$alert-md-radio-width: 16px !default;
$alert-md-radio-height: 16px !default;
$alert-md-radio-border-width: 2px !default;
$alert-md-radio-border-style: solid !default;
$alert-md-radio-border-radius: 50% !default;
$alert-md-radio-border-color-off: darken($list-md-border-color, 40%) !default;
$alert-md-radio-border-color-on: $alert-md-button-text-color !default;
$alert-md-radio-icon-top: 2px !default;
$alert-md-radio-icon-left: 2px !default;
$alert-md-radio-icon-width: 8px !default;
$alert-md-radio-icon-height: 8px !default;
$alert-md-radio-icon-border-radius: $alert-md-radio-border-radius !default;
$alert-md-radio-icon-transform-off: scale3d(0, 0, 0) !default;
$alert-md-radio-icon-transform-on: scale3d(1, 1, 1) !default;
$alert-md-radio-icon-transition: transform 280ms cubic-bezier(.4, 0, .2, 1) !default;
$alert-md-checkbox-label-padding: 13px 26px !default;
$alert-md-checkbox-top: 13px !default;
$alert-md-checkbox-left: 13px !default;
$alert-md-checkbox-width: 16px !default;
$alert-md-checkbox-height: 16px !default;
$alert-md-checkbox-border-width: 2px !default;
$alert-md-checkbox-border-style: solid !default;
$alert-md-checkbox-border-radius: 2px !default;
$alert-md-checkbox-border-color-off: darken($list-md-border-color, 40%) !default;
$alert-md-checkbox-border-color-on: $alert-md-button-text-color !default;
$alert-md-checkbox-icon-top: 0 !default;
$alert-md-checkbox-icon-left: 3px !default;
$alert-md-checkbox-icon-width: 6px !default;
$alert-md-checkbox-icon-height: 10px !default;
$alert-md-checkbox-icon-border-width: 2px !default;
$alert-md-checkbox-icon-border-style: solid !default;
$alert-md-checkbox-icon-transform: rotate(45deg) !default;
.alert-wrapper { .alert-wrapper {
max-width: $alert-md-max-width; max-width: $alert-md-max-width;
border-radius: $alert-md-border-radius; border-radius: $alert-md-border-radius;
background-color: $alert-md-background-color; background-color: $alert-md-background-color;
@ -65,6 +111,7 @@ $alert-md-button-text-align: right !default;
.alert-head { .alert-head {
padding: $alert-md-head-padding; padding: $alert-md-head-padding;
text-align: $alert-md-head-text-align; text-align: $alert-md-head-text-align;
} }
@ -83,11 +130,13 @@ $alert-md-button-text-align: right !default;
.alert-message, .alert-message,
.alert-input-group { .alert-input-group {
padding: $alert-md-message-padding; padding: $alert-md-message-padding;
color: $alert-md-message-text-color; color: $alert-md-message-text-color;
} }
.alert-message { .alert-message {
max-height: $alert-md-content-max-height; max-height: $alert-md-content-max-height;
font-size: $alert-md-message-font-size; font-size: $alert-md-message-font-size;
&:empty { &:empty {
@ -101,11 +150,13 @@ $alert-md-button-text-align: right !default;
.alert-input { .alert-input {
margin: $alert-md-input-margin-top $alert-md-input-margin-right $alert-md-input-margin-bottom $alert-md-input-margin-left; margin: $alert-md-input-margin-top $alert-md-input-margin-right $alert-md-input-margin-bottom $alert-md-input-margin-left;
border-bottom: $alert-md-input-border-width $alert-md-input-border-style $alert-md-input-border-color; border-bottom: $alert-md-input-border-width $alert-md-input-border-style $alert-md-input-border-color;
color: $alert-md-input-text-color; color: $alert-md-input-text-color;
&:focus { &:focus {
margin-bottom: $alert-md-input-margin-bottom - 1; margin-bottom: $alert-md-input-margin-bottom - 1;
border-bottom: $alert-md-input-border-width-focused $alert-md-input-border-style-focused $alert-md-input-border-color-focused; border-bottom: $alert-md-input-border-width-focused $alert-md-input-border-style-focused $alert-md-input-border-color-focused;
} }
} }
@ -118,16 +169,21 @@ $alert-md-button-text-align: right !default;
.alert-checkbox-group { .alert-checkbox-group {
position: relative; position: relative;
overflow: auto; overflow: auto;
max-height: $alert-md-content-max-height; max-height: $alert-md-content-max-height;
border-top: 1px solid $alert-md-input-border-color;
border-bottom: 1px solid $alert-md-input-border-color; border-top: $alert-md-list-border-top;
border-bottom: $alert-md-list-border-bottom;
} }
.alert-tappable { .alert-tappable {
position: relative; position: relative;
display: flex; display: flex;
overflow: hidden; overflow: hidden;
min-height: 44px;
// TODO this should be a variable that matches item
min-height: 4.4rem;
} }
@ -136,96 +192,120 @@ $alert-md-button-text-align: right !default;
.alert-radio-label { .alert-radio-label {
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
padding: 13px 26px;
text-align: auto; padding: $alert-md-radio-label-padding;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
// Material Design Alert Radio Unchecked Circle
// ---------------------------------------------------
.alert-radio-icon { .alert-radio-icon {
position: relative; position: relative;
top: 13px; top: $alert-md-radio-top;
left: 13px; left: $alert-md-radio-left;
display: block; display: block;
margin: 0;
width: 16px;
height: 16px;
border-width: 2px;
border-style: solid;
border-radius: 50%;
border-color: darken($list-md-border-color, 40%);
&::after { width: $alert-md-radio-width;
position: absolute; height: $alert-md-radio-height;
top: 2px;
left: 2px; border-width: $alert-md-radio-border-width;
width: 8px; border-style: $alert-md-radio-border-style;
height: 8px; border-radius: $alert-md-radio-border-radius;
border-radius: 50%; border-color: $alert-md-radio-border-color-off;
background-color: $alert-md-button-text-color;
content: "";
transform: scale3d(0, 0, 0);
transition: transform 280ms cubic-bezier(.4, 0, .2, 1);
}
} }
// Material Design Alert Radio Checked Dot
// ---------------------------------------------------
.alert-radio-inner {
position: absolute;
top: $alert-md-radio-icon-top;
left: $alert-md-radio-icon-left;
width: $alert-md-radio-icon-width;
height: $alert-md-radio-icon-height;
border-radius: $alert-md-radio-icon-border-radius;
background-color: $alert-md-radio-border-color-on;
transform: $alert-md-radio-icon-transform-off;
transition: $alert-md-radio-icon-transition;
}
// Material Design Alert Radio Checked
// ---------------------------------------------------
.alert-radio[aria-checked=true] { .alert-radio[aria-checked=true] {
color: $alert-md-button-text-color; color: $alert-md-radio-border-color-on;
.alert-radio-icon { .alert-radio-icon {
border-color: $alert-md-button-text-color; border-color: $alert-md-radio-border-color-on;
}
.alert-radio-icon::after {
transform: scale3d(1, 1, 1);
} }
} }
.alert-radio[aria-checked=true] .alert-radio-inner {
transform: $alert-md-radio-icon-transform-on;
}
// Material Design Alert Checkbox
// Material Design Alert Checkbox Label
// -------------------------------------------------- // --------------------------------------------------
.alert-checkbox-label { .alert-checkbox-label {
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
padding: 13px 26px;
text-align: auto; padding: $alert-md-checkbox-label-padding;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
// Material Design Alert Checkbox Outline: Unchecked
// --------------------------------------------------
.alert-checkbox-icon { .alert-checkbox-icon {
position: relative; position: relative;
top: 13px; top: $alert-md-checkbox-top;
left: 13px; left: $alert-md-checkbox-left;
width: 16px;
height: 16px; width: $alert-md-checkbox-width;
border-width: 2px; height: $alert-md-checkbox-height;
border-style: solid;
border-radius: 2px; border-width: $alert-md-checkbox-border-width;
border-color: darken($list-md-border-color, 40%); border-style: $alert-md-checkbox-border-style;
background-color: transparent; border-radius: $alert-md-checkbox-border-radius;
border-color: $alert-md-checkbox-border-color-off;
} }
.alert-checkbox[aria-checked=true] .alert-checkbox-icon { // Material Design Alert Checkbox Checkmark: Checked
border-color: $alert-md-button-text-color; // --------------------------------------------------
background-color: $alert-md-button-text-color;
&::after { .alert-checkbox[aria-checked=true] .alert-checkbox-icon {
position: absolute; border-color: $alert-md-checkbox-border-color-on;
top: 0; background-color: $alert-md-checkbox-border-color-on;
left: 3px; }
width: 4px;
height: 8px; .alert-checkbox[aria-checked=true] .alert-checkbox-inner {
border-width: 2px; position: absolute;
border-top-width: 0; top: $alert-md-checkbox-icon-top;
border-left-width: 0; left: $alert-md-checkbox-icon-left;
border-style: solid;
border-color: $alert-md-background-color; width: $alert-md-checkbox-icon-width;
content: ""; height: $alert-md-checkbox-icon-height;
transform: rotate(45deg);
} border-width: $alert-md-checkbox-icon-border-width;
border-top-width: 0;
border-left-width: 0;
border-style: $alert-md-checkbox-icon-border-style;
border-color: $alert-md-background-color;
transform: $alert-md-checkbox-icon-transform;
} }
@ -235,6 +315,7 @@ $alert-md-button-text-align: right !default;
.alert-button-group { .alert-button-group {
flex-wrap: $alert-md-button-group-flex-wrap; flex-wrap: $alert-md-button-group-flex-wrap;
justify-content: $alert-md-button-group-justify-content; justify-content: $alert-md-button-group-justify-content;
padding: $alert-md-button-group-padding; padding: $alert-md-button-group-padding;
} }
@ -245,6 +326,7 @@ $alert-md-button-text-align: right !default;
margin: $alert-md-button-margin; margin: $alert-md-button-margin;
padding: $alert-md-button-padding; padding: $alert-md-button-padding;
border-radius: $alert-md-button-border-radius; border-radius: $alert-md-button-border-radius;
font-weight: $alert-md-button-font-weight; font-weight: $alert-md-button-font-weight;
text-align: $alert-md-button-text-align; text-align: $alert-md-button-text-align;

View File

@ -19,6 +19,7 @@ ion-alert {
z-index: $z-index-overlay; z-index: $z-index-overlay;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -30,9 +31,12 @@ ion-alert {
.alert-wrapper { .alert-wrapper {
z-index: $z-index-overlay-wrapper; z-index: $z-index-overlay-wrapper;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-width: $alert-min-width; min-width: $alert-min-width;
max-height: $alert-max-height; max-height: $alert-max-height;
opacity: 0; opacity: 0;
} }
@ -44,6 +48,7 @@ ion-alert {
.alert-sub-title { .alert-sub-title {
margin: 5px 0 0; margin: 5px 0 0;
padding: 0; padding: 0;
font-weight: normal; font-weight: normal;
} }
@ -55,12 +60,14 @@ ion-alert {
@include placeholder(); @include placeholder();
padding: 10px 0; padding: 10px 0;
border: 0; border: 0;
background: inherit; background: inherit;
} }
.alert-button-group { .alert-button-group {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
&.vertical { &.vertical {
@ -72,7 +79,9 @@ ion-alert {
.alert-button { .alert-button {
z-index: 0; z-index: 0;
display: block; display: block;
margin: 0; margin: 0;
font-size: $alert-button-font-size; font-size: $alert-button-font-size;
line-height: $alert-button-line-height; line-height: $alert-button-line-height;
} }
@ -80,10 +89,13 @@ ion-alert {
.alert-tappable { .alert-tappable {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 100%; width: 100%;
font-size: inherit; font-size: inherit;
line-height: initial; line-height: initial;
text-align: left; text-align: left;
background: transparent; background: transparent;
-webkit-appearance: none; -webkit-appearance: none;
} }

View File

@ -268,7 +268,7 @@ export class Alert extends ViewController {
'<template ngSwitchWhen="radio">' + '<template ngSwitchWhen="radio">' +
'<div class="alert-radio-group" role="radiogroup" [attr.aria-labelledby]="hdrId" [attr.aria-activedescendant]="activeId">' + '<div class="alert-radio-group" role="radiogroup" [attr.aria-labelledby]="hdrId" [attr.aria-activedescendant]="activeId">' +
'<button *ngFor="#i of d.inputs" (click)="rbClick(i)" [attr.aria-checked]="i.checked" [attr.id]="i.id" class="alert-tappable alert-radio" role="radio">' + '<button *ngFor="#i of d.inputs" (click)="rbClick(i)" [attr.aria-checked]="i.checked" [attr.id]="i.id" class="alert-tappable alert-radio" role="radio">' +
'<div class="alert-radio-icon"></div>' + '<div class="alert-radio-icon"><div class="alert-radio-inner"></div></div>' +
'<div class="alert-radio-label">' + '<div class="alert-radio-label">' +
'{{i.label}}' + '{{i.label}}' +
'</div>' + '</div>' +

View File

@ -8,49 +8,44 @@ $alert-wp-backdrop-background: #fff !default;
$alert-wp-width: 100% !default; $alert-wp-width: 100% !default;
$alert-wp-max-width: 520px !default; $alert-wp-max-width: 520px !default;
$alert-wp-border-radius: 0 !default;
$alert-wp-border-width: 1px !default; $alert-wp-border-width: 1px !default;
$alert-wp-border-style: solid !default; $alert-wp-border-style: solid !default;
$alert-wp-border-color: map-get($colors-wp, primary) !default; $alert-wp-border-color: map-get($colors-wp, primary) !default;
$alert-wp-border-radius: 0 !default;
$alert-wp-background: #e6e6e6 !default; $alert-wp-background: #e6e6e6 !default;
$alert-wp-head-text-align: left !default;
$alert-wp-head-padding: 20px 22px 5px 22px !default; $alert-wp-head-padding: 20px 22px 5px 22px !default;
$alert-wp-head-text-align: left !default;
$alert-wp-title-font-size: 20px !default; $alert-wp-title-font-size: 20px !default;
$alert-wp-title-font-weight: 400 !default; $alert-wp-title-font-weight: 400 !default;
$alert-wp-sub-title-font-size: 16px !default; $alert-wp-sub-title-font-size: 16px !default;
$alert-wp-message-font-size: 13px !default;
$alert-wp-message-padding: 0 22px 8px 22px !default; $alert-wp-message-padding: 0 22px 8px 22px !default;
$alert-wp-message-padding-empty: 0 !default; $alert-wp-message-padding-empty: 0 !default;
$alert-wp-message-text-color: #000 !default; $alert-wp-message-text-color: #000 !default;
$alert-wp-message-font-size: 13px !default;
$alert-wp-content-max-height: 240px !default; $alert-wp-content-max-height: 240px !default;
$alert-wp-input-margin: 5px 0 5px 0 !default;
$alert-wp-input-padding: 0 8px !default;
$alert-wp-input-border-width: 2px !default; $alert-wp-input-border-width: 2px !default;
$alert-wp-input-border-style: $alert-wp-border-style !default; $alert-wp-input-border-style: $alert-wp-border-style !default;
$alert-wp-input-border-color: $input-wp-border-color !default; $alert-wp-input-border-color: $input-wp-border-color !default;
$alert-wp-input-text-color: #000 !default;
$alert-wp-input-margin: 5px 0 5px 0 !default;
$alert-wp-input-padding: 0 8px !default;
$alert-wp-input-line-height: 3rem !default;
$alert-wp-input-border-color-focused: map-get($colors-wp, primary) !default; $alert-wp-input-border-color-focused: map-get($colors-wp, primary) !default;
$alert-wp-input-line-height: 3rem !default;
$alert-wp-input-text-color: #000 !default;
$alert-wp-button-padding: 5px !default; $alert-wp-button-padding: 5px !default;
$alert-wp-button-width: 49.5% !default;
$alert-wp-button-border-radius: 0 !default;
$alert-wp-button-font-weight: 400 !default;
$alert-wp-button-text-color: #000 !default; $alert-wp-button-text-color: #000 !default;
$alert-wp-button-background: #b8b8b8 !default; $alert-wp-button-background: #b8b8b8 !default;
$alert-wp-button-border-radius: 0 !default; $alert-wp-button-background-activated: color-shade($alert-wp-button-background) !default;
$alert-wp-button-width: 49.5% !default;
$alert-wp-button-margin-right: 1% !default; $alert-wp-button-margin-right: 1% !default;
$alert-wp-button-font-weight: 400 !default;
$alert-wp-checkbox-background: map-get($colors-wp, primary) !default;
$alert-wp-checkbox-border-color: $input-wp-border-color !default;
$alert-wp-checkbox-border-radius: 0 !default;
$alert-wp-radio-background: map-get($colors-wp, primary) !default;
$alert-wp-radio-border-color: $input-wp-border-color !default;
$alert-wp-button-group-padding: 20px 22px 20px 22px !default; $alert-wp-button-group-padding: 20px 22px 20px 22px !default;
$alert-wp-button-group-justify-content: flex-end !default; $alert-wp-button-group-justify-content: flex-end !default;
@ -59,6 +54,49 @@ $alert-wp-button-group-flex-wrap: wrap-reverse !default;
$alert-wp-button-group-vertical-width: 100% !default; $alert-wp-button-group-vertical-width: 100% !default;
$alert-wp-button-group-vertical-margin-top: 5px !default; $alert-wp-button-group-vertical-margin-top: 5px !default;
$alert-wp-radio-background: map-get($colors-wp, primary) !default;
$alert-wp-radio-border-color: $input-wp-border-color !default;
$alert-wp-radio-label-padding: 13px 26px !default;
$alert-wp-radio-top: 13px !default;
$alert-wp-radio-left: 13px !default;
$alert-wp-radio-width: 16px !default;
$alert-wp-radio-height: 16px !default;
$alert-wp-radio-border-width: 2px !default;
$alert-wp-radio-border-style: solid !default;
$alert-wp-radio-border-radius: 50% !default;
$alert-wp-radio-border-color: $input-wp-border-color !default;
$alert-wp-radio-icon-top: 2px !default;
$alert-wp-radio-icon-left: 2px !default;
$alert-wp-radio-icon-width: 8px !default;
$alert-wp-radio-icon-height: 8px !default;
$alert-wp-radio-icon-border-radius: $alert-wp-radio-border-radius !default;
$alert-wp-checkbox-label-padding: 13px 26px !default;
$alert-wp-checkbox-top: 13px !default;
$alert-wp-checkbox-left: 13px !default;
$alert-wp-checkbox-width: 16px !default;
$alert-wp-checkbox-height: 16px !default;
$alert-wp-checkbox-border-width: 2px !default;
$alert-wp-checkbox-border-style: solid !default;
$alert-wp-checkbox-border-radius: 0 !default;
$alert-wp-checkbox-border-color: $input-wp-border-color !default;
$alert-wp-checkbox-background-off: transparent !default;
$alert-wp-checkbox-background-on: map-get($colors-wp, primary) !default;
$alert-wp-checkbox-icon-top: -2px !default;
$alert-wp-checkbox-icon-left: 3px !default;
$alert-wp-checkbox-icon-width: 6px !default;
$alert-wp-checkbox-icon-height: 12px !default;
$alert-wp-checkbox-icon-border-width: 1px !default;
$alert-wp-checkbox-icon-border-style: solid !default;
$alert-wp-checkbox-icon-border-color: $alert-wp-background !default;
$alert-wp-checkbox-icon-transform: rotate(45deg) !default;
ion-alert { ion-alert {
.backdrop { .backdrop {
background: $alert-wp-backdrop-background; background: $alert-wp-backdrop-background;
@ -68,6 +106,7 @@ ion-alert {
.alert-wrapper { .alert-wrapper {
width: $alert-wp-width; width: $alert-wp-width;
max-width: $alert-wp-max-width; max-width: $alert-wp-max-width;
border: $alert-wp-border-width $alert-wp-border-style $alert-wp-border-color; border: $alert-wp-border-width $alert-wp-border-style $alert-wp-border-color;
border-radius: $alert-wp-border-radius; border-radius: $alert-wp-border-radius;
background: $alert-wp-background; background: $alert-wp-background;
@ -78,6 +117,7 @@ ion-alert {
.alert-head { .alert-head {
padding: $alert-wp-head-padding; padding: $alert-wp-head-padding;
text-align: $alert-wp-head-text-align; text-align: $alert-wp-head-text-align;
} }
@ -97,11 +137,13 @@ ion-alert {
.alert-message, .alert-message,
.alert-input-group { .alert-input-group {
padding: $alert-wp-message-padding; padding: $alert-wp-message-padding;
color: $alert-wp-message-text-color; color: $alert-wp-message-text-color;
} }
.alert-message { .alert-message {
max-height: $alert-wp-content-max-height; max-height: $alert-wp-content-max-height;
font-size: $alert-wp-message-font-size; font-size: $alert-wp-message-font-size;
&:empty { &:empty {
@ -116,6 +158,7 @@ ion-alert {
.alert-input { .alert-input {
margin: $alert-wp-input-margin; margin: $alert-wp-input-margin;
padding: $alert-wp-input-padding; padding: $alert-wp-input-padding;
border: $alert-wp-input-border-width $alert-wp-input-border-style $alert-wp-input-border-color; border: $alert-wp-input-border-width $alert-wp-input-border-style $alert-wp-input-border-color;
line-height: $alert-wp-input-line-height; line-height: $alert-wp-input-line-height;
color: $alert-wp-input-text-color; color: $alert-wp-input-text-color;
@ -133,119 +176,144 @@ ion-alert {
.alert-checkbox-group { .alert-checkbox-group {
position: relative; position: relative;
overflow: auto; overflow: auto;
max-height: $alert-wp-content-max-height; max-height: $alert-wp-content-max-height;
border-top: 0 solid $alert-wp-input-border-color;
border-bottom: 0 solid $alert-wp-input-border-color;
} }
.alert-tappable { .alert-tappable {
position: relative; position: relative;
display: flex; display: flex;
overflow: hidden; overflow: hidden;
min-height: 44px;
// TODO this should be a variable that matches item
min-height: 4.4rem;
} }
// Windows Alert Radio // Windows Alert Radio Label
// -------------------------------------------------- // --------------------------------------------------
.alert-radio-label { .alert-radio-label {
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
padding: 13px 26px;
text-align: auto; padding: $alert-wp-radio-label-padding;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
// Windows Alert Radio Unchecked Circle
// ---------------------------------------------------
.alert-radio-icon { .alert-radio-icon {
position: relative; position: relative;
top: 13px; top: $alert-wp-radio-top;
left: 13px; left: $alert-wp-radio-left;
display: block; display: block;
margin: 0;
width: 16px;
height: 16px;
border-width: 2px;
border-style: solid;
border-radius: 50%;
border-color: $alert-wp-radio-border-color;
&::after { margin: 0;
position: absolute;
top: 2px; width: $alert-wp-radio-width;
left: 2px; height: $alert-wp-radio-height;
display: none;
width: 8px; border-width: $alert-wp-radio-border-width;
height: 8px; border-style: $alert-wp-radio-border-style;
border-radius: 50%; border-radius: $alert-wp-radio-border-radius;
background: $alert-wp-radio-background; border-color: $alert-wp-radio-border-color;
content: "";
}
} }
// Windows Alert Radio Checked Dot
// ---------------------------------------------------
.alert-radio-inner {
position: absolute;
top: $alert-wp-radio-icon-top;
left: $alert-wp-radio-icon-left;
display: none;
width: $alert-wp-radio-icon-width;
height: $alert-wp-radio-icon-height;
border-radius: $alert-wp-radio-icon-border-radius;
background: $alert-wp-radio-background;
}
// Windows Alert Radio Checked
// ---------------------------------------------------
.alert-radio[aria-checked=true] { .alert-radio[aria-checked=true] {
color: $alert-wp-button-text-color; color: $alert-wp-button-text-color;
.alert-radio-icon { .alert-radio-icon {
border-color: $alert-wp-radio-border-color; border-color: $alert-wp-radio-border-color;
} }
}
.alert-radio-icon::after { .alert-radio[aria-checked=true] .alert-radio-inner {
display: block; display: block;
}
} }
// Windows Alert Checkbox // Windows Alert Checkbox Label
// -------------------------------------------------- // --------------------------------------------------
.alert-checkbox-label { .alert-checkbox-label {
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
padding: 13px 26px;
text-align: auto; padding: $alert-wp-checkbox-label-padding;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
// Windows Alert Checkbox Icon // Windows Alert Checkbox Outline: Unchecked
// -------------------------------------------------- // --------------------------------------------------
.alert-checkbox-icon { .alert-checkbox-icon {
position: relative; position: relative;
top: 13px; top: $alert-wp-checkbox-top;
left: 13px; left: $alert-wp-checkbox-left;
width: 16px;
height: 16px; width: $alert-wp-checkbox-width;
border-width: 2px; height: $alert-wp-checkbox-height;
border-style: solid;
border-width: $alert-wp-checkbox-border-width;
border-style: $alert-wp-checkbox-border-style;
border-radius: $alert-wp-checkbox-border-radius; border-radius: $alert-wp-checkbox-border-radius;
border-color: $alert-wp-checkbox-border-color; border-color: $alert-wp-checkbox-border-color;
background: transparent; background: $alert-wp-checkbox-background-off;
} }
// Windows Alert Checkbox Icon Checked // Windows Alert Checkbox Outline: Checked
// -------------------------------------------------- // --------------------------------------------------
.alert-checkbox[aria-checked=true] .alert-checkbox-icon { .alert-checkbox[aria-checked=true] .alert-checkbox-icon {
border-color: $alert-wp-checkbox-background; border-color: $alert-wp-checkbox-background-on;
background: $alert-wp-checkbox-background; background: $alert-wp-checkbox-background-on;
} }
// Windows Alert Checkbox Checkmark: Checked
// --------------------------------------------------
.alert-checkbox[aria-checked=true] .alert-checkbox-inner { .alert-checkbox[aria-checked=true] .alert-checkbox-inner {
position: absolute; position: absolute;
top: -2px; top: $alert-wp-checkbox-icon-top;
left: 3px; left: $alert-wp-checkbox-icon-left;
width: 6px;
height: 12px; width: $alert-wp-checkbox-icon-width;
border-width: 1px; height: $alert-wp-checkbox-icon-height;
border-width: $alert-wp-checkbox-icon-border-width;
border-top-width: 0; border-top-width: 0;
border-left-width: 0; border-left-width: 0;
border-style: solid; border-style: $alert-wp-checkbox-icon-border-style;
border-color: $alert-wp-background; border-color: $alert-wp-checkbox-icon-border-color;
content: ""; transform: $alert-wp-checkbox-icon-transform;
transform: rotate(45deg);
} }
@ -255,10 +323,12 @@ ion-alert {
.alert-button-group { .alert-button-group {
flex-wrap: $alert-wp-button-group-flex-wrap; flex-wrap: $alert-wp-button-group-flex-wrap;
justify-content: $alert-wp-button-group-justify-content; justify-content: $alert-wp-button-group-justify-content;
padding: $alert-wp-button-group-padding; padding: $alert-wp-button-group-padding;
&.vertical .alert-button { &.vertical .alert-button {
margin-top: $alert-wp-button-group-vertical-margin-top; margin-top: $alert-wp-button-group-vertical-margin-top;
width: $alert-wp-button-group-vertical-width; width: $alert-wp-button-group-vertical-width;
&:first-child:not(:only-child) { &:first-child:not(:only-child) {
@ -269,7 +339,9 @@ ion-alert {
.alert-button { .alert-button {
padding: $alert-wp-button-padding; padding: $alert-wp-button-padding;
width: $alert-wp-button-width; width: $alert-wp-button-width;
border-radius: $alert-wp-button-border-radius; border-radius: $alert-wp-button-border-radius;
font-weight: $alert-wp-button-font-weight; font-weight: $alert-wp-button-font-weight;
color: $alert-wp-button-text-color; color: $alert-wp-button-text-color;
@ -280,6 +352,6 @@ ion-alert {
} }
&.activated { &.activated {
background: color-shade($alert-wp-button-background); background: $alert-wp-button-background-activated;
} }
} }

View File

@ -37,8 +37,10 @@ ion-radio {
position: absolute; position: absolute;
top: 4px; top: 4px;
left: 7px; left: 7px;
width: 5px; width: 5px;
height: 12px; height: 12px;
border-width: $radio-ios-icon-border-width; border-width: $radio-ios-icon-border-width;
border-style: $radio-ios-icon-border-style; border-style: $radio-ios-icon-border-style;
border-color: $radio-ios-color-on; border-color: $radio-ios-color-on;