Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: better solution for stylesheet conflicts between libraries #193

Open
AmeliaBR opened this issue Oct 9, 2019 · 3 comments
Open
Labels
bug: code markup or JS error section: examples Discussion of the example pages

Comments

@AmeliaBR
Copy link
Member

AmeliaBR commented Oct 9, 2019

Right now, all the styles and generated markup from different mapping libraries is getting imported into the same example pages. This is causing some selector conflicts, especially for TomTom which re-uses MapBox and OpenLayers styles and selectors, with their own additions and tweaks.

Currently, I've got one of the TomTom stylesheets commented out because of this, but that means adding extra styles where they are required (e.g. here). Might be worth trying to identify a full version of the stylesheet with the conflicts removed? Or create and host separate versions of every complete stylesheet with a scoping class at the top of every selector (e.g., to distinguish .mapboxgl-example .mapboxgl-ctrl {} from .tomtom-example .mapboxgl-ctrl {}). We'd end up with extra CSS for the rules that are the same, but at least avoid clashes.

@AmeliaBR AmeliaBR added bug: code markup or JS error section: examples Discussion of the example pages labels Oct 9, 2019
@dmorissette
Copy link

How about one page per example, with an index page listing all the examples with a one-liner description for each? In the style of what we find here https://openlayers.org/en/latest/examples/
(the search box can be considered optional, for bonus points)

@NickFitz
Copy link
Contributor

Might it be worth breaking each example up into a main page and a per-framework sub-page, with the main page embedding the per-framework examples in iframes? (As everything depends on JS anyway, the per-framework example pages could detect if they were framed and remove or hide any unnecessary content within themselves such as headings.)

@dmorissette I've been thinking it would be convenient to have an examples/index.html, as I'm quite reliant on the default Apache index page for quick access to the examples in my local repo as I work.

@AmeliaBR
Copy link
Member Author

I'm quite reliant on the default Apache index page for quick access to the examples in my local repo

Me as well. I really wish Github Pages had an automatic index option. Keeping a manual index page up to date is a pain when you don't have a build system otherwise. But maybe we could run an extra little script on the main report, that finds all the index links from each section and organizes them into an appendix at the end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: code markup or JS error section: examples Discussion of the example pages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants