-
-
Notifications
You must be signed in to change notification settings - Fork 995
Description
Before you start - checklist
- I followed instructions in documentation written for my React-PDF version
- I have checked if this bug is not already reported
- I have checked if an issue is not listed in Known issues
- If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
Hi I'm trying to change a page background color the parent node of canvas. It is div that class name is "react-df__Page" in dev tools.
I've tried two ways for changing the background color
-
modifying css attribute in index.css like below
.react-pdf__Page { background-color: antiquewhite; } -
attempting tailwind css style with modifying className attribute of Page component
<Page pageIndex={i} className="flex flex-col items-center bg-[#f4f5fa] dark:bg-slate-800" renderTextLayer={false} renderAnnotationLayer={false} key={page_${i + 1}} />
I tried both methods, but neither of them resolved the issue. How can I change the background color? I want change that white spaces below like other navy color sides
" not changing canvasBackground itself "
" without using !important "
Steps to reproduce
try to change style
Expected behavior
backgorund color changing
Actual behavior
no response
Additional information
No response
Environment
- Browser (if applicable): Chrome ≥92
- React-PDF version: ^7.1.3
- React version: ^18.2.0
- Webpack version (if applicable): CRA
