用户组类并不总是应用到帖子内容的包装div上

我为例如“志愿者”和“捐赠者”等为网站运行做出贡献的用户组设置了用户组。我想通过在整个帖子周围添加边框等方式来区分这些用户的帖子:

.group-Volunteers > article {
    margin-top: 0.2em;
    margin-bottom: 0.2em;
    border: 0.2em dashed var(--tertiary);
    border-radius: 1em;
    padding-left: 0.5em;
}

这在一个组中按预期工作,但在另一个组中不行。是否有关于何时将 group-* 类应用于包装器容器的规则?

示例:Introducing Gizz Tapes! - #13 by jamie - Some Context - KGLW.net Forum
发布此帖子的用户是“志愿者”组成员,但是帖子的包装 div 没有 group-Volunteers 类,正如我所预期的那样。(请注意,在此主题中有几篇来自“核心”组成员的帖子,他们的帖子确实有一个 group-Core 包装器。)

我认为它必须是他们的主要组,用户的主要组是志愿者组吗,更改它是否可以解决问题?

2 个赞

您还可以使用 CSS Classes for Current User's Groups

2 个赞

Hm, I’ve added this component to our theme but it doesn’t seem to have changed the CSS classes on the post in my example above.

I think I’d prefer to use this component, although I don’t know what the “primary group” setting entails. What happens if a user is a member of multiple groups which have the “automatically set as primary group” option turned on?

我已将此组件添加到我们的主题中,但它似乎并未更改我上面示例中帖子的 CSS 类。

我想我更愿意使用此组件,尽管我不知道“主要群组”设置包含什么。如果用户是多个启用了“自动设置为主要群组”选项的群组的成员,会发生什么?

1 个赞