1
votes

How can I change hover color for a hyperlink in a SharePoint List View?

My JSON for the list view is below.

Thank you!

{
 "$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'))"  
     }
 }
}
1

1 Answers

1
votes

Use ms-bgColor-<color>--hover to change hover color.

For example:

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