|
1 | | -import { css } from '@emotion/css'; |
| 1 | +import { css } from '@emotion/react'; |
2 | 2 | import { GrafanaTheme2 } from '@grafana/data'; |
3 | 3 |
|
4 | 4 | import 'ol/ol.css'; |
| 5 | +import 'ol-ext/dist/ol-ext.css'; |
| 6 | +import "bootstrap-icons/font/bootstrap-icons.css"; |
| 7 | +// Load directly when plugin |
| 8 | +import 'static/css/fontmaki2.css'; |
| 9 | +import 'static/css/fontmaki.css'; |
5 | 10 |
|
6 | 11 | /** |
7 | 12 | * Will be loaded *after* the css above |
@@ -78,5 +83,96 @@ export function getGlobalStyles(theme: GrafanaTheme2) { |
78 | 83 | '.ol-attribution:not(.ol-collapsed)': { |
79 | 84 | backgroundColor: theme.colors.background.secondary, // rgba(255,255,255,0.8); |
80 | 85 | }, |
| 86 | + '.ol-control.layer-switcher': { |
| 87 | + top: "0.5em", |
| 88 | + right: "0.5em", |
| 89 | + // textAlign: "right" |
| 90 | + textAlign: "left" |
| 91 | + }, |
| 92 | + '.ol-control.layer-switcher.shown.layer-switcher-activation-mode-click': { |
| 93 | + paddingRight: "0.5em" |
| 94 | + }, |
| 95 | + '.ol-control.layer-switcher.shown.layer-switcher-activation-mode-click > button': { |
| 96 | + right: 0, |
| 97 | + borderLeft: 0, |
| 98 | + }, |
| 99 | + '.ol-control.layer-switcher.shown.layer-switcher-activation-mode-click > .panel': { |
| 100 | + display: 'block', |
| 101 | + }, |
| 102 | + '.ol-control.layer-switcher.layer-switcher-activation-mode-click > .panel': { |
| 103 | + display: 'none', |
| 104 | + }, |
| 105 | + '.ol-control.layer-switcher button': { |
| 106 | + right: 0, |
| 107 | + borderLeft: 0, |
| 108 | + /* content: url('./img/icons/layers.svg'); */ |
| 109 | + /* background-image: url('./img/icons/layers.svg'); |
| 110 | + background-repeat: no-repeat; */ |
| 111 | + /* https://icons.getbootstrap.com/#usage */ |
| 112 | + }, |
| 113 | + '.ol-control.layer-switcher li.layer': { |
| 114 | + listStyle: 'none', |
| 115 | + }, |
| 116 | + '.layer-switcher li label': { |
| 117 | + paddingLeft: "0.5em", |
| 118 | + /* padding-right: 1.2em; */ |
| 119 | + display: "inline-block", |
| 120 | + marginTop: "1px", |
| 121 | + }, |
| 122 | + '.data-layer-add': { |
| 123 | + display: 'flex', |
| 124 | + justifyContent: 'flex-end', |
| 125 | + marginBottom: 10, |
| 126 | + }, |
| 127 | + '.data-layer-remove': { |
| 128 | + display: 'flex', |
| 129 | + justifyContent: 'flex-end', |
| 130 | + marginBottom: 10, |
| 131 | + marginTop: 10, |
| 132 | + }, |
| 133 | + '.ol-custom-overviewmap': { |
| 134 | + /* left: 0.5em; */ |
| 135 | + /* bottom: 0.5em; */ |
| 136 | + right: "0.5em", |
| 137 | + bottom: "20%", |
| 138 | + padding: "1px" |
| 139 | + }, |
| 140 | + '.ol-custom-overviewmap.ol-uncollapsible': { |
| 141 | + bottom: 0, |
| 142 | + left: 0, |
| 143 | + borderRadius: "0 2px 0 0" |
| 144 | + }, |
| 145 | + '.ol-custom-overviewmap .ol-overviewmap-map, .ol-custom-overviewmap button': { |
| 146 | + display: "block", |
| 147 | + borderRadius: "4px" |
| 148 | + }, |
| 149 | + '.ol-custom-overviewmap .ol-overviewmap-map': { |
| 150 | + border: "1px solid #7b98bc", |
| 151 | + height: "150px", |
| 152 | + margin: "1px", |
| 153 | + width: "150px" |
| 154 | + }, |
| 155 | + '.ol-custom-overviewmap:not(.ol-collapsed) button': { |
| 156 | + bottom: "6px", |
| 157 | + left: "6px", |
| 158 | + position: "absolute", |
| 159 | + background: theme.colors.background.secondary |
| 160 | + }, |
| 161 | + '.ol-custom-overviewmap:not(.ol-collapsed) button:hover div': { |
| 162 | + color: theme.colors.secondary.text, |
| 163 | + backgroundColor: theme.colors.secondary.shade, // rgba(0,60,136,0.5); |
| 164 | + }, |
| 165 | + '.ol-custom-overviewmap.ol-collapsed .ol-overviewmap-map, .ol-custom-overviewmap.ol-uncollapsible button': { |
| 166 | + display: "none" |
| 167 | + }, |
| 168 | + '.ol-custom-overviewmap:not(.ol-collapsed)': { |
| 169 | + background: theme.colors.background.secondary |
| 170 | + }, |
| 171 | + '.ol-custom-overviewmap .ol-overviewmap-box': { |
| 172 | + border: "2px solid red" |
| 173 | + }, |
| 174 | + '.ol-custom-overviewmap .ol-overviewmap-box:hover': { |
| 175 | + cursor: "move" |
| 176 | + } |
81 | 177 | }); |
82 | 178 | } |
0 commit comments