Hi @Bergur Hansen ,
Yes, there is no OOB solution to set background color of a web part, but we can achieve it by injecting CSS code to SharePoint modern page. There are two options for you to achieve this:
- Install Modern Script Editor Web Part for SharePoint Online Modern Site and inject CSS code to the Script Editor web part.
Reference: https://social.technet.microsoft.com/Forums/office/en-US/d4b8b3c4-8950-4407-9120-204b80fc35f9/sharepoint-online-best-practice-install-modern-script-editor-web-part-for-sharepoint-online?forum=odspproductsandservicesharing .<classname> {
background-color: <color>;
} - Inject Custom CSS on SharePoint Modern Pages using SPFx Extensions.
Reference: https://tahoeninjas.blog/2018/05/08/inject-custom-css-on-sharepoint-modern-pages-using-spfx-extensions/.
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.