Created
July 31, 2023 07:56
-
-
Save AakashRao-dev/fc7d0fd2329b8b2835b000e7848fd366 to your computer and use it in GitHub Desktop.
Custom CSS For Minimal Theme Extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-- | |
- Minimal Theme for Twitter - https://typefully.com/minimal-twitter | |
- Licensed under the MIT license - https://github.com/typefully/minimal-twitter/blob/main/LICENSE | |
- Copyright (c) 2022 Mailbrew Inc. | |
--*/ | |
/* Remove Promoted Posts */ | |
/* Keep article combinator or it will remove all videos as well */ | |
[data-testid='placementTracking'] article, | |
a[href*='quick_promote_web'] { | |
display: none; | |
} | |
/* Hide Messages Drawer */ | |
[data-testid='DMDrawer'] { | |
visibility: hidden; | |
} | |
/* Hide sidebar */ | |
[data-testid='sidebarColumn'] { | |
visibility: hidden; | |
width: 0; | |
margin: 0; | |
padding: 0; | |
z-index: 1; | |
} | |
/* Twitter has a large screen breakpoint at 1000px */ | |
/* Twitter web's small screen styles (< 988px) are minimal */ | |
@media only screen and (min-width: 1000px) { | |
/* Center the Timeline */ | |
/* Prevent horizontal scroll */ | |
main[role='main'] { | |
align-items: center; | |
overflow-x: clip; | |
} | |
/* Match widths for timeline */ | |
[data-testid='primaryColumn'] { | |
width: 700px; | |
max-width: 700px; | |
margin: 0 auto; | |
} | |
[data-testid='primaryColumn'] > div > div:last-child, | |
[data-testid='primaryColumn'] > div > div:last-child div { | |
max-width: unset; | |
} | |
/* Nudge engagement row 81px right */ | |
/* In default timeline: 506px - 425px */ | |
div[aria-label][role='group'][id^='id__'] { | |
margin-right: 81px; | |
} | |
/* Fix navigation to left */ | |
header[role='banner'] { | |
position: fixed; | |
left: 0; | |
align-items: start; | |
} | |
/* Align Twitter navigation icon with search */ | |
h1[role='heading'] { | |
padding-top: 4px; | |
} | |
/* Navigation buttons labels and Account button label on hover */ | |
header[role='banner'] | |
nav[role='navigation'] | |
* | |
div[dir]:not([aria-label]) | |
> span, | |
[data-testid='SideNav_AccountSwitcher_Button'] > div:not(:first-child) { | |
display: inline-block; | |
opacity: 0; | |
transition: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); | |
} | |
header[role='banner'] | |
nav[role='navigation']:hover | |
* | |
div[dir]:not([aria-label]) | |
> span, | |
[data-testid='SideNav_AccountSwitcher_Button']:hover > div:not(:first-child) { | |
opacity: 1; | |
} | |
header[role='banner'] nav[role='navigation']:hover > * > div { | |
backdrop-filter: blur(12px); | |
} | |
/* Align account button with floating tweet button */ | |
[data-testid='SideNav_AccountSwitcher_Button'] { | |
bottom: 12px; | |
} | |
/* Shrink space if there are a lot of items in left navigation */ | |
header[role='banner'] > div > div > div > div:first-child { | |
flex-shrink: 1; | |
overflow-y: auto; | |
} | |
/* Floating Tweet Button */ | |
[data-testid='SideNav_NewTweet_Button'] { | |
position: fixed; | |
right: 16px; | |
bottom: 24px; | |
} | |
header[role='banner'] > div > div > div { | |
overflow: visible; /* Safari overflow issue: https://bugs.webkit.org/show_bug.cgi?id=160953 */ | |
justify-content: center; | |
} | |
} | |
/* Add padding equal to navigation size when between 1000px-1265px */ | |
@media only screen and (min-width: 1000px) and (max-width: 1265px) { | |
body { | |
padding-left: 88px; | |
} | |
} | |
/* Reveal searchbar and search filters at desktop breakpoint */ | |
@media only screen and (min-width: 1265px) { | |
/* Reveal searchbar */ | |
[data-testid='sidebarColumn'] form[role='search'] { | |
visibility: visible; | |
position: fixed; | |
top: 12px; | |
right: 16px; | |
} | |
/* Match size of input the placeholder content */ | |
[data-testid='sidebarColumn'] input[placeholder='Search Twitter'] { | |
width: 150px; | |
} | |
/* Match size of focused search container to its dropdown */ | |
/* Add blur filter to search container for overlap */ | |
[data-testid='sidebarColumn'] form[role='search']:focus-within { | |
width: 374px; | |
backdrop-filter: blur(12px); | |
} | |
/* Match size of focused search input to its dropdown */ | |
[data-testid='sidebarColumn'] input[placeholder='Search Twitter']:focus { | |
width: 328px !important; /* keep !important to override inline style here */ | |
} | |
/* Reset width and left positioning to align search dropdown */ | |
div[style*='left: -12px'] { | |
left: unset; | |
} | |
div[style='left: -8px; width: 306px;'] { | |
left: unset; | |
width: 374px; | |
} | |
/* Search Filters Custom Class */ | |
.searchFilters { | |
visibility: visible; | |
position: fixed; | |
top: 12px; | |
right: 16px; | |
width: 240px; | |
} | |
.searchFilters > div > div:first-child { | |
display: none; | |
} | |
} | |
#mt-listsButtonNode > div > div[dir], | |
#mt-communitiesButtonNode > div > div[dir], | |
#mt-topicsButtonNode > div > div[dir], | |
#mt-circlesButtonNode > div > div[dir], | |
#mt-twitterBlueButtonNode > div > div[dir] { | |
font-weight: 400; | |
} | |
#mt-listsButtonNode:hover > div, | |
#mt-communitiesButtonNode:hover > div, | |
#mt-topicsButtonNode:hover > div, | |
#mt-circlesButtonNode:hover > div, | |
#mt-twitterBlueButtonNode:hover > div { | |
background-color: rgba(var(--glyphs-color-rgb), 0.1); | |
} | |
/* Don't show label at smaller screens */ | |
@media only screen and (max-width: 1264px) { | |
#mt-listsButtonNode > div > div[dir], | |
#mt-communitiesButtonNode > div > div[dir], | |
#mt-topicsButtonNode > div > div[dir], | |
#mt-circlesButtonNode > div > div[dir], | |
#mt-twitterBlueButtonNode > div > div[dir] { | |
display: none; | |
} | |
} | |
.mt-tooltip { | |
position: absolute; | |
display: flex; | |
flex-direction: column; | |
align-items: flex-start; | |
justify-content: center; | |
gap: 2px; | |
background: var(--body-bg-color); | |
color: var(--main-text-color); | |
padding: 6px 8px; | |
border-radius: 5px; | |
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 14px rgba(0, 0, 0, 0.08); | |
z-index: 9999; | |
font-family: TwitterChirp, -apple-system, BlinkMacSystemFont, 'Segoe UI', | |
Roboto, Helvetica, Arial, sans-serif; | |
transition: opacity 0.15s cubic-bezier(0.3, 0, 0.1, 1), | |
transform 0.15s cubic-bezier(0.3, 0, 0.1, 1); | |
} | |
.mt-tooltip.hidden { | |
opacity: 0; | |
transform: translateY(3px); | |
pointer-events: none; | |
} | |
.mt-tooltip .title { | |
font-weight: 500; | |
color: var(--main-text-color); | |
font-size: 13px; | |
} | |
.mt-tooltip .description { | |
color: var(--secondary-text-color); | |
font-size: 12.5px; | |
} | |
nav a[href='/i/verified-orgs-signup'] { | |
display: none; | |
} | |
nav a[href='/i/articles'] { | |
display: none; | |
} | |
nav a[href='/Aakash_codes/lists'] { | |
display: none; | |
} | |
nav a[href='/Aakash_codes/communities'] { | |
display: none; | |
} | |
nav a[href='/explore'] { | |
display: none; | |
} | |
nav a { | |
max-width: fit; | |
} | |
div[aria-label='Account menu'] { | |
display: none; | |
} | |
a[href='/compose/tweet'] { | |
display: none; | |
} | |
h1 a[href='/home'] { | |
display: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment