CSS隐藏群组成员页面中的“发布”和“已查看”列

As of Discourse 2.7.0.beta4, some custom CSS we previously used to hide the Posted and Seen columns on the group detail page no longer works. Instead, we just have the “Seen” column.

I want the only column between Posted, Seen, and Added to be the Added column. The CSS below previously worked but no longer does.

/* remove "Posted" and "Seen" columns from group-detail member lists */
table.group-members th:nth-child(n+4):nth-child(-n+5), table.group-members td:nth-child(n+4):nth-child(-n+5) {
    visibility: hidden;
    width: 0px;
    font-size: 0px;
}

How do I modify the CSS to make Posted and Seen hidden again?

Here’s a two-minute video that explains the whole situation if what I wrote above isn’t enough.

https://www.loom.com/share/f6cd2fa0628d4876a73ebb2a500d9bfa

Hey :wave:

Thanks for the video.

The table header on that page has an extra column for the bulk-select button.

image

So, your nth-child selectors are off by one.

Try this and see if it resolves the issue for you.

.group-members {
  th {
    &:nth-child(5),
    &:nth-child(6) {
      display: none;
    }
  }
  td {
    &:nth-child(4),
    &:nth-child(5) {
      display: none;
    }
  }
}

I don’t see us making any changes to that layout any time soon. So, using nth-child selectors should not be a problem here.

3 个赞

Your CSS worked. Thanks a bunch!

2 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.