Skip to content

Custom Fonts (5.4.7) - Family & Size settings do not affect hidden view used for text cursor/selection #1362

Open
@dbarbuzzi

Description

@dbarbuzzi

This seems to be a reoccurrence of #1354 presumably related to changes on GitHub’s end. In the screenshot provided, notice that the highlighted selection only covers the lines partially, however, this selection includes the full lines.

Digging around with Inspect Element, while #read-only-cursor-text-area is still a valid selector for this element on such a page, it seems that the custom styles are being overwritten:

  • a rule for the selector .react-blob-print-hide overrides the custom font-family value
  • an in-line/element.style rule is overriding the custom font-size value

This appears to be resolved locally when adding .react-blob-print-hide to the list of selectors in the stylesheet:

diff --git a/github-custom-fonts.user.css b/github-custom-fonts.user.css
index 0960889f..399d9e1a 100644
--- a/github-custom-fonts.user.css
+++ b/github-custom-fonts.user.css
@@ -15,7 +15,7 @@
 @-moz-document regexp("^https?://((education|gist|graphql|guides|raw|resources|status|developer|support|vscode-auth)\\.)?github\\.com/((?!generated_pages/preview).)*$"), regexp("^https?://www\.zuora\.com.*github\.com.*"), domain("githubusercontent.com"), domain("www.githubstatus.com"), domain("stylishthemes.github.io") {
   pre, code, tt, kbd:not(.badmono), samp, .blob-code, .file-data pre, .line-data,
   #gist-form .file .input textarea, .blob-code-inner, .react-code-text, .jujkut,
-  #read-only-cursor-text-area {
+  #read-only-cursor-text-area, .react-blob-print-hide {
-     font-family: var(--ghd-font-family), Consolas, "Liberation Mono", Menlo, Courier, monospace;
+     font-family: var(--ghd-font-family), Consolas, "Liberation Mono", Menlo, Courier, monospace !important;
     font-feature-settings: var(--ghd-font-feature-settings);
     font-variant-ligatures: var(--ghd-font-variant-ligatures);
-    font-size: var(--ghd-font-size);
+    font-size: var(--ghd-font-size) !important;

Edit: Include the required addition of !important to the font-family and font-size values.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions