Text selection is not visible in GitHub website #50295
-
Select Topic AreaBug BodyFirefox and Edge do not have this problem. So, with Chrome, when I am trying to select a text, the text really gets selected but it is not visible, I mean the text background does not change (not for all texts. Text in some parts of GitHub website seems fine. Mostly repository code texts have this problem). Other websites seem fine. Only GitHub website behaves like this. I think it's a bug of GitHub website, because the CSS style, which prevents changing text background, is coming from GitHub server. Please see the video: |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 16 replies
-
Temporary solution is to run this code in the dev tools console window: const addStyle = (styleString) => {
const style = document.createElement('style');
document.head.append(style);
style.textContent = styleString;
};
addStyle(`
body *::selection {
background-color: rgb(50 80 90 / 0.5) !important;
}
`); Yeah, every time we refresh the page, we will have to run this code again. It's just a quick temporary solution. |
Beta Was this translation helpful? Give feedback.
-
I'm experiencing the same issue with Edge 111.0.1661.44 (Official build) (64-bit), but no issue in Chrome 111.0.5563.65 (Official Build) (64-bit) P.S. |
Beta Was this translation helpful? Give feedback.
-
In my case this was caused by enabled |
Beta Was this translation helpful? Give feedback.
-
oh, how inconvenient it is not to be able to select text even in the editor. |
Beta Was this translation helpful? Give feedback.
-
Switching themes seems to help with the problem. Dark/light. |
Beta Was this translation helpful? Give feedback.
-
the problem will be solved if the polyfile is removed from the text selection code |
Beta Was this translation helpful? Give feedback.
-
Very odd indeed, the "Experimental Web Platform features" flag makes all Chrome versions I've tested (v111…v114) unable to resolve CSS variable references in Disabling the flag as suggested by @vanowm is one obvious workaround, but if you want to keep that flag enabled you'll want to inject some custom CSS (e.g. using the "User JavaScript and CSS" extension or something similar). You can either override the selection color directly, e.g. ::selection {
background-color: rgba(56,139,253,0.4) !important;
} or perhaps more elegantly you can declare the relevant variable in a place where it can be found by the existing styling rules: :root::selection {
--color-accent-muted: rgba(56,139,253,0.4);
} which avoids changing the scope(s) where this particular selection color is being applied by the theme. The variable name and value shown above are from the "Dark default" theme and may need to be tweaked if you're using a different theme that has the same problem. |
Beta Was this translation helpful? Give feedback.
-
I wrote that user script to resolve it: (help me publish it to all community, to resolve it nice for all)
|
Beta Was this translation helpful? Give feedback.
-
GitHub doesn't give a shit what we are suffering from the enforce this new pathetic incomplete UI on us. I suggest you guys shift to GitLab they have much more professional behaviors than Github. Almost thousands of people and companies move their work onto Gitlab and it is proven bt Twitter's recent poll. Leave their site and raise your voice, don't use Github until they fixed what they messed up. Best of Luck guy! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I've got the same issue, hope to fix this soon. |
Beta Was this translation helpful? Give feedback.
In my case this was caused by enabled
Experimental Web Platform features
flag:Chrome:
chrome://flags/#enable-experimental-web-platform-features
Edge:
edge://flags/#enable-experimental-web-platform-features