Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tab-size #17

Closed
sindresorhus opened this issue Feb 9, 2018 · 8 comments
Closed

Fix tab-size #17

sindresorhus opened this issue Feb 9, 2018 · 8 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@sindresorhus
Copy link
Owner

sindresorhus commented Feb 9, 2018

I would like to change the tab-size from 8 to 4. I realize it's not strictly a normalization, as all browsers use 8, but it would improve the experience for everyone, so I think it's worth an exception. 8 is just a really really bad default. It has, for example, made tab-indented code on the web unreadable (isaacs/github#170).

I propose adding the following:

:root {
	-moz-tab-size: 4;
	tab-size: 4;
}

Using :root so users can easily override it on a per-element basis.

Thoughts?

(If you 👎 please also share your thoughts on why)

@sindresorhus sindresorhus added enhancement New feature or request question Further information is requested labels Feb 9, 2018
@simonlc
Copy link

simonlc commented Feb 9, 2018

Normalize to me is more of a pre-defaults project. I think sane defaults, like box-sizing and such, should be in a different project. My reasoning for this is, I may need older browser support in my normalization, but still want sane defaults, I wouldn't want to import two normalize.css projects.

@sindresorhus
Copy link
Owner Author

@simonlc And I agree in general, this project is for normalization, but I've already argued above that this specific case would be a nice exception. It shouldn't cause any problems. Only huge benefits.

I may need older browser support in my normalization

This project doesn't support older browsers.

@Altug
Copy link

Altug commented Feb 9, 2018

I support the "not supporting old browsers" approach 👍
That is the only way to progress..

@fvsch
Copy link

fvsch commented Feb 9, 2018

As a side note, I asked on the CSSWG tracker if tab-size could be changed to a default of 4, and it’s not likely because it might break some specific websites that use ASCII art with mixed tabs and spaces.

If you’re a base CSS lib and not a browser though, tab-size: 4 makes a lot of sense.

@styfle
Copy link

styfle commented Feb 9, 2018

it might break some specific websites that use ASCII art with mixed tabs and spaces.

Oddly enough, most[*] text editors set tab size to 4 so the web is actually already breaking ASCII art 😆

[*]: I realize that "most" is a strong word but most I have used. Maybe most modern IDEs.

@LitoMore
Copy link

LitoMore commented Feb 9, 2018

It’s a good idea for solve xojs/xo#45 (comment).

@jerolimov
Copy link

jerolimov commented Feb 11, 2018

I really like this. But isn't it possible to add this only to code, kbd, samp and pre?

@sindresorhus
Copy link
Owner Author

@jerolimov I don't really see the benefit of narrowing it down. Tabs can be used outside those tags too.

christiankaindl pushed a commit to Flamous/flamous-music that referenced this issue Dec 25, 2018
We went from modern normalize to normalize.css, because I feel that the latter is bigger and better maintained.

Maybe we will switch in the future again, or make our own...

See (fonts): sindresorhus/modern-normalize#16

and (tab-size): sindresorhus/modern-normalize#17

Thanks modern-normalize!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants