Skip to content

Commit

Permalink
fix(material/checkbox): broken appearance in some grid layouts (#25197)
Browse files Browse the repository at this point in the history
Fixes that the checkbox looked broken when placed in some CSS grid layouts.

Fixes #25153.

(cherry picked from commit 6d33f56)
  • Loading branch information
crisbeto committed Jun 30, 2022
1 parent d375d4d commit f5bdefe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/material-experimental/mdc-checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
// we have to change it in order for margins to work.
display: inline-block;

// Avoids issues in some CSS grid layouts (see #25153).
position: relative;

.mdc-checkbox {
// MDC theme styles also include structural styles so we have to include the theme at least
// once here. The values will be overwritten by our own theme file afterwards.
Expand Down
3 changes: 3 additions & 0 deletions src/material/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ $_mark-stroke-size: math.div(2, 15) * checkbox-common.$size !default;
cursor: pointer;
-webkit-tap-highlight-color: transparent;

// Avoids issues in some CSS grid layouts (see #25153).
position: relative;

.mat-ripple-element:not(.mat-checkbox-persistent-ripple) {
opacity: 0.16;
}
Expand Down

0 comments on commit f5bdefe

Please sign in to comment.