Forum Discussion
JSON Attribute iconName Creates Pseudo class of CSS (::before) which Repeats the Icon
- Oct 23, 2024
amke321
To resolve the issue of the::beforepseudo-class automatically being added by the server in SharePoint, you cannot directly control or remove the::beforepseudo-element via JSON formatting.However, you can override its behavior by:
1. Using Custom CSS: Apply custom CSS that overrides the::beforecontent:
.css-333::before {
content: none !important;
}
2. Inject Custom CSS: You can inject the CSS using a SharePoint Framework (SPFx) extension or a modern script editor web part.
This method prevents the duplicate icon rendering while keeping theiconNamebehavior intact.
amke321
To resolve the issue of the ::before pseudo-class automatically being added by the server in SharePoint, you cannot directly control or remove the ::before pseudo-element via JSON formatting.
However, you can override its behavior by:
1. Using Custom CSS: Apply custom CSS that overrides the ::before content:
.css-333::before {
content: none !important;
}
2. Inject Custom CSS: You can inject the CSS using a SharePoint Framework (SPFx) extension or a modern script editor web part.
This method prevents the duplicate icon rendering while keeping the iconName behavior intact.