tabvengers / spicy-sections

Creative Commons Zero v1.0 Universal
128 stars 10 forks source link

Use accessible indentation #59

Closed jonathantneal closed 2 years ago

jonathantneal commented 2 years ago

This change replaces spaces for tabs to provide accessible indentation in SpicySections.js.

Why are tabs more accessible than spaces?
Tabs are more accessible than spaces because they represent indentation visually and non-visually. Tabs allow developers to choose the indentations that make the most sense for them. Tabs improve how code is interpreted in non-visual mediums. **Example** > Just had a conversation about indentation with a blind programmer, and realized this is the most accessible indentation convention as well. Tabs as indentation means # tabs = indent level, and all spaces (including alignment spaces) can be simply ignored when reading out code. > — [@fantasai](https://twitter.com/fantasai/status/1039647453618659328) (W3C CSSWG specifications writer, 2004 to present) **Example** - Jane Developer uses a tab width of 1 because they use a large font size. - Jill Developer uses a tab width of 8 because they use a very wide monitor. Only tabs allow developers to choose their tab width. **Example** Alan struggles reading two-space indentation at a comfortable font size. To reach a comfortable indentation, Alan must increase the text size. Alan now struggles reading uncomfortably large text at a comfortable indentation.
Can 2-space, 4-space, etc indentation be accessible?
No. At least, no yet. If at some future point browsers and IDE developers can change how space-indentation is announced and can enable space indentation to stretch or contract — this could be changed to any other preference. Until this, this change is backwards compatible by decades.

To accomplish this change:

I did not commit the configuration to this project, but I will if we think it would be desirable.

bkardell commented 2 years ago

I am fine with all of these - it's a little hard to review as it touches the whole file, but we've tested and have tests and nothing seems breaking, so I approve.