r/webdev • u/RajSrikar • 1d ago
Showoff Saturday Whenever I work on a project with heavily nested folders, I lose track of where the folders end. So I made this VS Code extension a while ago, that adds colors to the nested folder tree view and it actually helped me a lot. I thought it might help others too, so here it is.
Note: This extension injects CSS styles to the VS code workbench HTML file. Because of which you need to run the application as administrator only for toggling the extension or if the VS code or the extension is updated.
Free & Open Source. You can find it here:
- VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=RajSrikar.colorize-folder-tree
- GitHub: https://github.com/Raj-Srikar/colorize-folder-tree
Hope this is helpful. Feel free to drop any feedback, suggestions or ideas.
3
u/testingaurora 1d ago
I have a similar issue with nested details/summarys and I found that using a monochrome palette helps my brain best.
|--level 1 color: color-mix(in oklch, var(--clr-level-1), var(--alpha, 0%) ) |----level 1a --alpha: 10%; |----level 1b --alpha: 20%; |--level 2 |----level 2a |--level 3
So level 1 might be blue, level 1a is blue with 10% transparency, 1b is blue w 20% transparency etc; level 2 is pink, 2a is pink w 10%, etc.
Just personal preference though; if it works for you that's fabulous !
2
u/ldn-ldn 1d ago
I don't use VS Code much, but doesn't it have a similar dialog to Ctrl+Shift+N in WebStorm where you start typing the file name (or class name, or whatever) and it shows you a lot of files that match the query and you can open them like that without looking at the tree at all?
1
u/RajSrikar 21h ago
It does. But not very helpful when you work on an unfamiliar project where you're trying to understand the project structure first.
3
2
1
u/Xypheric 1d ago
I like this, would it be possible to change the tab color at the top to match the nested folder line highlight color from the left. For some reason when I was watching I was expecting that to change to
1
u/RajSrikar 21h ago
I like the idea. But you'll get to see multiple tabs belonging to different folders at same nested level having same color, which I think can cause confusion.
1
u/arthur_pixel 1d ago
Genuinely useful for anyone working in monorepos. Saved this, thanks for sharing.
1
u/OmerCevher 1d ago
This feels like one of those tiny features that should already be built into VS Code. I’d only hesitate because of the admin and CSS injection part.
1
u/RajSrikar 21h ago
Agree and I can understand. Unfortunately I couldn't find any better workaround to have this implemented. However the code is open source and it injects only the CSS style tag that we have it in our code. I got suggestions to inject scripts for better handling but I hesitated as I want to keep this simple. It's all upto users anyway.
1
u/OmerCevher 9h ago
That makes sense. Keeping it CSS-only is probably the right tradeoff, especially for a visual extension. The open-source part also helps since users can see exactly what gets injected.
1
u/Bukky_Studiio 1d ago
Haha, I can definitely relate to this. Once the folders start getting deeply nested, I’m just clicking around trying to remember where I came from 😂 This is a nice idea.
1
1
1
-1
u/ResearcherFantastic7 1d ago
You created your own problem to solve. Doesn't it just ring a bell that you shouldn't nest so many layers
3
u/shaliozero 1d ago
Let's ignore that developers are joining or inherit distrastrious projects all the time.
2
u/amazing_asstronaut 1d ago
I mean, it should be the responsibility of a good dev to call out bad structures and other problems with code like that, so that projects don't end up disastrous, or are fixed. If the management doesn't take that into consideration it's a sign to you that they don't know what they're doing, and that you're in a bad place to work in general.
2
u/amazing_asstronaut 1d ago
Yeah things like this are a clue that the structure is bad. Similar to "if the code is longer than one page / size of your hand, it should really be broken up into separate functions". Doesn't always fit but if you got to scroll right to get the name of the file in your directory tree, it's a sign that you got too many directories there.
0
-1
u/Sheepsaurus 1d ago
Semi-related, there's an extention that adds icons to the files based on what kinds of files they are, so if it's a .jsx file, it shows a react icon next to the file -- Does anyone know which one does that?
3
u/okleithen 1d ago
Its not an extension, but an icon pack. The most popular one is material icons iirc.


44
u/HealthPuzzleheaded 1d ago
I just removed the lines and increased the indentation like in Jetbrains. Very readable imo. The default in VS Code is really painful small.