I recently inspected a property where the basement had been remodeled. The service and sub panels created an obstacle as far as an eye sore for finishing the basement. The homeowner’s solution was to enclose the panels in a closet door and frame.
When closed, there is absolutely no clearance (OK maybe an inch or two) between the door face and the deadfront.
This remodel took place within the last few years. An electrician stated in his estimate that clearance was acceptable at time of installation.
I totally disagree.