Susegad UI Accessibility GitHub

How this site looks

The view settings need JavaScript. Every page reads well without them.

Mood

The same pages, in three moods.

Theme

Recipes

Venue

Where the event is, in words first: the name and address, landmark directions in plain speech, links out to a maps app (a geo: link on Android, Apple Maps on iPhones, and a plain web link everywhere, the only one on a desktop), how to get there by bus, ferry and car, and a short list of access notes that shows only the rows the author filled (white space counts as empty).

quiet warm playful

Open the live demo npx @susegad/cli add venue

Stands on: Tokens

The prompt

the prompt

Make a venue recipe for an event page in Panjim, "a map page in small" with no map. Show the venue's name and address, then landmark directions in plain spoken words ("Behind the Old Secretariat, facing the river. Walk through the yellow gate with the blue tiles; the hall's door is the second on your left."), then two links out to the phone's maps app: a geo: link (with the name in the query, brackets encoded, so the pin is labelled) as "Open in your maps app" on Android, and a plain web link as "Open in a web map" everywhere. On an iPhone or iPad the app link is an Apple Maps link instead, because Safari does not open geo:; on any other device the app link is hidden, because a geo: link may open nothing there. Both are real links, underlined, in a box at least 44 px tall, with a press answer in each register and a focus ring. No embedded map, no iframe, no third-party script, nothing fetched. Then a short "Getting there" list (bus, ferry, car), and an "Access" list of fields the author fills (step-free entrance, lift, accessible toilet, quiet space): a row whose answer is empty (or only white space, with JavaScript) is not shown, and when every row is empty the whole Access section is not shown, by CSS alone. Optionally, a small drawn locator beside the words: an inline SVG sketch (river, road, a landmark, the hall with a pin, the bus stop and a dashed walking route from it to the hall, no fill on the route), decoration only (aria-hidden), with every fact also in the words. Three registers: quiet (hairline, square, no fills), warm (soft fills, rounded), playful (pill links in the hand, bolder strokes). The coordinates are written once as data-lat, data-lng, data-name and mountVenue() fills the links from them; the hrefs written in the page stay as the no-JavaScript truth. Without JavaScript everything reads. The hall and event are invented sample content.

Words to code

When you sayTechniqueWhat happens
a link to the phone's maps appgeoUri({ lat, lng, name })geo:15.4989,73.8278?q=15.4989,73.8278(Name); the app labels the pin.
the fallbackmapsUrl({ lat, lng })a plain https://www.google.com/maps/search/?api=1&query=… link.
iPhonesisApple(ua, touchPoints), appleMapsUrl(...)Safari does not open geo:, so an iPhone or iPad (even one that calls itself a Mac) gets Apple Maps.
desktopsvenueLinks(...) returns app: nullno sure maps app: the app link is hidden and the web link stands alone.
write the point oncemountVenue(root) reads data-lat, data-lng, data-namesets the [data-map="app"] and [data-map="web"] hrefs; a bad point leaves the written hrefs alone.
a build stepvenueLinks(venue, { ua })the same links as data, to write into the page.
only what is filledCSS :has()dl > div:has(> dd:empty) is hidden; .sg-venue-access:not(:has(dd:not(:empty))) is hidden.
a drawn locator, cheaplyinline SVG, classes for each partcolours come from the tokens, so it follows theme and register; aria-hidden.
a finger-sized linkmin-height: 44px, display: inline-flex:active answers in the same frame, no transition on the way in.

Accessibility

  • The directions, the address and the transport are text; the drawing is aria-hidden and shows nothing the words do not.
  • The links are real <a href> elements with discernible names, 44 px tall, with a focus ring.
  • The Access list is a dl; rows with nothing in them are not rendered at all, so a screen reader never meets an empty term.
  • Nothing is embedded, so there is no frame to trap focus.

Where the event is, in words first. A name and address, landmark directions in plain speech, two links out to the phone's maps app, how to get there, and what the place offers by way of access. It is "a map page" in small, without a map: nothing is embedded, there is no iframe and no third-party script. Visitors leave for the maps app they already use and trust.

The hall, the address, the directions and the transport notes in index.html are sample content: the event and the hall are invented. The coordinates point at central Panjim; replace them with your venue's.

Mount it

<link rel="stylesheet" href="susegad/recipes/venue/recipe.css">

<section class="sg-venue" id="venue" aria-labelledby="venue-h"
         data-lat="15.4989" data-lng="73.8278" data-name="Mandovi Riverside Hall">
  <h2 id="venue-h">The venue</h2>

  <p class="sg-venue-name">Mandovi Riverside Hall</p>
  <address class="sg-venue-address">Riverfront Road, Panjim (Panaji), Goa 403001</address>

  <h3>Finding it</h3>
  <p class="sg-venue-landmarks">Behind the Old Secretariat, facing the river. …</p>

  <p class="sg-venue-maps">
    <a class="sg-venue-link" data-map="app" href="geo:15.4989,73.8278?q=15.4989,73.8278(Mandovi%20Riverside%20Hall)">Open in your maps app</a>
    <a class="sg-venue-link sg-venue-link-web" data-map="web" href="https://www.google.com/maps/search/?api=1&query=15.4989,73.8278">Open in a web map</a>
  </p>

  <section class="sg-venue-ways" aria-labelledby="ways-h">
    <h3 id="ways-h">Getting there</h3>
    <ul>
      <li><strong>By bus.</strong> …</li>
      <li><strong>By ferry.</strong> …</li>
      <li><strong>By car.</strong> …</li>
    </ul>
  </section>

  <section class="sg-venue-access" aria-labelledby="access-h">
    <h3 id="access-h">Access</h3>
    <dl>
      <div><dt>Step-free entrance</dt><dd>Yes, through the side gate. No steps.</dd></div>
      <div><dt>Lift</dt><dd></dd></div>  <!-- empty: not shown -->
    </dl>
  </section>
</section>

<script type="module">
  import { mountVenue } from 'susegad/recipes/venue/recipe.js';
  mountVenue(document.getElementById('venue'));
</script>

The demo page also has a small drawn locator (an inline SVG beside the words): the river, the road, a landmark, the hall with a pin, the bus stop (sg-loc-stop) and the walk from it to the hall (sg-loc-walk, a dashed line with no fill, drawn over a sg-loc-walk-halo in the surface colour so it stays 3:1 against the road; quiet a hairline, playful dots). The route is a sketch, not a measured path, and the distance lives in the words ("about ten minutes' walk"), so the drawing never implies one the words contradict. Every class in the locator has a rule in recipe.css; a shape you draw with a class of your own needs one too, or the browser paints it black (the check fails on it). It is decoration (aria-hidden), it is optional, and the words say everything it shows. Delete the <figure class="sg-venue-locator"> and the page simply goes one column.

The words

  • Landmark directions are the most useful thing on the page. Write them the way you would say them to someone on the phone: "Behind the Old Secretariat, facing the river. Walk through the yellow gate with the blue tiles; the hall's door is the second on your left." Not "Proceed to Gate 2".
  • Getting there is a short list: bus, ferry, car. Name the stand, the ferry landing and the car park, and say how far it is on foot.

You write the coordinates once, as data-lat, data-lng and data-name. mountVenue() fills two links from them:

LinkGoes toWhy
"Open in your maps app" (data-map="app")a geo: link on Android, Apple Maps on an iPhone or iPad; hidden anywhere elseopens the phone's own maps app with the pin labelled, only where one is sure to answer
"Open in a web map" (data-map="web")a plain Google Maps linkworks on every device, and is the only link on a desktop, where a geo: link may open nothing

The hrefs you write in the HTML stay as the no-JavaScript truth, so with the script off both links are there (the geo: one works on Android and may do nothing on a desktop, which is why the web link is always beside it). On a build step, call venueLinks({ lat, lng, name }, { ua }) from recipe.js and write the result into the page instead. Both links are ordinary links in a 44 px tall box, and underlined, so they read as links. On a desktop only the web link shows.

Judged in code, not on devices. Which device gets which link is decided by the user-agent text and unit-tested, and the checks click nothing that leaves the page. It has not been tried on a real Android phone, an iPhone or a Windows desktop; the owner can try the page on those and see which link opens what.

Access

Fill only what is true and leave the rest empty. A row with nothing in it is hidden, and when every row is empty the whole Access section is hidden. With JavaScript, "nothing" includes white space (an editor's line breaks inside the <dd>). Without it, only a truly empty <dd></dd> hides (CSS :has()), so write empty answers as <dd></dd> if the page must also work with the script off. So write the template once with all four rows, and an author with nothing to say about a quiet space simply leaves it blank. Add rows for what your venue has (a hearing loop, accessible parking).

Registers

Look
quietoutlined links with square corners, a hairline locator with no fills, a hairline dashed route
warmsoftly filled links with rounded corners, a tinted hall and river on the locator
playfulpill links in the hand, bolder strokes on the locator, a dotted route, its labels in the hand

The touch contract

The two links are the interactive parts. A press changes them in the same frame with no transition on the way in: quiet settles 1 px and washes, warm shades the colour toward the ink, playful gives (scale 0.97) with a colour wash. Under reduced motion the colour change stays and the movement goes. Focus shows a ring.

Without JavaScript

Everything reads, and both links work with the hrefs written in the page.