Skip to content

Instantly share code, notes, and snippets.

@remy
Last active August 21, 2023 14:46
Show Gist options
  • Save remy/21c4f7a830a1712de31a18aa7f559ef7 to your computer and use it in GitHub Desktop.
Save remy/21c4f7a830a1712de31a18aa7f559ef7 to your computer and use it in GitHub Desktop.
A user style sheet to remove crud from twitter
/* ==UserStyle==
@name twitter.com - 24/07/2023, 22:01:46
@namespace github.com/openstyles/stylus
@version 1.0.1
@description Remove all the crud from twitter
@author Remy Sharp
==/UserStyle== */
@-moz-document domain("twitter.com") {
h1 a[aria-label="Twitter"] svg, /* stupid new logo */
[data-testid="BottomBar"], /* cookie concent */
[aria-label="Get Verified"],
[aria-label="Bookmarks"], /* noise on the sidebar */
[aria-label="Communities"],
[aria-label="Verified"],
[aria-label="Lists"],
[data-testid="DMDrawer"], /* twitter != chat */
[style="transform: translate3d(0px, 0px, 0px) translateY(106px);"], /* I don't need notifications */
[aria-label="Trending"] > div > div:not(:first-child),
[data-testid="left-impression-pixel"] + article, /* promoted tweets - leaves a double tram line, but that's better than the crud */
/*div:has(> [data-testid="placementTracking"]),*/
x
{
display: none;
}
[data-testid="sidebarColumn"] {
position: absolute;
left: 8px;
top: 0;
z-index: 1;
}
[data-testid="sidebarColumn"] form > div {
width: calc(600px - 16px);
}
/* this is really tricky to target without having the :has selcetor (in FF) */
[aria-labelledby="modal-header"][aria-modal="true"] > div > div:first-child [style*="height"] div[aria-label]:not([aria-label=""]):not([aria-label="Image"]):not([role]):after {
content: attr(aria-label);
color: white;
position: absolute;
bottom: 8px;
background: rgba(0,0,0,0.9);
padding: 8px 16px;
width: 100%;
font-size: 120%;
font-family: sans-serif;
text-align: center;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment