-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use css
:has()
selector instead of JS detection (#123)
* ♻️ Move podcast shelf and category logic to CSS * Add VS Code launch configuration * Add old style podcast genre selector for back-compat * 🔥 Don't add podcast/audiobook i18n keys, since we don't use them anymore * Add CSS to block "Your Episodes" in sidebar * 🔥 Remove unused import * Update deps * Update `packageManager` * ✨ Also hide other podcast-related search categories
- Loading branch information
1 parent
d3249a7
commit fa399de
Showing
7 changed files
with
167 additions
and
186 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "pnpm run watch", | ||
"runtimeExecutable": "pnpm", | ||
"runtimeArgs": [ | ||
"run", | ||
"watch" | ||
], | ||
"internalConsoleOptions": "openOnSessionStart" | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "spicetify watch -e", | ||
"runtimeExecutable": "spicetify", | ||
"runtimeArgs": [ | ||
"watch", | ||
"-e" | ||
], | ||
"internalConsoleOptions": "openOnSessionStart" | ||
} | ||
], | ||
"compounds": [ | ||
{ | ||
"name": "Watch app build and Spicetify", | ||
"configurations": ["pnpm run watch", "spicetify watch -e"] | ||
} | ||
] | ||
} |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,66 @@ | ||
// TODO: Need to add the queue-tabBar bit to block the Podcasts tab on the Your Library page | ||
// Because it resets itself when the window resizes and it go in/out of the overflow menu | ||
// Technically I should block the li.queue-tabBar-headerItem above it, but can't do that with just CSS | ||
// TODO: Make a debug switch that just outlines everything it would block in red. | ||
|
||
// General rules | ||
.hide-podcasts-enabled .podcast-item { | ||
display: none !important; | ||
// The nearby shelves seem to freak out and constantly recalculate their positions if I use display: none | ||
@mixin hide-visibility { | ||
visibility: hidden; | ||
height: 0; | ||
min-height: unset; | ||
margin: 0; | ||
} | ||
.hide-audiobooks-enabled .audiobook-item { | ||
|
||
@mixin hide-display { | ||
display: none !important; | ||
} | ||
|
||
// Podcasts tab in Your Library page | ||
.hide-podcasts-enabled .queue-tabBar-header a[href="/collection/podcasts"] { | ||
display: none !important; | ||
}; | ||
.hide-podcasts-enabled { | ||
// Items I've tagged via JS | ||
.podcast-item { | ||
@include hide-display(); | ||
} | ||
|
||
// Podcasts tab in Your Library page | ||
.queue-tabBar-header a[href="/collection/podcasts"] { | ||
@include hide-display(); | ||
}; | ||
|
||
// Shelves that have podcasts in them | ||
.main-shelf-shelf:has(a[href^="/episode/"]), | ||
.main-shelf-shelf:has(a[href^="/show/"]) { | ||
@include hide-visibility(); | ||
} | ||
|
||
// Podcasts categories on search page | ||
// Old style | ||
.x-categoryCard-CategoryCard[href="/genre/podcasts-web"], | ||
// == (Spotify 1.2.26.1187.g36b715a1) == | ||
// "Podcasts" | ||
.x-categoryCard-CategoryCard[href="/genre/0JQ5DArNBzkmxXHCqFLx2J"], | ||
// "Podcast Charts" | ||
.x-categoryCard-CategoryCard[href="/genre/0JQ5DAB3zgCauRwnvdEQjJ"], | ||
// "Educational" | ||
.x-categoryCard-CategoryCard[href="/genre/0JQ5IMCbQBLl5gxKLgufp8"], | ||
// "Documentary" | ||
.x-categoryCard-CategoryCard[href="/genre/0JQ5IMCbQBLjfX9OdDrA5X"], | ||
// "Comedy" | ||
.x-categoryCard-CategoryCard[href="/genre/0JQ5IMCbQBLyUJhSxhaPc6"] { | ||
@include hide-display(); | ||
} | ||
|
||
// "Your Episodes" in sidebar | ||
.main-yourLibraryX-listItem:has(#listrow-title-spotify\:collection\:your-episodes) { | ||
@include hide-display(); | ||
} | ||
} | ||
|
||
.hide-audiobooks-enabled { | ||
// Items I've tagged via JS | ||
.audiobook-item { | ||
@include hide-display(); | ||
} | ||
|
||
// Audiobooks category on search page | ||
// As of Spotify 1.2.26.1187.g36b715a1 | ||
.x-categoryCard-CategoryCard[href="/genre/0JQ5DAqbMKFETqK4t8f1n3"] { | ||
@include hide-display(); | ||
} | ||
} |
Oops, something went wrong.