Skip to content

Commit 5fd431f

Browse files
authored
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
1 parent 03cc48d commit 5fd431f

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
@@ -44,6 +44,13 @@
4444
}
4545
}
4646

47+
48+
.mdc-checkbox__background {
49+
// force browser to show background-color when using the print function
50+
-webkit-print-color-adjust: exact;
51+
color-adjust: exact;
52+
}
53+
4754
// Angular Material supports disabling all animations when NoopAnimationsModule is imported.
4855
// TODO(mmalerba): Look into using MDC's Sass queries to separate the animation styles and
4956
// 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
@@ -288,6 +288,10 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * checkbox-common.$size !default;
288288
variables.$linear-out-slow-in-timing-function, opacity checkbox-common.$transition-duration
289289
variables.$linear-out-slow-in-timing-function;
290290

291+
// force browser to show background-color when using the print function
292+
-webkit-print-color-adjust: exact;
293+
color-adjust: exact;
294+
291295
._mat-animation-noopable & {
292296
transition: none;
293297
}

src/material/radio/radio.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ $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)