geoman-io / leaflet-geoman

🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
https://geoman.io
MIT License
2.21k stars 433 forks source link

Styling just 1 control button #1086

Closed AlbertoMCS closed 2 years ago

AlbertoMCS commented 2 years ago

Hi, I created a custom button and I would like to apply some CSS just on it. When clicking the element in the browser to find out its class, I realise that all the buttons have the same class leaflet-buttons-control-button. Is there a way to select/access one single button to apply some CSS? Here my button:

mymap.pm.Toolbar.copyDrawControl('Rectangle', {
                  name: 'RectangleCopy',
                  block: 'custom',
                  onClick: () => {
                  //Whatever here
                  }
                });

Many thanks.

Falke-Design commented 2 years ago

You can add a className:

mymap.pm.Toolbar.copyDrawControl('Rectangle', {
                  name: 'RectangleCopy',
                  block: 'custom',
                  className: 'myCustomCSSClass',
                  onClick: () => {
                  //Whatever here
                  }
                });
AlbertoMCS commented 2 years ago

Thanks Falke-Design, but that class just seems to be modifying the icon inside the button not the button itself. I would like to make the button bigger (just that specific button, not all of them). Look the screenshot below (I changed the colour to beige with the new class) image Many thanks

AlbertoMCS commented 2 years ago

Hi, I do not need this capability anymore. Many thanks.