Skip to content

Twitter fixes by myfonj

Details

Authormyfonj

LicenseCC0

Categorytwitter

Created

Updated

Size9.5 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Less prominent Promoted and sidebar content and ad-hoc tweaks

Notes

Userstyle doesn't have notes.

Source code

/* ==UserStyle==
@name           Twitter fixes
@namespace      github.com/openstyles/stylus
@version        1.3.0
@description    Less prominent Promoted and sidebar content and ad-hoc tweaks
@author         myfonj
@license        CC0
==/UserStyle== */
/*
https://userstyles.world/style/10652/twitter-fixes
Changelog
1.3.0 (2024-07-17) Segoe UI stylistic set with terminals for "upper-case i"
1.2.2 (2024-05-17) x.com "Terror from the deep"
1.2.1 (2024-04-19) shrink report modal after checking, minimize mouse travel
1.2.0 (2024-04-12) report user modal: spam chekcbox first, block button first, se we do not have to stroll
1.1.0 (2024-02-28) emphasis (italic/cursive) in tweet texts: more emphasized, fixed x->birb override
1.0.5 (2023-10-31) blank image-only link tweet: add some text from aria-label
1.0.4 (2023-07-25) Densier left sidebar.
1.0.3 (2023-07-24) Keep da birb.
1.0.2 (2023-07-19) Adapt to more items in left menu
1.0.1 (2023-07-05) Compact left nav better and prevent overflow more reliably. 
1.0.0 Init
*/


@-moz-document domain("twitter.com"), domain("x.com") {
/*
§ Terminals
For Segoe UI:
turns on terminals for "I" (what is good)
and changes terminals on numerals (what is meh)
TODO: investigate if it doesn't break something outside Windows
*/
* {
 font-feature-settings: "ss01" on !important;
}
/*
§ report - spam first, block first
leaving outlines here: if we see them in other places,
 then we have to target it more precisely.
*/
[data-testid="Dropdown"] {
 & div[tabindex="0"]:has([d="M3 2h18.61l-3.5 7 3.5 7H5v6H3V2zm2 12h13.38l-2.5-5 2.5-5H5v10z"]) {
  order: -1;
  outline: #0FF6 solid; outline-offset: -2px;
 }
}
[aria-modal="true"]{
 /*
  shrink modal when after checked option, so next step buton is near
 */
 &:has(input[aria-posinset]:checked) {
  min-height: 0px !important;
  max-height: 300px;
  overflow: hidden;
  inset: auto !important;
  outline: #FFF6 solid; outline-offset: -2px;
 }
 /* spam */
 & label:has(input[aria-posinset="6"]) {
  order: -2;
  outline: #0FF6 solid; outline-offset: -2px;
 }
 /* abuse & harassment */
 & label:has(input[aria-posinset="2"]) {
  order: -1;
  outline: #0FF6 solid; outline-offset: -2px;
 }
 /* */
 & .css-175oi2r.r-lzj6vb > .css-175oi2r.r-y5suh3 {
  & > div:is(:last-child,:nth-last-child(2)) {
   order: -1;
   outline: #0FF6 solid; outline-offset: -2px;
  }
 }
}

/*
§ dim sidebars until hovered
*/
header:not(:hover),
[data-testid="sidebarColumn"]:not(:hover) {
 opacity: .6;
}

/*
§ correct screwup with horizontal scrollbar on menu.
 JFC Twitter, hire some frontenders or something
// this is crude viewport-dependant spacing calc
// lazy guessworks
*/
@media (min-height: 0px) and (max-height: 700px)  {
header {
 --__itmscnt: 14;
 --__itmhght: 1.5rem;
 --__avail: calc(100vh - 150px - var(--__itmhght) * var(--__itmscnt));
 --__halfspac: calc(var(--__avail) / var(--__itmscnt) / 2);
}
header *:has(> * > svg) {
 padding-top: var(--__halfspac) !important;
 padding-bottom: var(--__halfspac) !important;
}
}

/*
§ identifiable editors in dim theme
*/
body:is(
 [style*="background-color: rgb(21, 32, 43);"],
 [style*="background-color: #15202B;"]
) [contenteditable="true"] {
 background-color: #0009;
}

/*
 § Dim and shrink Promoted tweets until hovered.
*/
article[tabindex="0"]:has(
:is([data-testid="User-Names"],[data-testid="User-Name"]) > div:last-child:nth-child(2) > :only-child > :only-child a
) {
 max-height: 100vh;
 transition-property: max-height;
 transition-delay: 500ms;
 transition-duration: 200ms;
 &:not(:hover) {
  max-height: 12ch;
  opacity: .4;
 }
}

/* 
 Tet's tackle "Discover more" blending with organic replies
 we cannot expand its dimensions apparently, because distributions calc runs faster (?)
more precise could be:
[data-testid="cellInnerDiv"]:has(h2 > div:empty:first-child + div[style="-webkit-line-clamp: 3;"])
*/
[data-testid="cellInnerDiv"]:has(h2) {
 outline: #0FF6 solid; outline-offset: -2px;
 background-color: #0FF6;
}

/*
 blank image-only link tweet: add some text from aria-label
 
*/
a[target="_blank"][rel="noopener noreferrer nofollow"][aria-label]{
 position: relative;
 &::before {
  content: attr(aria-label);
  display: block;
  padding: .2ch 1ch;
  /* JFC, twitter has no generic font family set for document, everything is set to leaf classes */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
 }

}

/*
§ emphasis (italic/cursive) in tweet texts: more emphasized
"that thing that should normally be <em> or <i>"
JFC
*/
[data-testid="tweetText"] span[class] span[class] {
 font-weight: 700;
}

}


@-moz-document domain("twitter.com") {
/*
 § 𝕏 -> Birb
*/
/*
https://userstyles.world/style/11085

Changelog
1.2.2 - just changelog for copy into https://userstyles.world/style/10652/twitter-fixes
*/

/* 2023-07-25 */
path[d="M14.258 10.152L23.176 0h-2.113l-7.747 8.813L7.133 0H0l9.352 13.328L0 23.973h2.113l8.176-9.309 6.531 9.309h7.133zm-2.895 3.293l-.949-1.328L2.875 1.56h3.246l6.086 8.523.945 1.328 7.91 11.078h-3.246zm0 0"],
/* 2023-07-26 */
path[d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"] {
 d: path("M23.643 4.937c-.835.37-1.732.62-2.675.733.962-.576 1.7-1.49 2.048-2.578-.9.534-1.897.922-2.958 1.13-.85-.904-2.06-1.47-3.4-1.47-2.572 0-4.658 2.086-4.658 4.66 0 .364.042.718.12 1.06-3.873-.195-7.304-2.05-9.602-4.868-.4.69-.63 1.49-.63 2.342 0 1.616.823 3.043 2.072 3.878-.764-.025-1.482-.234-2.11-.583v.06c0 2.257 1.605 4.14 3.737 4.568-.392.106-.803.162-1.227.162-.3 0-.593-.028-.877-.082.593 1.85 2.313 3.198 4.352 3.234-1.595 1.25-3.604 1.995-5.786 1.995-.376 0-.747-.022-1.112-.065 2.062 1.323 4.51 2.093 7.14 2.093 8.57 0 13.255-7.098 13.255-13.254 0-.2-.005-.402-.014-.602.91-.658 1.7-1.477 2.323-2.41z");
}
/*
 § × -> 𝕏
*/
[role="button"]:hover path[d="M10.59 12L4.54 5.96l1.42-1.42L12 10.59l6.04-6.05 1.42 1.42L13.41 12l6.05 6.04-1.42 1.42L12 13.41l-6.04 6.05-1.42-1.42L10.59 12z"] {
 d: path("M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z");
}
/*
2023-07-25
<svg viewBox="0 0 24 24" aria-hidden="true" class="r-vlxjld r-4qtqp9 r-yyyyoo r-16y2uox r-8kz0gk r-dnmrzs r-bnwqim r-1plcrui r-lrvibr r-19tjxh9"><g><path d="M14.258 10.152L23.176 0h-2.113l-7.747 8.813L7.133 0H0l9.352 13.328L0 23.973h2.113l8.176-9.309 6.531 9.309h7.133zm-2.895 3.293l-.949-1.328L2.875 1.56h3.246l6.086 8.523.945 1.328 7.91 11.078h-3.246zm0 0"></path></g></svg>
2023-07-26
<svg viewBox="0 0 24 24" aria-hidden="true" class="r-vlxjld r-4qtqp9 r-yyyyoo r-16y2uox r-8kz0gk r-dnmrzs r-bnwqim r-1plcrui r-lrvibr r-19tjxh9"><g><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path></g></svg>
*/

/*
 ugly house -> original bird's nest, 2023-10-11
 credit for original shapes: https://github.com/thejohnnyhill/og-twitter-home-icon/blob/main/script.js
*/
path[d="M21.591 7.146L12.52 1.157c-.316-.21-.724-.21-1.04 0l-9.071 5.99c-.26.173-.409.456-.409.757v13.183c0 .502.418.913.929.913H9.14c.51 0 .929-.41.929-.913v-7.075h3.909v7.075c0 .502.417.913.928.913h6.165c.511 0 .929-.41.929-.913V7.904c0-.301-.158-.584-.408-.758z"],
path[d="M11.54 2.345c.276-.194.644-.194.92 0l8 5.623c.213.15.34.394.34.655V21c0 .442-.358.8-.8.8h-5.855c-.442 0-.8-.358-.8-.8v-6.7h-2.69V21c0 .442-.359.8-.8.8H4c-.442 0-.8-.358-.8-.8V8.623c0-.26.127-.505.34-.655z"] {
 d: path("M11.378,0 L22.756,7.111 L21.696,8.807 L20.378,7.983 L20.378,17.804 C20.378,19.185 19.259,20.304 17.878,20.304 L4.878,20.304 C3.497,20.304 2.378,19.185 2.378,17.804 L2.378,7.983 L1.06,8.807 L0,7.111 L11.378,0 Z M11.378,8.304 C9.7205,8.304 8.378,9.6465 8.378,11.304 C8.378,12.9615 9.7205,14.304 11.378,14.304 C13.0355,14.304 14.378,12.9615 14.378,11.304 C14.378,9.6465 13.0355,8.304 11.378,8.304 Z");
}

path[d="M21.591 7.146L12.52 1.157c-.316-.21-.724-.21-1.04 0l-9.071 5.99c-.26.173-.409.456-.409.757v13.183c0 .502.418.913.929.913h6.638c.511 0 .929-.41.929-.913v-7.075h3.008v7.075c0 .502.418.913.929.913h6.639c.51 0 .928-.41.928-.913V7.904c0-.301-.158-.584-.408-.758zM20 20l-4.5.01.011-7.097c0-.502-.418-.913-.928-.913H9.44c-.511 0-.929.41-.929.913L8.5 20H4V8.773l8.011-5.342L20 8.764z"],
path[d="M11.54 2.345c.276-.194.644-.194.92 0l8 5.623c.213.15.34.394.34.655V21c0 .442-.358.8-.8.8h-5.855c-.442 0-.8-.358-.8-.8v-6.7h-2.69V21c0 .442-.359.8-.8.8H4c-.442 0-.8-.358-.8-.8V8.623c0-.26.127-.505.34-.655zM12 3.978l-7.2 5.06V20.2h4.255v-6.7c0-.442.358-.8.8-.8h4.29c.442 0 .8.358.8.8v6.7H19.2V9.038z"] {
 d: path("M11.378,7.304 C9.169,7.304 7.378,9.095 7.378,11.304 C7.378,13.513 9.169,15.304 11.378,15.304 C13.587,15.304 15.378,13.513 15.378,11.304 C15.378,9.095 13.587,7.304 11.378,7.304 Z M11.378,13.304 C10.273,13.304 9.378,12.409 9.378,11.304 C9.378,10.199 10.273,9.304 11.378,9.304 C12.483,9.304 13.378,10.199 13.378,11.304 C13.378,12.409 12.483,13.304 11.378,13.304 Z M11.378,0 L1.11022302e-16,7.111 L1.06,8.807 L2.378,7.983 L2.378,17.804 C2.378,19.185 3.497,20.304 4.878,20.304 L17.878,20.304 C19.259,20.304 20.378,19.185 20.378,17.804 L20.378,7.983 L21.696,8.807 L22.756,7.111 L11.378,0 L11.378,0 Z M18.378,17.804 C18.378,18.08 18.154,18.304 17.878,18.304 L4.878,18.304 C4.602,18.304 4.378,18.08 4.378,17.804 L4.378,6.733 L11.378,2.358 L18.378,6.733 L18.378,17.804 Z");
}

}

Reviews

No reviews yet.