-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(windows): add checkbox styling and update alert checkbox
references #5565
- Loading branch information
1 parent
1fc0a23
commit 1ecfa6f
Showing
3 changed files
with
135 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |