You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何修改SharePoint现代列表Gallery视图中“人员或组”字段的字体颜色?

SharePoint现代列表Gallery视图人员或组字段字体改白色的实现方案

可以实现,以下是两种可行方法:

  • 字段JSON格式化(推荐,无需开发)

    1. 进入目标列表的设置页面,找到需修改的“人员或组”字段,点击「格式化」选项。
    2. 切换到「高级模式」,替换原有代码为以下JSON:
    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
      "elmType": "div",
      "style": {
        "color": "#ffffff"
      },
      "children": [
        {
          "elmType": "span",
          "style": {
            "display": "inline-block",
            "vertical-align": "middle"
          },
          "attributes": {
            "iconName": "Contact"
          }
        },
        {
          "elmType": "span",
          "style": {
            "margin-left": "8px",
            "color": "#ffffff"
          },
          "txtContent": "@currentField.title"
        }
      ]
    }
    
    1. 保存后返回Gallery视图,即可看到人员字段的字体已变为白色,同时保留了默认的人员头像图标样式。
  • SPFx扩展注入自定义CSS(需开发能力)
    若需要全局统一调整所有Gallery视图的人员字段样式,可通过SPFx扩展注入CSS代码,定位到人员字段的文本类.sp-persona-text,设置样式:

    .sp-persona-text {
      color: #ffffff !important;
    }
    

    开发完成后将SPFx扩展部署到SharePoint环境,即可生效。

内容的提问来源于stack exchange,提问作者T Zhang

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 23:35:00