Skip to content

Commit 0687780

Browse files
felhagwagnermaciel
authored andcommitted
feat(radio/checkbox): show background-color in print stylesheet (#22298) (#22299)
* feat(material/radio): show background-color in print stylesheet (#22298) * added color-adjust for radio background-color * feat(material/checkbox): show background-color in print stylesheet (#22298) * added color-adjust for checkbox background-color * feat(material-experimental/mdc-checkbox): show background-color in print stylesheet (#22298) * added color-adjust for checkbox background-color (cherry picked from commit 5fd431f)
1 parent 6277ee2 commit 0687780

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/material-experimental/mdc-checkbox/checkbox.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@
6464
opacity: map-get($mdc-ripple-dark-ink-opacities, press);
6565
}
6666

67+
68+
.mdc-checkbox__background {
69+
// force browser to show background-color when using the print function
70+
-webkit-print-color-adjust: exact;
71+
color-adjust: exact;
72+
}
73+
6774
// Angular Material supports disabling all animations when NoopAnimationsModule is imported.
6875
// TODO(mmalerba): Look into using MDC's Sass queries to separate the animation styles and
6976
// conditionally add them. Consider the size cost when deciding whether to switch.

src/material/checkbox/checkbox.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;
276276
$mat-linear-out-slow-in-timing-function,
277277
opacity $mat-checkbox-transition-duration $mat-linear-out-slow-in-timing-function;
278278

279+
// force browser to show background-color when using the print function
280+
-webkit-print-color-adjust: exact;
281+
color-adjust: exact;
282+
279283
._mat-animation-noopable & {
280284
transition: none;
281285
}

src/material/radio/radio.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ $mat-radio-ripple-radius: 20px;
8080
// IE to flash the entire circle for a couple of frames, throwing off the entire animation.
8181
transform: scale(0.001);
8282

83+
// force browser to show background-color when using the print function
84+
-webkit-print-color-adjust: exact;
85+
color-adjust: exact;
86+
8387
._mat-animation-noopable & {
8488
transition: none;
8589
}

0 commit comments

Comments
 (0)