mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
feat(windows): add checkbox styling and update alert checkbox
references #5565
This commit is contained in:
@ -10,4 +10,5 @@
|
|||||||
"components/alert/alert.wp",
|
"components/alert/alert.wp",
|
||||||
"components/badge/badge.wp",
|
"components/badge/badge.wp",
|
||||||
"components/button/button.wp",
|
"components/button/button.wp",
|
||||||
|
"components/checkbox/checkbox.wp",
|
||||||
"components/toolbar/toolbar.wp";
|
"components/toolbar/toolbar.wp";
|
||||||
|
@ -202,13 +202,13 @@ $alert-wp-buttons-justify-content: flex-end !default;
|
|||||||
|
|
||||||
&:after {
|
&:after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-width: 2px;
|
border-width: 1px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: $alert-wp-background-color;
|
border-color: $alert-wp-background-color;
|
||||||
top: 0;
|
top: -2px;
|
||||||
left: 3px;
|
left: 3px;
|
||||||
width: 4px;
|
width: 6px;
|
||||||
height: 8px;
|
height: 12px;
|
||||||
border-left: none;
|
border-left: none;
|
||||||
border-top: none;
|
border-top: none;
|
||||||
content: '';
|
content: '';
|
||||||
|
130
ionic/components/checkbox/checkbox.wp.scss
Normal file
130
ionic/components/checkbox/checkbox.wp.scss
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
@import "../../globals.wp";
|
||||||
|
|
||||||
|
// Windows Checkbox
|
||||||
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
$checkbox-wp-border-bottom-width: 1px !default;
|
||||||
|
$checkbox-wp-border-bottom-style: solid !default;
|
||||||
|
$checkbox-wp-border-bottom-color: $list-wp-border-color !default;
|
||||||
|
$checkbox-wp-padding: $item-wp-padding-top ($item-wp-padding-right / 2) $item-wp-padding-bottom 0 !default;
|
||||||
|
$checkbox-wp-margin: 0 !default;
|
||||||
|
$checkbox-wp-media-margin: $item-wp-padding-media-top 36px $item-wp-padding-media-bottom 4px !default;
|
||||||
|
$checkbox-wp-disabled-opacity: 0.3 !default;
|
||||||
|
|
||||||
|
$checkbox-wp-icon-background-color-off: $list-wp-background-color !default;
|
||||||
|
$checkbox-wp-icon-background-color-on: map-get($colors-wp, primary) !default;
|
||||||
|
$checkbox-wp-icon-size: 16px !default;
|
||||||
|
|
||||||
|
$checkbox-wp-icon-checkmark-width: 1px !default;
|
||||||
|
$checkbox-wp-icon-checkmark-style: solid !default;
|
||||||
|
$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-on: map-get($colors-wp, primary) !default;
|
||||||
|
|
||||||
|
$checkbox-wp-transition-duration: 280ms !default;
|
||||||
|
$checkbox-wp-transition-easing: cubic-bezier(.4,0,.2,1) !default;
|
||||||
|
|
||||||
|
|
||||||
|
ion-checkbox {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Windows Checkbox Outer Square: Unchecked
|
||||||
|
// -----------------------------------------
|
||||||
|
|
||||||
|
.checkbox-icon {
|
||||||
|
position: relative;
|
||||||
|
width: $checkbox-wp-icon-size;
|
||||||
|
height: $checkbox-wp-icon-size;
|
||||||
|
border-radius: $checkbox-wp-icon-border-radius;
|
||||||
|
border-width: $checkbox-wp-icon-border-width;
|
||||||
|
border-style: $checkbox-wp-icon-border-style;
|
||||||
|
border-color: $checkbox-wp-icon-border-color-off;
|
||||||
|
background-color: $checkbox-wp-icon-background-color-off;
|
||||||
|
|
||||||
|
transition-property: background;
|
||||||
|
transition-duration: $checkbox-wp-transition-duration;
|
||||||
|
transition-timing-function: $checkbox-wp-transition-easing;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Windows Checkbox Outer Square: Checked
|
||||||
|
// -----------------------------------------
|
||||||
|
|
||||||
|
.checkbox-checked {
|
||||||
|
background-color: $checkbox-wp-icon-background-color-on;
|
||||||
|
border-color: $checkbox-wp-icon-border-color-on;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Windows Checkbox Inner Checkmark: Checked
|
||||||
|
// -----------------------------------------
|
||||||
|
|
||||||
|
.checkbox-checked .checkbox-inner {
|
||||||
|
position: absolute;
|
||||||
|
border-width: $checkbox-wp-icon-checkmark-width;
|
||||||
|
border-style: $checkbox-wp-icon-checkmark-style;
|
||||||
|
border-color: $checkbox-wp-icon-checkmark-color;
|
||||||
|
top: -2px;
|
||||||
|
left: 3px;
|
||||||
|
width: 6px;
|
||||||
|
height: 12px;
|
||||||
|
border-left: none;
|
||||||
|
border-top: none;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Windows Checkbox: Disabled
|
||||||
|
// -----------------------------------------
|
||||||
|
|
||||||
|
.checkbox-disabled,
|
||||||
|
.item-checkbox-disabled ion-label {
|
||||||
|
opacity: $checkbox-wp-disabled-opacity;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Windows Checkbox Within An Item
|
||||||
|
// -----------------------------------------
|
||||||
|
|
||||||
|
.item ion-checkbox {
|
||||||
|
position: static;
|
||||||
|
display: block;
|
||||||
|
margin: $checkbox-wp-media-margin;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-checkbox + .item-inner ion-label {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Windows Checkbox Color Mixin
|
||||||
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
@mixin checkbox-theme-wp($color-name, $bg-on) {
|
||||||
|
|
||||||
|
ion-checkbox[#{$color-name}] .checkbox-checked {
|
||||||
|
background-color: $bg-on;
|
||||||
|
border-color: $bg-on;
|
||||||
|
|
||||||
|
.checkbox-inner {
|
||||||
|
border-color: color-inverse($bg-on);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Generate Windows Checkbox Colors
|
||||||
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
@each $color-name, $color-value in $colors-wp {
|
||||||
|
@include checkbox-theme-wp($color-name, $color-value);
|
||||||
|
}
|
Reference in New Issue
Block a user