Skip to content

Commit a6cfc65

Browse files
committed
Potential aside design
1 parent bbb148e commit a6cfc65

File tree

3 files changed

+143
-0
lines changed

3 files changed

+143
-0
lines changed

src/prototypes/asides/article.twig

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{% embed '@cloudfour/objects/container/container.twig' with {
2+
class: '_proto-asides-r1 o-container--prose o-container--pad',
3+
content_class: 'o-rhythm',
4+
align: align,
5+
summary: summary,
6+
open: open
7+
} only %}
8+
{% block content %}
9+
<p>In the short run for those using a traditional web design process, we need to recognize that design doesn’t stop when something is handed off to developers. It continues until launch so designers can be involved in how the design is implemented in code.</p>
10+
11+
{% set aside_content -%}
12+
<p>Or you could replace the traditional web design process with a process that incorporates in-browser mockups, but not every organization and designer can make that change. But if you’re interested in a process like that, stay tuned or… um… <a href="mailto:[email protected]">hire us</a>.</p>
13+
{%- endset %}
14+
15+
<aside class="_c-aside {% if align %}_c-aside--align-{{align}}{% endif %}">
16+
<div class="_c-aside__inner">
17+
{% if summary %}
18+
<details class="_c-aside__content"{% if open %} open{% endif %}>
19+
<summary>{{summary}}</summary>
20+
{{aside_content}}
21+
</details>
22+
{% else %}
23+
<div class="_c-aside__content">
24+
{{aside_content}}
25+
</div>
26+
{% endif %}
27+
</div>
28+
</aside>
29+
30+
<p>And in the same vein, there are development decisions happening before handoff. Developers should be involved throughout as well.</p>
31+
<p>In the short run for those using a traditional web design process, we need to recognize that design doesn’t stop when something is handed off to developers. It continues until launch so designers can be involved in how the design is implemented in code.</p>
32+
<p>In the short run for those using a traditional web design process, we need to recognize that design doesn’t stop when something is handed off to developers. It continues until launch so designers can be involved in how the design is implemented in code.</p>
33+
{% endblock %}
34+
{% endembed %}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import articleDemo from './article.twig';
2+
import './r1.scss';
3+
4+
export default {
5+
title: 'Prototypes/Asides',
6+
parameters: {
7+
docs: { page: null },
8+
layout: 'fullscreen',
9+
},
10+
argTypes: {
11+
align: {
12+
options: ['start', 'end'],
13+
control: { type: 'radio' },
14+
},
15+
summary: {
16+
control: { type: 'text' },
17+
},
18+
open: {
19+
control: { type: 'boolean' },
20+
},
21+
},
22+
};
23+
24+
export const Revision1 = (args) => articleDemo(args);

src/prototypes/asides/r1.scss

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
2+
@use '../../compiled/tokens/scss/breakpoint';
3+
@use '../../compiled/tokens/scss/size';
4+
@use '../../mixins/border-radius';
5+
@use '../../mixins/spacing';
6+
@use '../../mixins/ms';
7+
8+
._proto-asides-r1 {
9+
10+
._c-aside {
11+
position: relative;
12+
13+
@media (width < breakpoint.$xxl) {
14+
@include spacing.fluid-margin-inline-negative;
15+
}
16+
}
17+
18+
._c-aside__inner {
19+
@media (width > breakpoint.$xxl) {
20+
inline-size: calc((100vw - 100%) / 2);
21+
inset-inline-start: 100%;
22+
max-inline-size: 50%;
23+
position: absolute;
24+
@include spacing.fluid-padding-inline;
25+
}
26+
}
27+
28+
._c-aside--align-start ._c-aside__inner {
29+
@media (width > breakpoint.$xxl) {
30+
inset-inline-start: auto;
31+
inset-inline-end: 100%;
32+
}
33+
}
34+
35+
._c-aside__content {
36+
background-color: var(--theme-color-background-secondary);
37+
font-size: max(16px, ms.step(-1)); // Smaller than text usually but not too small
38+
padding: size.$rhythm-default;
39+
position: relative;
40+
@include border-radius.conditional;
41+
@include spacing.vertical-rhythm(size.$rhythm-default);
42+
43+
@media (width < breakpoint.$xxl) {
44+
@include spacing.fluid-padding-inline;
45+
}
46+
47+
@media (width > breakpoint.$xxl) {
48+
margin: size.$rhythm-default * -1;
49+
margin-top: ms.step(0) * -1; // Better baseline alignment
50+
}
51+
}
52+
53+
._c-aside:not(._c-aside--align-start) ._c-aside__content {
54+
@media (width > breakpoint.$xxl) {
55+
border-top-left-radius: 0;
56+
}
57+
}
58+
59+
._c-aside--align-start ._c-aside__content {
60+
@media (width > breakpoint.$xxl) {
61+
border-top-right-radius: 0;
62+
}
63+
}
64+
65+
._c-aside__content::before {
66+
@media (width > breakpoint.$xxl) {
67+
background-image: radial-gradient(circle at 0 100%, transparent ms.step(2), var(--theme-color-background-secondary) ms.step(2));
68+
block-size: ms.step(2);
69+
content: '';
70+
inline-size: ms.step(2);
71+
inset-block-start: 0;
72+
inset-inline-end: 100%;
73+
position: absolute;
74+
}
75+
}
76+
77+
._c-aside--align-start ._c-aside__content::before {
78+
@media (width > breakpoint.$xxl) {
79+
inset-inline-end: auto;
80+
inset-inline-start: 100%;
81+
transform: scaleX(-1);
82+
}
83+
}
84+
85+
}

0 commit comments

Comments
 (0)