smeijer / leaflet-geosearch

A geocoding/address-lookup library supporting various api providers.
https://smeijer.github.io/leaflet-geosearch/
MIT License
1.05k stars 273 forks source link

dist/style.css cannot be used with dist/bundle.js #126

Closed simon04 closed 4 years ago

simon04 commented 7 years ago

Due to the identifiers such as .leaflet__leaflet-control-geosearch___35AKI (originating from css-loader's config localIdentName in webpack.config.babel.js), the distributed CSS file cannot be used with the bundle.js.

The docs/index.html contains both the dist/style.css as well as the assets/css/leaflet.css: https://github.com/smeijer/leaflet-geosearch/blob/4a443db/docs/index.html#L16-L17

skipjack commented 6 years ago

Ran into the same issue, i.e. the following is needed:

import 'leaflet-geosearch/dist/style.css'
import 'leaflet-geosearch/assets/css/leaflet.css'

This isn't super clear as the README doesn't really mention much about styling (besides the style option). Any particular reason for separating the two stylesheets?

smeijer commented 6 years ago

To be honest, I think the dist file is just not compiled like it should. PR to fix it would be most welcome.

smeijer commented 4 years ago

leaflet-geosearch v3 fixes this issue.

Either add https://unpkg.com/leaflet-geosearch@3.0.0/dist/geosearch.css to your head, or import from leaflet-geosearch/dist/geosearch.css

Sorry for the long wait.