Layouts
The content page, bands with a hero, groups of sections, stacks, split rows, notes and numerals a page is laid out with.
The content page, the bands and the groups of sections are pictures in both themes, since a live copy would give this page a second main heading, and each is the width of its picture where a page would give it the width of the screen. The stacks, split rows, notes and numerals work inside any of them, and are shown twice: live in your theme, marked Live, and as a preview in the other. Under each name is the code behind it. To see the other theme live, choose Light or Dark next to Theme, at the top of the page.
Content page
A title, its lead, its one action and its sections
The code behind it:
class="dk-page"withdk-lead dk-button dk-button-accentLightDark, a picture
Scorekeeper
Keep score for any card game on one phone passed around the table.
How it works
Each player adds their points as the round ends.
The games it knows
- Flip 7
- Skyjo
- Wizard
LightDark, a picture
Scorekeeper
Keep score for any card game on one phone passed around the table.
How it works
Each player adds their points as the round ends.
The games it knows
- Flip 7
- Skyjo
- Wizard
The code, A title, its lead, its one action and its sections
Markup, A title, its lead, its one action and its sections<main id="main-content" tabindex="-1" class="dk-page"> <h1>Scorekeeper</h1> <p class="dk-lead">Keep score for any card game on one phone passed around the table.</p> <p><a class="dk-button dk-button-accent" href="../">Start a game</a></p> <section> <h2>How it works</h2> <p>Each player adds their points as the round ends.</p> </section> <section> <h2>The games it knows</h2> <ul> <li>Flip 7</li> <li>Skyjo</li> <li>Wizard</li> </ul> </section> </main>
What the tests check for Content page
These are the design kit’s own tests for this part, by the file each is in. They come from the source on GitHub as it was when this page was built, so they can be newer than the version named in the footer. Each file name opens that file as it was then.
e2e/layouts.spec.ts, in a browsere2e/bands.spec.ts, in a browser
Bands and a hero
A hero band over a band on a ground of its own
The code behind it:
class="dk-band-hero"withdk-band dk-stack dk-eyebrow dk-lead dk-button dk-button-accentLightDark, a picture
Pass it round
One phone keeps the whole table’s score.
LightDark, a picture
Pass it round
One phone keeps the whole table’s score.
The code, A hero band over a band on a ground of its own
Markup, A hero band over a band on a ground of its own<main id="main-content" tabindex="-1"> <section class="dk-band"> <div class="dk-band-hero"> <div class="dk-stack"> <p class="dk-eyebrow">For game night</p> <h1>Scorekeeper</h1> <p class="dk-lead">Keep score for any card game on one phone.</p> <p><a class="dk-button dk-button-accent" href="../">Start a game</a></p> </div> <img src="hero.svg" width="880" height="1008" alt="" /> </div> </section> <section class="dk-band band-apart"> <h2>Pass it round</h2> <p>One phone keeps the whole table’s score.</p> </section> </main>CSS, A hero band over a band on a ground of its own.band-apart { --dk-ground: var(--dk-surface); --dk-ground-step: var(--dk-bg); background: var(--dk-ground); }
What the tests check for Bands and a hero
These are the design kit’s own tests for this part, by the file each is in. They come from the source on GitHub as it was when this page was built, so they can be newer than the version named in the footer. Each file name opens that file as it was then.
e2e/bands.spec.ts, in a browsere2e/hero.spec.ts, in a browser
Groups of sections
Two ways to do one thing, side by side where they fit
The code behind it:
class="dk-sections"withdk-bandLightDark, a picture
Install it
On an iPhone
Open it in Safari, then Add to Home Screen.
On an Android phone
Open it in Chrome, then Install app.
LightDark, a picture
Install it
On an iPhone
Open it in Safari, then Add to Home Screen.
On an Android phone
Open it in Chrome, then Install app.
The code, Two ways to do one thing, side by side where they fit
Markup, Two ways to do one thing, side by side where they fit<main id="main-content" tabindex="-1"> <section class="dk-band"> <h2>Install it</h2> <div class="dk-sections"> <section> <h3>On an iPhone</h3> <p>Open it in Safari, then Add to Home Screen.</p> </section> <section> <h3>On an Android phone</h3> <p>Open it in Chrome, then Install app.</p> </section> </div> </section> </main>
What the tests check for Groups of sections
These are the design kit’s own tests for this part, by the file each is in. They come from the source on GitHub as it was when this page was built, so they can be newer than the version named in the footer. Each file name opens that file as it was then.
e2e/bands.spec.ts, in a browsere2e/split.spec.ts, in a browser
Stacks
A label over its value, 0.5rem apart
The code behind it:
class="dk-stack dk-stack-pair"withdk-noteNext to play
Ana
LightDark, preview only
Next to play
Ana
The code, A label over its value, 0.5rem apart
Markup, A label over its value, 0.5rem apart<div class="dk-stack dk-stack-pair"> <p class="dk-note">Next to play</p> <p>Ana</p> </div>A heading over the list it heads, 0.75rem apart
The code behind it:
class="dk-stack dk-stack-heading"Round 3
- Ana, 42 points
- Ben, 37 points
LightDark, preview only
Round 3
- Ana, 42 points
- Ben, 37 points
The code, A heading over the list it heads, 0.75rem apart
Markup, A heading over the list it heads, 0.75rem apart<div class="dk-stack dk-stack-heading"> <h4>Round 3</h4> <ul class="dk-stack" role="list"> <li>Ana, 42 points</li> <li>Ben, 37 points</li> </ul> </div>
What the tests check for Stacks
These are the design kit’s own tests for this part, by the file each is in. They come from the source on GitHub as it was when this page was built, so they can be newer than the version named in the footer. Each file name opens that file as it was then.
e2e/stack.spec.ts, in a browser
Split rows, notes and numerals
A player's name, round and score
The code behind it:
class="dk-split"withdk-stack dk-stack-pair dk-note dk-numeral dk-visually-hiddenAna
Round 4 of 10
212 points
The first to 300 points wins.
LightDark, preview only
Ana
Round 4 of 10
212 points
The first to 300 points wins.
The code, A player's name, round and score
Markup, A player's name, round and score<div class="dk-stack dk-stack-pair"> <div class="dk-split"> <h4>Ana</h4> <p class="dk-note">Round 4 of 10</p> </div> <p class="dk-numeral"> 212 <span class="dk-visually-hidden"> points</span> </p> <p class="dk-note">The first to 300 points wins.</p> </div>
What the tests check for Split rows, notes and numerals
These are the design kit’s own tests for this part, by the file each is in. They come from the source on GitHub as it was when this page was built, so they can be newer than the version named in the footer. Each file name opens that file as it was then.
e2e/split.spec.ts, in a browser