-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(material/checkbox): refactor pseudo-checkbox size styles (#25419)
* feat(material/checkbox): refactor pseudo-checkbox size styles * feat(material/checkbox): keep 16px
- Loading branch information
1 parent
b863b14
commit e8e7199
Showing
4 changed files
with
44 additions
and
17 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
33 changes: 33 additions & 0 deletions
33
src/material/core/selection/pseudo-checkbox/_pseudo-checkbox-common.scss
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,33 @@ | ||
@use 'sass:math'; | ||
@use '../../style/checkbox-common'; | ||
|
||
// Padding inside of a pseudo checkbox. | ||
$padding: checkbox-common.$border-width * 2; | ||
|
||
/// Applies the styles that set the size of the pseudo checkbox | ||
@mixin size($box-size) { | ||
$mark-size: $box-size - (2 * $padding); | ||
|
||
.mat-pseudo-checkbox { | ||
width: $box-size; | ||
height: $box-size; | ||
} | ||
|
||
.mat-pseudo-checkbox-indeterminate::after { | ||
top: math.div($box-size - checkbox-common.$border-width, 2) - | ||
checkbox-common.$border-width; | ||
width: $box-size - 6px; | ||
} | ||
|
||
.mat-pseudo-checkbox-checked::after { | ||
top: math.div($box-size, 2) - math.div($mark-size, 4) - | ||
math.div($box-size, 10) - checkbox-common.$border-width; | ||
width: $mark-size; | ||
height: math.div($mark-size - checkbox-common.$border-width, 2); | ||
} | ||
} | ||
|
||
/// Applies the legacy size styles to the pseudo-checkbox | ||
@mixin legacy-size() { | ||
@include size(checkbox-common.$legacy-size); | ||
} |
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