Skip to content

Commit 7f055ec

Browse files
michaelkirkdabreegster
authored andcommitted
Fix layout of maplibre controls by only using pico in explicit parts of the layout.
picocss is conflicting with maplibre - most notably the maplibre controls have a silly amount of padding, so the controls look wonky. Instead of applying picocss everywhere, we now "allow list" subtrees of the DOM with the "pico" class. It's kind of annoying, but it kind of seems like it has to be this way - if we're going to have two strong design systems (pico and maplibre), they need to be confined to their own respective domains.
1 parent 0923a69 commit 7f055ec

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

web/src/App.svelte

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import onewayArrowUrl from "../assets/arrow.png?url";
33
import logo from "../assets/logo.svg?url";
44
import About from "./About.svelte";
5-
import "@picocss/pico/css/pico.jade.min.css";
5+
import "@picocss/pico/css/pico.conditional.jade.min.css";
66
import initLtn from "backend";
77
import type { Map } from "maplibre-gl";
88
import { init as initRouteSnapper } from "route-snapper-ts";
@@ -89,16 +89,18 @@
8989
}
9090
</script>
9191

92-
<About />
92+
<div class="pico">
93+
<About class="pico" />
94+
</div>
9395
<Layout>
94-
<div slot="top" style="display: flex">
96+
<div slot="top" class="pico" style="display: flex">
9597
<button class="outline" on:click={() => ($showAbout = true)}>
9698
<img src={logo} style="height: 6vh;" alt="A/B Street logo" />
9799
</button>
98100
<Settings />
99101
<span bind:this={topDiv} style="width: 100%" />
100102
</div>
101-
<div slot="left">
103+
<div class="pico" slot="left">
102104
<div bind:this={sidebarDiv} />
103105

104106
<hr />

0 commit comments

Comments
 (0)