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

tab setting in https://userstyles.org/styles/37035/github-dark has no effect #543

Closed
the-j0k3r opened this issue Oct 10, 2017 · 13 comments
Closed
Labels
help wanted 🙏 Extra attention is needed

Comments

@the-j0k3r
Copy link
Member

  • Browser: forefox 56
  • Operating System: Win 10
  • Screenshot:

capture0

  • HTML of the section where the issue occurs:

Github edit
capture

<select class="form-select select-sm js-code-indent-width">
          <optgroup label="Indent size">
            <option value="2" selected="selected">2</option>
<option value="4">4</option>
<option value="8">8</option>
          </optgroup>
        </select>

Gist edit tabs
capture1

<select class="form-select select-sm js-code-indent-width">
          <optgroup label="Indent size">
            <option value="2">2</option>
<option value="4">4</option>
<option value="8" selected="selected">8</option>
          </optgroup>
        </select>
```
@Mottie
Copy link
Member

Mottie commented Oct 10, 2017

Hi @the-j0k3r!

It's working for me. I think that another style or userscript, there are a lot, is modifying the tab size and overriding the GitHub Dark setting. Try turning them off one-by-one to find the culprit. Please let us know if it's one of ours.

@the-j0k3r
Copy link
Member Author

Well, I disabled everything except github-dark cleared cookies, restarted firefox, disabled stylus/re-enabled, and still doesnt work.

@Mottie
Copy link
Member

Mottie commented Oct 10, 2017

Are you using any userscripts?

@Mottie
Copy link
Member

Mottie commented Oct 10, 2017

Oh, and we just changed the default tab setting on userstyles.org to "don't modify" (disabled). They totally messed up the storage, so you'll need to add any customizations every time you install/update a style.

@the-j0k3r
Copy link
Member Author

I did

@the-j0k3r
Copy link
Member Author

removed github dark rinse and repeat resets re-install gh dark

capture

the code is there, still doesnt work.

@Mottie
Copy link
Member

Mottie commented Oct 10, 2017

This was in Firefox... If you edit the tab size within Stylus, it may not automatically update the style unless you force an update.

@the-j0k3r
Copy link
Member Author

the-j0k3r commented Oct 10, 2017

well that works but doesnt work on the tab settings when editing code.

edit : the portion on screenshots is the relevant part.

@Mottie
Copy link
Member

Mottie commented Oct 10, 2017

Ahh, you mean only within CodeMirror...

From looking at the HTML, it appears that CodeMirror adds a span with however many spaces you have the tab size set to:

<span class="cm-tab" role="presentation" cm-text="	">        </span> <!-- tab size 8 -->
<span class="cm-tab" role="presentation" cm-text="	">    </span> <!-- tab size 4 -->
<span class="cm-tab" role="presentation" cm-text="	">  </span> <!-- tab size 2 -->
.cm-tab {
  display: inline-block;
  text-decoration: inherit;
}

I don't think there's much we can do about that besides modifying it with javascript.

@Mottie
Copy link
Member

Mottie commented Oct 10, 2017

Any ideas @silverwind?

The cm-text attribute does contain a tab, but I don't think using a :before or :after with that content would make any difference if we can't remove the spaces inside the span...

@silverwind
Copy link
Member

You could try font-size: 0 on the span.

@Mottie
Copy link
Member

Mottie commented Oct 10, 2017

That almost worked... but setting the font size for the :after is adding a top and bottom pad?

.cm-tab {
  display: inline !important;
  font-size: 0 !important;
}
span.cm-tab:after {
  content: attr(cm-text) !important;
  display: inline !important;
  font-size: 1rem !important;
}

I've tried .8rem but then the tab size changes as well.

@Mottie Mottie added the help wanted 🙏 Extra attention is needed label Oct 20, 2017
@the-j0k3r
Copy link
Member Author

superseded by #959 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🙏 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants