plotly / plotly/plotly.js

Strip down bundled Maplibre CSS

Open
#7,544 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P2
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

https://github.com/plotly/plotly.js/pull/7526 inlines the entire maplibre-gl.css stylesheet into the Plotly.js bundle, to fix the styling of attributions in MapLibre.

This works, but also adds about 45 kB to the bundle size. Plausibly we could slim down the CSS and include only the styles we definitely need.

This file (4 kB) is enough to fix the attribution styling:

maplibre-gl-attrib.css

However this will require adding a script to parse and subset the CSS which runs as part of the build process.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review PR 7526 and the bundled maplibre-gl.css to identify the attribution styles that must remain. Use the supplied maplibre-gl-attrib.css as the target subset, then add a build-process script that parses and subsets the CSS. Done means the attribution styling still works while the bundle avoids the unnecessary CSS size.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
build-system, frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.