Skip to content

Instantly share code, notes, and snippets.

@simonuvarov
Last active November 9, 2023 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonuvarov/964885871217538c2066078b573c8125 to your computer and use it in GitHub Desktop.
Save simonuvarov/964885871217538c2066078b573c8125 to your computer and use it in GitHub Desktop.
CSS rules to remove clutter from Twitter UI
/* Navigation items I don't use */
div[aria-label="Trending"],
a[href="/i/articles"],
a[href="/simonuvarov/communities"],
a[href="/i/verified-orgs-signup"]
{
display: none;
}
/* Twitter logo */
h1[role="heading"] {
display: none;
}
/* Messages drawer */
div[data-testid="DMDrawer"] {
display: none;
}
/* Remove promoted posts */
[data-testid="placementTracking"] article {
display: none;
}
/* aria-label*="view" selects the toolbar with buttons */
/* Hide reply counter */
div[aria-label*="view"] > div:nth-of-type(1) > div > div > div:nth-of-type(2) {
display: none;
}
/* Hide retween counter */
div[aria-label*="view"] > div:nth-of-type(2) > div > div > div:nth-of-type(2) {
display: none;
}
/* Hide like counter */
div[aria-label*="view"] > div:nth-of-type(3) > div > div > div:nth-of-type(2) {
display: none;
}
/* Hide view counters completely */
div[aria-label*="view"] > div:nth-of-type(4) {
display: none;
}
/* TODO: comeup with an easier selector for the view number for an open tweet */
article[data-testid="tweet"] > div > div > div:nth-child(3) > div > div > div > div > div > span {
display: none;
}
/* Adjust the padding of the bookmark button */
div[aria-label*="view"] > div:nth-of-type(5) {
margin: 0;
}
/* Hide the share button */
div[aria-label*="view"] > div:nth-of-type(6) {
display: none !important;
}
/* Hide the Similar Posts button */
[data-testid=show-similar-posts-pivot] {
display: none;
}
/* Hide the Subscribe button */
[aria-label^=Subscribe] {
display: none;
}
/* Hide See new posts button */
[role="status"] {
display: none;
}
/* Hide verified account label */
[aria-label="Verified account"] {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment