Forum Discussion
Document Library Preview Web Part Not Uploading
I ended up creating an Application Customizers extension. Use the code below on the public OnInit method to inject CSS to change the link color and hide the upload toolbar. I needed the link color white on my dark theme.
@override
public onInit(): Promise<void> {
// Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);
// let message: string = this.properties.testMessage;
// if (!message) {
// message = '(No properties were provided.)';
// }
// Dialog.alert(`Hello from ${strings.Title}:\n\n${message}`);
(() => {
/** hack styles for the document library preview links and hide upload toolbar */
const style1 = document.createElement('style');
style1.innerText = `
.detailsListCellName a.ms-Link {
color: #fff;
}
.ms-CommandBar {
display:none;
}
`;
style1.setAttribute('target', 'pagination');
document.head.appendChild(style1);
})();
return Promise.resolve();
}
Updated code to work in IE and Chrome