Based on your description, I understand that Due date is less than 10 days from today's date, then row background color displays in red. Here're steps:
1.All Documents -> Format current view -> Advanced mode.
2.Use below codes in the Advanced mode.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"additionalRowClass": "=if([$DueDate]-@now< 10, 'sp-field-severity--severeWarning', '')"
}
3.Result.
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.