Merge pull request #230 from grafana/1285-grafana-dashboard-issue
custom styles for plugin were placed in the file
This commit is contained in:
commit
370e336baa
3 changed files with 46 additions and 38 deletions
|
|
@ -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);
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
|
|
|||
39
grafana-plugin/src/img/grafanaGlobalStyles.css
Normal file
39
grafana-plugin/src/img/grafanaGlobalStyles.css
Normal 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue