-
Notifications
You must be signed in to change notification settings - Fork 0
/
cssInjection.js
35 lines (31 loc) · 896 Bytes
/
cssInjection.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function addStyleTag() {
var notificationsStyle = document.createElement('style');
notificationsStyle.type = 'text/css';
notificationsStyle.class = "PIs";
notificationsStyle.id = "PIs-notifications";
notificationsStyle.innerHTML = `
.notification-items {
left: 0 !important;
}
.side-notification {
left: 0 !important;
}
.slide-notification-items-enter,.slide-notification-items-leave-to {
transform: translateX(-100%)
}
.app-layout-side-notification-enter,.app-layout-side-notifications-leave-to {
transform: translateX(-100%)
}
`
document.getElementsByTagName( 'html' )[0].appendChild(notificationsStyle);
}
function checkForDOM() {
if (document.body && document.head) {
if (!document.getElementById("PIs-notifications")) {
addStyleTag();
}
} else {
requestIdleCallback(checkForDOM);
}
}
requestIdleCallback(checkForDOM);