Skip to content

Commit ae63169

Browse files
authored
Create a reference for creating a new, empty app (#11777)
In follow up work this will be used to consolidate our app creation instructions and cross-links. Also adds a new `.steps` class that can be applied to an ordered list to facilitate more visually distinct steps in step-by-step instructions. Resolves #11332 **Staged:** https://flutter-docs-prod--pr11777-feat-11332-rqtmanp0.web.app/reference/create-new-app
1 parent 74c98b6 commit ae63169

File tree

6 files changed

+523
-0
lines changed

6 files changed

+523
-0
lines changed

src/_data/sidenav.yml

+2
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,8 @@
864864
permalink: /dash
865865
- title: Widget index
866866
permalink: /reference/widgets
867+
- title: Create a new app
868+
permalink: /reference/create-new-app
867869
- title: flutter CLI
868870
permalink: /reference/flutter-cli
869871
- title: API docs

src/_sass/base/_base.scss

+71
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,77 @@ details {
289289
}
290290
}
291291

292+
ol.steps {
293+
position: relative;
294+
list-style: none;
295+
counter-reset: steps;
296+
padding-inline-start: 2.5rem;
297+
margin-block-end: 1rem;
298+
299+
$step-indicator-height: 1.75rem;
300+
301+
li {
302+
position: relative;
303+
counter-increment: steps;
304+
305+
> h3:first-child {
306+
display: flex;
307+
align-items: center;
308+
height: $step-indicator-height;
309+
font-size: 1.125rem;
310+
font-weight: 500;
311+
color: $site-color-body-light;
312+
margin-block-end: 0.5rem;
313+
}
314+
315+
> * {
316+
&:first-child {
317+
margin-block-start: 0;
318+
}
319+
320+
&:last-child {
321+
margin-block-end: 0;
322+
}
323+
}
324+
325+
&:not(:last-child) {
326+
padding-block-end: 0.75rem;
327+
328+
&:after {
329+
position: absolute;
330+
display: block;
331+
content: '';
332+
top: 0;
333+
left: calc($step-indicator-height / 2 - 2.5rem - 1px);
334+
width: 2px;
335+
height: 100%;
336+
background-color: $sidenav-divider-color;
337+
}
338+
}
339+
340+
&:before {
341+
display: flex;
342+
align-items: center;
343+
justify-content: center;
344+
345+
font-family: $site-font-family-ui;
346+
content: counter(steps);
347+
user-select: none;
348+
z-index: 10;
349+
350+
position: absolute;
351+
left: -2.5rem;
352+
353+
height: $step-indicator-height;
354+
width: $step-indicator-height;
355+
background-color: $sidenav-divider-color;
356+
color: $site-color-body-light;
357+
font-weight: 500;
358+
border-radius: 100%;
359+
}
360+
}
361+
}
362+
292363
main {
293364
ol + img, ul + img, ol + p, ul + p, p + p + img,
294365
article li:not(.toc-entry, .breadcrumb-item, .nav-item):last-child,

src/_sass/components/_card.scss

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
margin: 0;
9292
margin-block-end: 0.75rem;
9393

94+
&:last-child {
95+
margin-block-end: 0.25rem;
96+
}
97+
9498
code {
9599
font-size: 0.95em;
96100
background-color: rgba(0, 0, 0, .05);

src/_sass/components/_content.scss

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
article {
1717
min-width: 8rem;
1818
max-width: $site-content-max-width;
19+
min-height: calc(100vh - $site-header-height - $site-inline-toc-height);
1920
padding: 2rem;
2021

2122
img {

src/content/assets/js/main.js

+10
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,15 @@ function setupFeedback() {
411411
}, { once: true });
412412
}
413413

414+
function setupPlatformKeys() {
415+
const os = getOS();
416+
const specialKey = os === 'macos' ? 'Command' : 'Control';
417+
document.querySelectorAll('kbd.special-key')
418+
.forEach(function (element) {
419+
element.textContent = specialKey;
420+
});
421+
}
422+
414423
function setupSite() {
415424
scrollSidenavIntoView();
416425
initCookieNotice();
@@ -423,6 +432,7 @@ function setupSite() {
423432
setupTabs();
424433

425434
setupToc();
435+
setupPlatformKeys();
426436
setupFeedback();
427437
}
428438

0 commit comments

Comments
 (0)