WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 05578c0

Browse files
Merge pull request #57 from agilecollective/feature/sidebar
Sidebar layout
2 parents 0848622 + 53bb2af commit 05578c0

File tree

6 files changed

+103
-4
lines changed

6 files changed

+103
-4
lines changed

src/scss/components/jump-menu/_jump-menu.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
@use "../../tokens/screens" as *;
44

55
.iati-jump-menu {
6-
max-width: 30rem;
76
&__header {
87
background-color: $color-green-30;
98
padding: 0.5rem 1rem;

src/scss/components/section/section.stories.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Meta, StoryObj } from "@storybook/web-components";
2+
import { Default as Table } from "../../components/table/table.stories";
23

34
import { html } from "lit";
45

@@ -43,7 +44,7 @@ export const Default: Story = {
4344
};
4445

4546
export const Fill: Story = {
46-
render: () => html`
47+
render: (args) => html`
4748
<div class="iati-section iati-section--fill">
4849
<h2 class="iati-section__title">About</h2>
4950
<div class="iati-section__content">
@@ -65,6 +66,7 @@ export const Fill: Story = {
6566
in each of the last twelve calendar months. The current month is shown
6667
for informational purposes, but excluded from the assessment.
6768
</p>
69+
${Table.render?.call({ ...args })}
6870
</div>
6971
</div>
7072
`,

src/scss/components/table/_table.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
background-color: #{$color-green-30}cc;
2121
color: $color-grey-90;
2222
}
23+
td {
24+
background-color: #fff;
25+
}
2326
td,
2427
th {
2528
border-right: 1px solid $color-teal-60;

src/scss/layout/page/_page.scss

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,65 @@
11
@use "../../base/mixins";
2+
@use "../../tokens/screens" as *;
23

34
.iati-main {
45
@include mixins.page-width-container();
56
background-color: white;
67
flex: 1;
78
padding-block: 1rem;
89
}
10+
11+
.iati-main__before-content {
12+
margin-block-end: 1rem;
13+
@media (min-width: $screen-md) {
14+
margin-block-end: 2rem;
15+
}
16+
& > * + * {
17+
margin-block-start: 1rem;
18+
}
19+
}
20+
21+
.iati-main__content {
22+
display: flex;
23+
flex-direction: column-reverse;
24+
gap: 1rem;
25+
@media (min-width: $screen-md) {
26+
flex-direction: row;
27+
gap: 2rem;
28+
}
29+
}
30+
31+
.iati-main__article {
32+
min-width: 0;
33+
& > * + * {
34+
margin-top: 1rem;
35+
@media (min-width: $screen-md) {
36+
margin-top: 2rem;
37+
}
38+
}
39+
> :first-child {
40+
margin-top: 0;
41+
}
42+
}
43+
44+
.iati-main__side {
45+
min-inline-size: 15rem;
46+
flex-grow: 0;
47+
}
48+
49+
.iati-main__side--sticky > * {
50+
position: sticky;
51+
top: 1rem;
52+
}
53+
54+
.iati-main__after-content {
55+
margin-block-start: 1rem;
56+
@media (min-width: $screen-md) {
57+
margin-block-start: 2rem;
58+
}
59+
& > * + * {
60+
margin-block-start: 1rem;
61+
@media (min-width: $screen-md) {
62+
margin-top: 2rem;
63+
}
64+
}
65+
}

src/scss/layout/page/page.stories.ts

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import type { Meta, StoryObj } from "@storybook/web-components";
22
import { html } from "lit";
33

44
import { Breadcrumb } from "../../components/breadcrumb/breadcrumb.stories";
5+
import { Links as Figures } from "../../components/figures/figures.stories";
56
import { Footer } from "../../components/footer/footer.stories";
67
import { Header } from "../../components/header/header.stories";
8+
import { Default as JumpMenu } from "../../components/jump-menu/jump-menu.stories";
79
import { Notice as MessageNotice } from "../../components/message/message.stories";
10+
import {
11+
Default as Section,
12+
Fill as Summary,
13+
} from "../../components/section/section.stories";
814

915
const meta: Meta = {
1016
title: "Layout/Page",
@@ -19,7 +25,7 @@ const meta: Meta = {
1925
export default meta;
2026
type Story = StoryObj;
2127

22-
export const Page: Story = {
28+
export const BasicLayout: Story = {
2329
render: (args) => html`
2430
${Header.render?.call({ ...args })}
2531
<main class="iati-main">
@@ -31,3 +37,35 @@ export const Page: Story = {
3137
${Footer.render?.call({ ...args })}
3238
`,
3339
};
40+
41+
export const SidebarLayout: Story = {
42+
render: (args) => html`
43+
${Header.render?.call({ ...args })}
44+
<main class="iati-main">
45+
<div class="iati-main__before-content">
46+
${Breadcrumb.render?.call({ ...args })}
47+
${MessageNotice.render?.call({ ...args })}
48+
</div>
49+
<div class="iati-main__content">
50+
<article class="iati-main__article">
51+
<h1>Timeliness</h1>
52+
<p>
53+
This page provides statistics on the timeliness of IATI data
54+
publication by organisations. Timeliness is an important measure of
55+
IATI data quality and usefulness.
56+
</p>
57+
${Summary.render?.call({ ...args })}
58+
${Figures.render?.call({ ...args })}
59+
${Section.render?.call({ ...args })}
60+
</article>
61+
<aside class="iati-main__side iati-main__side--sticky">
62+
${JumpMenu.render?.call({ ...args })}
63+
</aside>
64+
</div>
65+
<div class="iati-main__after-content">
66+
${Section.render?.call({ ...args })}
67+
</div>
68+
</main>
69+
${Footer.render?.call({ ...args })}
70+
`,
71+
};

src/scss/tokens/_screens.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
$screen-sm: 640px;
22
$screen-md: 768px;
33
$screen-lg: 1024px;
4-
$screen-xl: 1280px;
4+
$screen-xl: 1134px;
55
$screen-2xl: 1536px;
66

77
$mobile_nav_breakpoint: $screen-md;

0 commit comments

Comments
 (0)