Skip to content

Commit

Permalink
feat(windows): add radio component for wp mode
Browse files Browse the repository at this point in the history
fixed radio and checkbox in alert, updated toolbar

references #5565
  • Loading branch information
brandyscarney committed Feb 23, 2016
1 parent 1ecfa6f commit dd206ad
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 9 deletions.
1 change: 1 addition & 0 deletions ionic/components.wp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
"components/badge/badge.wp",
"components/button/button.wp",
"components/checkbox/checkbox.wp",
"components/radio/radio.wp",
"components/toolbar/toolbar.wp";
14 changes: 8 additions & 6 deletions ionic/components/alert/alert.wp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ $alert-wp-button-width: 49.5% !default;
$alert-wp-button-margin-right: 1% !default;
$alert-wp-button-font-weight: 300 !default;

$alert-wp-checkbox-background-color: map-get($colors-wp, primary) !default;
$alert-wp-radio-background-color: map-get($colors-wp, primary) !default;

$alert-wp-buttons-padding: 8px 20px 20px 20px !default;
$alert-wp-buttons-justify-content: flex-end !default;

Expand Down Expand Up @@ -150,11 +153,10 @@ $alert-wp-buttons-justify-content: flex-end !default;
left: 2px;
width: 8px;
height: 8px;
background-color: $alert-wp-button-text-color;
background-color: $alert-wp-radio-background-color;
border-radius: 50%;
content: '';
transition: transform 280ms cubic-bezier(.4, 0, .2, 1);
transform: scale3d(0, 0, 0);
display: none;
}
}

Expand All @@ -166,7 +168,7 @@ $alert-wp-buttons-justify-content: flex-end !default;
}

.alert-radio-icon:after {
transform: scale3d(1, 1, 1);
display: block;
}
}

Expand Down Expand Up @@ -197,8 +199,8 @@ $alert-wp-buttons-justify-content: flex-end !default;
}

.alert-checkbox[aria-checked=true] .alert-checkbox-icon {
background-color: $alert-wp-button-text-color;
border-color: $alert-wp-button-text-color;
background-color: $alert-wp-checkbox-background-color;
border-color: $alert-wp-checkbox-background-color;

&:after {
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion ionic/components/checkbox/checkbox.wp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $checkbox-wp-icon-checkmark-color: $background-wp-color !default;
$checkbox-wp-icon-border-width: 2px !default;
$checkbox-wp-icon-border-style: solid !default;
$checkbox-wp-icon-border-radius: 0 !default;
$checkbox-wp-icon-border-color-off: darken($list-wp-border-color, 40%) !default;
$checkbox-wp-icon-border-color-off: #333333 !default;
$checkbox-wp-icon-border-color-on: map-get($colors-wp, primary) !default;

$checkbox-wp-transition-duration: 280ms !default;
Expand Down
121 changes: 121 additions & 0 deletions ionic/components/radio/radio.wp.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
@import "../../globals.wp";

// Windows Radio
// --------------------------------------------------

$radio-wp-color-on: map-get($colors-wp, primary) !default;
$radio-wp-color-off: #333333 !default;

$radio-wp-icon-width: 16px !default;
$radio-wp-icon-height: 16px !default;
$radio-wp-icon-border-width: 2px !default;
$radio-wp-icon-border-style: solid !default;
$radio-wp-icon-border-radius: 50% !default;

$radio-wp-disabled-opacity: 0.3 !default;


ion-radio {
position: relative;
display: inline-block;
}


// Windows Radio Outer Circle: Unchecked
// -----------------------------------------

.radio-icon {
position: relative;
top: 0;
left: 0;
display: block;
width: $radio-wp-icon-width;
height: $radio-wp-icon-height;
margin: 0;
border-width: $radio-wp-icon-border-width;
border-style: $radio-wp-icon-border-style;
border-color: $radio-wp-color-off;
border-radius: $radio-wp-icon-border-radius;
}


// Windows Radio Inner Circle: Unchecked
// -----------------------------------------

.radio-inner {
position: absolute;
top: $radio-wp-icon-border-width;
left: $radio-wp-icon-border-width;
width: $radio-wp-icon-width / 2;
height: $radio-wp-icon-height / 2;
background-color: $radio-wp-color-off;
border-radius: 50%;
display: none;
}


// Windows Radio Outer Circle: Checked
// -----------------------------------------

.radio-checked {
border-color: $radio-wp-color-on;
}


// Windows Radio Inner Circle: Checked
// -----------------------------------------

.radio-checked .radio-inner {
// transform: scale3d(1, 1, 1);
display: block;
}


// Windows Radio: Disabled
// -----------------------------------------

.radio-disabled,
.item-radio-disabled ion-label {
opacity: $radio-wp-disabled-opacity;
pointer-events: none;
}


// Windows Radio Within An Item
// -----------------------------------------

.item ion-radio {
position: static;
display: block;
margin: $item-wp-padding-media-top ($item-wp-padding-right / 2) $item-wp-padding-media-bottom 0;
}

.item-radio ion-label {
margin-left: 0;
}


// Windows Radio Color Mixin
// --------------------------------------------------

@mixin radio-theme-wp($color-name, $color-value) {

ion-radio[#{$color-name}] {

.radio-checked {
border-color: $color-value;
}

}

}


// Generate Windows Radio Colors
// --------------------------------------------------

@each $color-name, $color-value in $colors-wp {

@include radio-theme-wp($color-name, $color-value);

}
7 changes: 5 additions & 2 deletions ionic/components/toolbar/toolbar.wp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ $toolbar-order-wp: (

$toolbar-wp-padding: 4px !default;
$toolbar-wp-height: 4.6rem !default;
$toolbar-wp-title-font-size: 2.0rem !default;
$toolbar-wp-title-font-size: 1.5rem !default;
$toolbar-wp-title-font-weight: bold !default;
$toolbar-wp-title-text-transform: uppercase !default;
$toolbar-wp-button-font-size: 1.4rem !default;
$navbar-wp-height: $toolbar-wp-height !default;

Expand Down Expand Up @@ -58,7 +60,8 @@ ion-navbar-section {
color: $toolbar-wp-text-color;
padding: 0 12px;
font-size: $toolbar-wp-title-font-size;
font-weight: 500;
font-weight: $toolbar-wp-title-font-weight;
text-transform: $toolbar-wp-title-text-transform;
}

@mixin wp-toolbar-theme($color-name, $color-value) {
Expand Down

0 comments on commit dd206ad

Please sign in to comment.