Skip to content

Commit c4f9642

Browse files
authored
Add print background colour and cell border for Firefox (#1993)
## What are you changing? - Add a print-only background colour to each cell - Add a print-only stroke colour to each cell ## Why? By default, Firefox doesn't support printing background colours. This behaviour must be [enabled using a setting in the print dialog](https://superuser.com/questions/1113516/is-it-possible-to-view-a-page-in-firefox-using-print-media-type). We can get around it using the `fill` property, which is currently set to `transparent` for the black cells. We can use the `stroke` property to set the border colour between cells. ## Screenshots **Before** <img width="366" alt="Screenshot 2025-03-05 at 17 57 25" src="https://github.com/user-attachments/assets/6f2cbb76-0499-4014-b1db-28037ce658d7" /> **After** <img width="368" alt="Screenshot 2025-03-05 at 21 25 29" src="https://github.com/user-attachments/assets/dcbb2320-a1b1-4afb-bd6c-afdbdf6b6f1d" />
2 parents 62adcd0 + f45dabf commit c4f9642

File tree

1 file changed

+4
-1
lines changed
  • libs/@guardian/react-crossword/src/components

1 file changed

+4
-1
lines changed

libs/@guardian/react-crossword/src/components/Cell.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ const CellComponent = ({
6565
const cellStyles = css`
6666
fill: ${backgroundColor};
6767
@media print {
68-
fill: ${isBlackCell ? 'transparent' : theme.gridForegroundColor};
68+
fill: ${isBlackCell
69+
? theme.gridPrintBackgroundColor
70+
: theme.gridForegroundColor};
71+
stroke: ${theme.gridPrintBackgroundColor};
6972
}
7073
`;
7174

0 commit comments

Comments
 (0)