Merge pull request #230 from grafana/1285-grafana-dashboard-issue

custom styles for plugin were placed in the file
This commit is contained in:
Yulia Shanyrova 2022-07-14 13:31:38 +02:00 committed by GitHub
commit 370e336baa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 38 deletions

View file

@ -97,14 +97,15 @@ export const Root = observer((props: AppRootProps) => {
}, []);
useEffect(() => {
const style = document.createElement('style');
document.head.appendChild(style);
const index = style.sheet.insertRule('.page-body {max-width: unset !important}');
const index2 = style.sheet.insertRule('.page-container {max-width: unset !important}');
let link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = '/public/plugins/grafana-oncall-app/img/grafanaGlobalStyles.css';
document.head.appendChild(link);
return () => {
style.sheet.removeRule(index);
style.sheet.removeRule(index2);
document.head.removeChild(link);
};
}, []);

View file

@ -0,0 +1,39 @@
.page-body {
max-width: unset !important;
}
.page-container {
max-width: unset !important;
}
/* This is for Grafana 8, remove later */
@media (max-width: 1540px) {
.page-header__tabs > ul > li > a > div {
display: none;
}
}
@media (max-width: 1540px) {
.page-header__tabs > div > div > a > div {
display: none;
}
}
@media (max-width: 1300px) {
.sidemenu {
position: fixed !important;
height: 100%;
}
.grafana-app {
position: relative !important;
}
.main-view {
padding-left: 50px;
}
.page-header__tabs li a {
white-space: nowrap;
}
}

View file

@ -29,35 +29,3 @@
.highlighted-row {
background: var(--highlighted-row-bg);
}
/* This is for Grafana 8, remove later */
@media (max-width: 1540px) {
.page-header__tabs > ul > li > a > div {
display: none;
}
}
@media (max-width: 1540px) {
.page-header__tabs > div > div > a > div {
display: none;
}
}
@media (max-width: 1300px) {
.sidemenu {
position: fixed !important;
height: 100%;
}
.grafana-app {
position: relative !important;
}
.main-view {
padding-left: 50px;
}
.page-header__tabs li a {
white-space: nowrap;
}
}