MB UI quick fixes: user stylesheets

In the discussion on MB Enhancements for classical music, some issues were raised related to information displayed by MB which only add clutter to the UI for classical music.

Some of these issues may be addressed at the user level, thanks to “User Stylesheets”.
Several browser extensions are available to manage these stylesheets, and they can be published to facilitate their reuse.

I’m far from being an expert on this, but addressing the clutter issues raised doesn’t seem to require complex styling. I’ll post a few examples, to enable more people to test and provide feedback, and check that these have no unintended consequences.

Hides the "Artists" and "ISWC" columns in all Artists Works page
@-moz-document regexp("https://musicbrainz.org/artist/[\\w-]*/works.*") {
/* Hide the "Artists" column, which is the 4th column in a "works" page */

th:nth-child(4), td:nth-child(4) {
    display: none;
}

/* Hide the "ISWC" column, which is the 5th column in a "works" page */

th:nth-child(5), td:nth-child(5) {
    display: none;
}


}
Hides the "Artists" and "ISWC" columns in works search result page
@-moz-document regexp("https://musicbrainz.org/search\\?query=.*type=work.*") {
/* Hide the "Artists" column, which is the 3rd column in a "works" search results */

th:nth-child(3), td:nth-child(3) {
    display: none;
}

/* Hide the "ISWC" column, which is the 4th column in a "works" search results */

th:nth-child(4), td:nth-child(4) {
    display: none;
}

}
2 Likes

Just been checking this one (using Stylus). I think it’s columns 3 and 4 that need to be turned off. Also, add .* or some such at the end of the regex to work on page 2 etc. Then it works nicely

I’ve got colums 3 & 4 on search results, but on artist works page, there is an additional column at the left of the table with checkboxes.

I corrected the URL selector to enable it on all pages. Thanks for pointing this out.

Only if you are logged in - I wasn’t when I tested it, but I guess usually I would be.

It may be difficult to detect the login status on a pure CSS approach. I’ll check if we can select these columns in another way to work around this issue

Consider making a feature request ticket on the ticket tracker (under the MBS project) for adding a class="logged-in"/class="logged-out" or some such to the body. Then you could always preface rules with body.logged-{in|out} … in the CSS. Might be useful for a lot of other things too (e.g., userscripts maybe?).

4 Likes