An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
Configure your browser's default tab size
I always used space for indentation. But lately I got convinced that tabs are better. So I switched to it for my new projects, enforced by Editor Config and Prettier.
My preference is one tab equals two spaces. But by default my browser's (Firefox) default tab size is 8. So I wanted to tweak it.
Unfortunately, I couldn't find a setting related to it. But I found the CSS tab-size
property. This property existence and good browsers compatibility means that if I can apply tab-size: 2;
by default on all pages I visit, my preference will by applied.
To do that, I downloaded the Stylus extension and created a custom stylesheet with the following CSS code:
body { tab-size: 2;}
And voil . Now I simply author my source code with tabs, my editor is configured to respect my preference for tab size and my browser also respects it. And every person that reads my code can also just set their tab size to their preferred value without me proclaiming "your should read it this way".
PS: please don't fight between spaces and tabs here. This post is not intended to elaborate on this question, but to help people looking for ways to configure their browser's default tab size.
Original Link: https://dev.to/drazik/configure-your-browsers-default-tab-size-3bbj
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To