Not sure if you have to use the shelves, but if not, another option might be to use filing cabinets. A standard vertical cabinet is about 25 inches deep and a lateral cabinet is about 19 inches deep. Here’s a blogger on how she “files” her fabric:
https://sewmanyways.blogspot.com/201...ur-fabric.html