How to Hide the Staff Category with css?

AI-generated summary

A user is trying to hide the staff category in a Discourse install using CSS. Tim_Jefferies initially used tr[data-category-id="3"] { display: none; } but it only worked on desktop. smrtey suggested an alternative, which didn’t work, but Tim_Jefferies found a solution using tr[data-category-id="3"], .category-list-item[data-category-id="3"] { display: none; }. However, staff posts still appear in search results. Tim_Jefferies identified the CSS selector but noted that hiding the parent class is not currently possible without changes to Discourse’s styling. Canapin suggested using a different account with trust level 4 to avoid seeing staff categories, while pfaffman recommended simply removing staff privileges from users.

I am hosting a discourse install that is acting as a wiki for 2 people. I don’t need the staff category for this purpose - its just cluttering up the screen.

I can use the following css to hide it on the desktop:

// hide staff category
tr[data-category-id="3"] {
    display: none;
}

This doesn’t work on mobile though. Does anyone know how to hide the staff category on mobile?

Try

// hide staff category
tr[data-category-id="3"],
category[data-category-id="3"]  {
    display: none;
}

That didn’t seem to work. This did:

// hide staff category
tr[data-category-id="3"],
.category-list-item[data-category-id="3"]  {
display: none;
}

Unfortunately, there are still staff posts appearing in search. I looked at the css, and managed to narrow down the section using this:

.fps-result .author a[data-user-card=“system”] {
}

but it seems that there is no current way to select the parent class in the css spec (though its in a future spec), so I don’t see how it’s possible to hide these search entries without changes to the way discourse styles entries on the search pages.

Completely trying to hide a un-deletable category which exists specifically for staff seems difficult.
If it’s bothering you that much, I guess you could use as a main account a new one with a trust level 4, and log in with your admin account only when you have to do admin stuff.

Maybe make those users not be staff?