Skip to content

Commit

Permalink
Follow the user’s tab-size setting where possible (#4833)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Oct 1, 2021
1 parent 41f0292 commit 0313dc8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
29 changes: 29 additions & 0 deletions source/features/show-whitespace.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
/*
Can't use this because attributes are strings and calc() won't cast them
ttps://stackoverflow.com/a/40815884
[data-tab-size] {
--tab-size: attr(data-tab-size);
}
*/

[data-tab-size='2'] {
--tab-size: 2;
}

[data-tab-size='4'] {
--tab-size: 4;
}

[data-tab-size='8'] {
--tab-size: 8;
}

[data-tab-size='10'] {
--tab-size: 10;
}

[data-tab-size='12'] {
--tab-size: 12;
}

[data-rgh-whitespace] {
line-height: 1em;
background-clip: border-box;
Expand Down
9 changes: 7 additions & 2 deletions source/refined-github.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
}

/* Make tab indented code more readable on GitHub and Gist */
:root, /* GHE, drop in February 2022 */
.comment-body [data-tab-size='8'] { /* User setting is ignored in comments #4833 */
--tab-size: 4;
}

* {
-moz-tab-size: 4 !important;
tab-size: 4 !important;
-moz-tab-size: var(--tab-size) !important;
tab-size: var(--tab-size) !important;
}

/* For `open-all-selected` and `pr-filters`: set a reduced padding for all buttons for #1830 and #1904 */
Expand Down

0 comments on commit 0313dc8

Please sign in to comment.