sindresorhus/refined-github

GitHub's custom tab size is overridden #4806

kidonng posted onGitHub

Description

https://github.com/sindresorhus/refined-github/blob/99e81baaac8c787d1a59b74194c9437e9c29ffdf/source/refined-github.css#L8-L12

See sindresorhus/tab-size-on-github#21

Aside from GHE, I'm also a little bit concerned about the discoverability of GitHub's option. It may make sense to still keep it as a default in RGH 🤷‍♀️

Screenshot

No response

Example URL

https://github.com/sindresorhus/refined-github/blob/main/package.json


You're too fast 😃

posted by fregante over 3 years ago

😃 I didn't even subscribe to https://github.blog/changelog/, I just happened to notice it in the settings.

posted by kidonng over 3 years ago

Considerations:

  • Our selector currently overrides GitHub’s preference
  • GitHub sets the size on each rendered code block (table.highlight) via [data-tab-size="8"]
  • There's apparently no way to distinguish between a user choice of 8 and an "non set" tab size

The last point means we might override the user’s choice, so that alone is a good reason to drop it altogether.

Some things to be aware of:

  • we're using our custom --tab-size variable in show-whitespace so we need to update that as well

Instead of defaulting to 4 like it does now, we should set --tab-size on each of the [data-tab-size="XXX"] settings and then keep using it as we are now.

posted by fregante over 3 years ago

Instead of defaulting to 4 like it does now, we should set --tab-size on each of the [data-tab-size="XXX"] settings and then keep using it as we are now.

Can't we just use attr(data-tab-size)? Or just provide matching styles for multiple classes like GitHub.

posted by kidonng over 3 years ago
  • GitHub sets the size on each rendered code block (table.highlight)

This also seems to mean that input fields aren't covered 🤔

If I disable RGH I don't see any changes in tab size, but also I don't see any tab-size property at all. Maybe we should leave that CSS just for the text areas, unless they're inside a [data-tab-size] table.

posted by fregante over 3 years ago

It's been a while, but I think we had --tab-size to play nice with the Tab Size extension. You really don't see that being set anywhere in our codebase, that can be removed I think.

posted by notlmn over 3 years ago

It's used by show-whitespace

posted by fregante over 3 years ago

Fund this Issue

$0.00
Funded

Pull requests