Don't require external CSS to show attribution
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
## Motivation
Correctly attributing Mapbox on a map should be the easy default when using the gl-js library.
Currently, application developers must add a line of code in order to add attribution to their maps. This is easily forgotten in an HTML page, and a bit tricky to figure out how to do when using a bundler like Webpack. This makes it harder to correctly attribute Mapbox than it is to leave off attribution.
## Design Alternatives
Require application code to _remove_ attribution.
- Render the attribution within the WebGL context
- Inject the CSS into the page at runtime as part of the gl-js library.
## Current state
With external CSS loaded (attribution appears correctly):

Without external CSS loaded (no attribution):

HTML pages must source the correct (matching) version of CSS to add attribution, e.g.:
``
Bundled applications can source the CSS from their node_modules folder and importing it close to where they use Mapbox, e.g.:
`import 'mapbox-gl/dist/mapbox-gl.css';`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current attribution behavior in mapbox-gl-js with and without the externally loaded CSS, then compare the listed design alternatives. Done means Mapbox attribution appears by default without requiring matching external CSS, while still allowing application developers to remove it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript, typescript, webpack
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100