-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
236 additions
and
252 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
.euiScreenReaderOnly { | ||
@mixin euiScreenReaderOnly() { | ||
position: absolute; | ||
left: -10000px; | ||
top: auto; | ||
width: 1px; | ||
height: 1px; | ||
overflow: hidden; | ||
} | ||
|
||
.euiScreenReaderOnly { | ||
@include euiScreenReaderOnly; | ||
} |
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 |
---|---|---|
@@ -1,96 +1,93 @@ | ||
.euiCheckbox { | ||
position: relative; | ||
min-height: $euiSizeL; | ||
|
||
/** | ||
* 1. Float above the visual checkbox and match its dimension, so that when users try to click it | ||
* they actually click this input. | ||
*/ | ||
.euiCheckbox__input { | ||
position: absolute; /* 1 */ | ||
opacity: 0; /* 1 */ | ||
height: $euiSizeL; /* 1 */ | ||
width: $euiSizeL; /* 1 */ | ||
z-index: 1; /* 1 */ | ||
margin: 0; /* 1 */ | ||
cursor: pointer; | ||
@include euiScreenReaderOnly; | ||
|
||
&:checked ~ .euiCheckbox__square { | ||
background: $euiColorPrimary; | ||
border-color: $euiColorPrimary; | ||
|
||
.euiCheckbox__check { | ||
border-color: $euiColorPrimary; | ||
background-color: $euiColorEmptyShade; | ||
// This path is relative to ~/src-docs/postcss.config.js, which uses | ||
// the postcss-line-svg plugin. | ||
mask: svg-load('../src/components/icon/assets/check.svg') center center no-repeat; | ||
} | ||
~ .euiCheckbox__label { | ||
display: block; | ||
padding-left: ($euiCheckBoxSize * 1.5); | ||
line-height: $euiSizeL; | ||
font-size: $euiFontSizeS; | ||
position: relative; | ||
z-index: 2; | ||
cursor: pointer; | ||
} | ||
|
||
&:focus ~ .euiCheckbox__square, | ||
&:active:not(:disabled) ~ .euiCheckbox__square { | ||
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1); | ||
border-color: $euiColorPrimary; | ||
border-width: $euiSizeXS / 2; | ||
+ .euiCheckbox__square { | ||
display: inline-block; | ||
position: absolute; | ||
left: 0; | ||
top: ($euiSizeL - $euiCheckBoxSize)/2; | ||
@include euiCustomControl($type: 'square', $size: $euiCheckBoxSize); | ||
} | ||
|
||
&:focus:checked ~.euiCheckbox__square { | ||
border-color: darken($euiColorPrimary, 10%); | ||
&:checked { | ||
+ .euiCheckbox__square { | ||
@include euiCustomControl--selected($type: 'check'); | ||
} | ||
} | ||
|
||
&:disabled, | ||
&:disabled ~ .euiCheckbox__label { | ||
cursor: not-allowed; | ||
&:indeterminate { | ||
+ .euiCheckbox__square { | ||
@include euiCustomControl--selected($type: 'dot'); | ||
} | ||
} | ||
|
||
&:disabled:checked ~ .euiCheckbox__square { | ||
background-color: $euiColorLightShade; | ||
border-color: $euiColorLightShade; | ||
} | ||
&[disabled] { | ||
cursor: not-allowed !important; | ||
|
||
&:disabled:not(:checked) ~ .euiCheckbox__square { | ||
background-color: $euiColorLightestShade; | ||
~ .euiCheckbox__label { | ||
color: $euiColorDarkShade; | ||
cursor: not-allowed !important; | ||
} | ||
|
||
+ .euiCheckbox__square { | ||
@include euiCustomControl--disabled(); | ||
} | ||
} | ||
} | ||
|
||
.euiCheckbox__square { | ||
position: absolute; | ||
height: $euiSizeL; | ||
width: $euiSizeL; | ||
border-radius: $euiBorderRadius; | ||
border: $euiBorderThin; | ||
background: $euiFormBackgroundColor; | ||
z-index: 0; | ||
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1); | ||
} | ||
&:checked[disabled] { | ||
+ .euiCheckbox__square { | ||
@include euiCustomControl--disabled($type: 'check'); | ||
} | ||
} | ||
|
||
.euiCheckbox__check { | ||
height: 100%; | ||
width: 100%; | ||
&:indeterminate[disabled] { | ||
+ .euiCheckbox__square { | ||
@include euiCustomControl--disabled($type: 'dot'); | ||
} | ||
} | ||
|
||
.euiCheckbox__label { | ||
padding-left: $euiSizeXL; | ||
line-height: $euiSizeL; | ||
display: block; | ||
font-weight: $euiFontWeightRegular; | ||
z-index: 2; | ||
font-size: $euiFontSizeS; | ||
cursor: pointer; | ||
&:focus, | ||
&:active:not(:disabled) { | ||
+ .euiCheckbox__square { | ||
@include euiCustomControl--focused; | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* 1. Float above the visual radio and match its dimension, so that when users try to click it | ||
* they actually click this input. | ||
*/ | ||
|
||
&.euiCheckbox--inList { | ||
min-height: $euiSize; | ||
min-height: $euiCheckBoxSize; | ||
min-width: $euiCheckBoxSize; | ||
|
||
.euiCheckbox__square { | ||
height: $euiSize; | ||
width: $euiSize; | ||
top: 0; | ||
} | ||
|
||
.euiCheckbox__input { | ||
height: $euiSize; | ||
width: $euiSize; | ||
position: absolute; /* 1 */ | ||
opacity: 0; /* 1 */ | ||
@include size($euiCheckBoxSize); /* 1 */ | ||
z-index: 1; /* 1 */ | ||
margin: 0; /* 1 */ | ||
left: 0; /* 1 */ | ||
cursor: pointer; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
$euiCheckBoxSize: $euiSize; | ||
|
||
@import 'checkbox'; | ||
@import 'checkbox_group'; |
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
Oops, something went wrong.