feat(checkbox): add --checkmark-width variable (#19933)

resolves #16803

Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
This commit is contained in:
Alex Arvanitidis
2020-01-03 18:20:04 +01:00
committed by Liam DeBeasi
parent 9318d2418e
commit c32a7bcd20
5 changed files with 11 additions and 2 deletions

View File

@ -225,6 +225,7 @@ ion-checkbox,css-prop,--border-radius
ion-checkbox,css-prop,--border-style
ion-checkbox,css-prop,--border-width
ion-checkbox,css-prop,--checkmark-color
ion-checkbox,css-prop,--checkmark-width
ion-checkbox,css-prop,--size
ion-checkbox,css-prop,--transition

View File

@ -10,6 +10,7 @@
--border-width: #{$checkbox-md-icon-border-width};
--border-style: #{$checkbox-md-icon-border-style};
--border-color: #{$checkbox-md-icon-border-color-off};
--checkmark-width: 3;
// Background
--background: #{$checkbox-md-icon-background-color-off};
@ -27,7 +28,6 @@
.checkbox-icon path {
stroke-dasharray: 30;
stroke-dashoffset: 30;
stroke-width: 3;
}
// Material Design Checkbox: Checked / Indeterminate

View File

@ -19,10 +19,12 @@
* @prop --transition: Transition of the checkbox icon
*
* @prop --checkmark-color: Color of the checkbox checkmark when checked
* @prop --checkmark-width: Stroke width of the checkbox checkmark
*/
--background-checked: #{ion-color(primary, base)};
--border-color-checked: #{ion-color(primary, base)};
--checkmark-color: #{ion-color(primary, contrast)};
--checkmark-width: 1;
--transition: none;
display: inline-block;
@ -65,7 +67,7 @@ button {
.checkbox-icon path {
fill: none;
stroke: var(--checkmark-color);
stroke-width: 1;
stroke-width: var(--checkmark-width);
opacity: 0;
}

View File

@ -218,6 +218,7 @@ export const CheckboxExample: React.FC = () => (
| `--border-style` | Border style of the checkbox icon |
| `--border-width` | Border width of the checkbox icon |
| `--checkmark-color` | Color of the checkbox checkmark when checked |
| `--checkmark-width` | Stroke width of the checkbox checkmark |
| `--size` | Size of the checkbox icon |
| `--transition` | Transition of the checkbox icon |

View File

@ -76,6 +76,11 @@
<ion-checkbox checked color="dark" slot="start" style="--size: 100px;"></ion-checkbox>
</ion-item>
<ion-item>
<ion-label>Checkmark width</ion-label>
<ion-checkbox checked color="dark" slot="start" style="--checkmark-width: 7;"></ion-checkbox>
</ion-item>
<ion-item>
<ion-label>Unchecked by Default</ion-label>
<ion-checkbox></ion-checkbox>