【问题标题】:SharePoint List View JSON format hover colorSharePoint 列表视图 JSON 格式悬停颜色
【发布时间】:2019-11-28 17:49:54
【问题描述】:

如何更改 SharePoint 列表视图中超链接的悬停颜色?

我的列表视图的 JSON 如下。

谢谢!

{
 "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
 "hideSelection": true,
 "hideColumnHeader": true,
 "rowFormatter": {
     "elmType": "a",
     "txtContent": "@currentField",
     "attributes": {
        "class": "sp-field-fontSize14",
        "href": "[$Link]"
     },
     "style": {
        "color": "#8F7034",
        "text-decoration": "none",
        "width": "300px",
        "min-width": "200px",
        "min-height":"1em",
        "height":"1em",
        "white-space": "nowrap",
        "padding-left": "=if(indexOf(@currentField, ' ') == 1, '', if(indexOf(@currentField, ' ') == 3, '20px', '40px'))"  
     }
 }
}

【问题讨论】:

    标签: css sharepoint sharepoint-list


    【解决方案1】:

    使用ms-bgColor-<color>--hover 更改悬停颜色。

    例如:

    attributes": {
          "class": "sp-field-fontSize14 ms-bgColor-red--hover",
          "href": "[$Link]"
        },
    

    【讨论】:

    • 如何使用自定义颜色?我想使用 #8F7034 作为文本颜色,使用另一种自定义文本颜色作为悬停。谢谢!
    • 其实ms-fontColor-themePrimary ms-fontColor-red--hover是我需要的。再次感谢,您的回答让我走上了正轨
    猜你喜欢
    • 1970-01-01
    • 2018-01-25
    • 2015-04-12
    • 2016-07-08
    • 2013-03-18
    • 2014-02-24
    • 2013-03-16
    • 2012-11-21
    • 2016-05-06
    相关资源
    最近更新 更多