Make mapcontrol-button svgs styleable by colour

This commit is contained in:
Pieter Vander Vennet 2021-07-27 21:02:30 +02:00
parent 403bd54b96
commit 15e21544ba
5 changed files with 86 additions and 23 deletions

View file

@ -5,8 +5,13 @@ import Combine from "./Base/Combine";
* A button floating above the map, in a uniform style
*/
export default class MapControlButton extends Combine {
constructor(contents: BaseUIElement) {
constructor(contents: BaseUIElement, options?:{
dontStyle?: boolean
}) {
super([contents]);
if(!options?.dontStyle){
contents.SetClass("mapcontrol p-1")
}
this.SetClass(
"relative block rounded-full w-10 h-10 p-1 pointer-events-auto z-above-map subtle-background m-0.5 md:m-1"
);