alert updates

This commit is contained in:
Adam Bradley
2015-04-05 20:53:04 -05:00
parent b5dae74f90
commit 3d3f461a11
7 changed files with 78 additions and 53 deletions

View File

@ -9,17 +9,19 @@ export let AlertConfig = new ComponentConfig('alert')
}) })
@Template({ @Template({
inline: ` inline: `
<div class="pane-backdrop"></div> <div class="overlay-backdrop"></div>
<div class="alert-container"> <div class="overlay-container">
<div class="alert-container">
<div class="alert-content"> <div class="alert-header">
Do you like cookies? Do you like cookies?
</div>
<div class="alert-content">
Seriously, who does not like cookies.
</div>
<div class="alert-actions">
<button class="button">OK</button>
</div>
</div> </div>
<div class="alert-actions">
<button class="button">OK</button>
</div>
</div>` </div>`
}) })
export class Alert { export class Alert {

View File

@ -2,13 +2,13 @@
// Alert // Alert
// -------------------------------------------------- // --------------------------------------------------
$alert-width: 40% !default; $alert-width: 40% !default;
$alert-min-width: 280px !default; $alert-min-width: 270px !default;
$alert-max-width: 460px !default; $alert-max-width: 460px !default;
$alert-content-min-height: 80px !default; $alert-content-margin: 24px !default;
.alert { .alert .overlay-container {
@include flex-display(); @include flex-display();
@include flex-justify-content(center); @include flex-justify-content(center);
@include flex-align-items(center); @include flex-align-items(center);
@ -26,9 +26,14 @@ $alert-content-min-height: 80px !default;
background: white; background: white;
} }
.alert-header {
margin: $alert-content-margin;
font-size: 2rem;
font-weight: 400;
}
.alert-content { .alert-content {
padding: 15px; margin: $alert-content-margin;
min-height: $alert-content-min-height;
} }
.alert-actions { .alert-actions {

View File

@ -1,8 +1,8 @@
// Alert // Android Alert
// -------------------------------------------------- // --------------------------------------------------
$alert-android-padding: 24px !default; $alert-android-content-margin: 24px !default;
$alert-android-background-color: #fff !default; $alert-android-background-color: #fff !default;
$alert-android-border-radius: 4px !default; $alert-android-border-radius: 4px !default;
$alert-android-box-shadow: 0px 27px 24px 0 rgba(0, 0, 0, 0.2) !default; $alert-android-box-shadow: 0px 27px 24px 0 rgba(0, 0, 0, 0.2) !default;
@ -11,24 +11,27 @@ $alert-android-box-shadow: 0px 27px 24px 0 rgba(0, 0, 0, 0.2) !def
.alert-android { .alert-android {
.alert-container { .alert-container {
background: transparent;
box-shadow: $alert-android-box-shadow; box-shadow: $alert-android-box-shadow;
border-radius: $alert-android-border-radius;
overflow: hidden;
}
.alert-header {
margin: $alert-android-content-margin;
font-size: 2rem;
font-weight: 400;
} }
.alert-content { .alert-content {
position: relative; position: relative;
padding: $alert-android-padding; margin: $alert-android-content-margin;
border-top-left-radius: $alert-android-border-radius;
border-top-right-radius: $alert-android-border-radius;
background: $alert-android-background-color; background: $alert-android-background-color;
} }
.alert-actions { .alert-actions {
min-height: 44px; min-height: 44px;
background: $alert-android-background-color; background: $alert-android-background-color;
border-bottom-left-radius: $alert-android-border-radius; margin: $alert-android-content-margin;
border-bottom-right-radius: $alert-android-border-radius;
padding: 12px 18px;
.button { .button {
border: 0; border: 0;

View File

@ -2,9 +2,8 @@
// Alert // Alert
// -------------------------------------------------- // --------------------------------------------------
$alert-ios-width: 270px !default; $alert-ios-min-height: 80px !default;
$alert-ios-min-height: 100px !default; $alert-ios-content-margin: 15px !default;
$alert-ios-padding: 15px !default;
$alert-ios-background-color: #e8e8e8 !default; $alert-ios-background-color: #e8e8e8 !default;
$alert-ios-border-radius: 15px !default; $alert-ios-border-radius: 15px !default;
$alert-ios-button-color: #007aff !default; $alert-ios-button-color: #007aff !default;
@ -14,17 +13,20 @@ $alert-ios-button-font-size: 2rem !default;
.alert-ios { .alert-ios {
.alert-container { .alert-container {
width: $alert-ios-width; border-radius: $alert-ios-border-radius;
background: transparent; background: $alert-ios-background-color;
text-align: center;
}
.alert-header {
margin: $alert-ios-content-margin;
} }
.alert-content { .alert-content {
position: relative; position: relative;
padding: $alert-ios-padding; margin: $alert-ios-content-margin 0 0;
padding: 0 $alert-ios-content-margin $alert-ios-content-margin;
min-height: $alert-ios-min-height; min-height: $alert-ios-min-height;
border-top-left-radius: $alert-ios-border-radius;
border-top-right-radius: $alert-ios-border-radius;
background: $alert-ios-background-color;
&:after { &:after {
position: absolute; position: absolute;
@ -47,9 +49,6 @@ $alert-ios-button-font-size: 2rem !default;
.alert-actions { .alert-actions {
min-height: 44px; min-height: 44px;
background: $alert-ios-background-color;
border-bottom-left-radius: $alert-ios-border-radius;
border-bottom-right-radius: $alert-ios-border-radius;
.button { .button {
@include flex(1); @include flex(1);

View File

@ -0,0 +1,29 @@
// Overlay
// --------------------------------------------------
$overlay-background: #000 !default;
$overlay-opacity: 0.3 !default;
.overlay-backdrop {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
background: $overlay-background;
opacity: $overlay-opacity;
}
.overlay-container {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
}

View File

@ -8,20 +8,6 @@
} }
.pane-backdrop {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
background: black;
opacity: 0.3;
}
// Content Padding // Content Padding
// -------------------------------------------------- // --------------------------------------------------

View File

@ -18,7 +18,8 @@
"mixins/colors", "mixins/colors",
"util", "util",
"scaffolding", "scaffolding",
"typography"; "typography",
"overlay";
// Core Components // Core Components