Skip to content

Commit 281cf7f

Browse files
Design system components clean-up (GoogleChrome#6853)
* Allow components to break out of prose sizing rules * Tweak branding layout
1 parent e49b159 commit 281cf7f

5 files changed

Lines changed: 384 additions & 268 deletions

File tree

src/scss/pages/_design-system.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
details {
1515
max-width: 50rem;
1616
}
17+
18+
.prose {
19+
iframe {
20+
max-width: unset;
21+
}
22+
}
1723
}
1824

1925
.design-system__swatch {
@@ -32,3 +38,11 @@
3238
min-height: 800px;
3339
}
3440
}
41+
42+
.design-system__components-section {
43+
max-width: unset;
44+
45+
details {
46+
margin-inline: auto;
47+
}
48+
}

src/site/_includes/design-system.njk

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
<div class="flex-auto box-flex flex-dir-column">
2424
<div class="sidebar flex-auto">
2525
<nav class="flow bg-mid-bg pad-block-size-1" aria-label="design system">
26-
<div class="brand cluster pad-inline-base">
27-
{{ svg('../../images/lockup.svg', {label: 'web.dev'}) }}
28-
<p class="brand__byline">Design System</p>
29-
</div>
30-
<div class="pad-inline-base">
31-
{% include "partials/standard-theme-toggle.njk" %}
26+
<div class="repel pad-inline-base flex-align-end">
27+
<div class="brand">
28+
{{ svg('../../images/lockup.svg', {label: 'web.dev'}) }}
29+
<p class="brand__byline">Design System</p>
30+
</div>
31+
<div>
32+
{% include "partials/standard-theme-toggle.njk" %}
33+
</div>
3234
</div>
3335
<ul class="stack-nav flow-space-size-2" role="list">
3436
{% for link in sideLinks %}
@@ -55,7 +57,7 @@
5557
</ul>
5658
</nav>
5759
<div class="pad-size-1">
58-
<article class="wrapper flow">
60+
<article class="prose">
5961
<h1>{{ pageTitle if pageTitle else title }}</h1>
6062
{% if summary %}
6163
<p>{{ summary | md | safe }}</p>

src/site/_includes/macros/design-system-component.njk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
<div class="flow">
44
<iframe class="design-system__preview-frame" src="{{ previewUrl }}?state=window" data-size="{{ size if size else 'standard' }}"></iframe>
55
<div class="cluster flex-justify-end">
6-
{% if handle %}
7-
<div>
8-
{# Pretty gnarly, but we can't use {% raw %} because we need that `handle` #}
9-
<strong>Render:</strong> <code>{{ "{{ design.components.render('" + handle + "') | safe }}" }}</code>
10-
</div>
11-
{% endif %}
126
<a href="{{ previewUrl }}">View full screen</a>
137
</div>
148
{% if markup or rendered %}

src/site/content/en/design-system/components.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pageScripts:
2424
</nav>
2525
{% endif %}
2626

27-
<div class="region">
27+
<div class="design-system__components-section pad-block-size-2">
2828
{{ designSystemComponent(item.previewUrl, item.markup, item.rendered, item.handle) }}
2929
</div>
3030

@@ -49,7 +49,7 @@ pageScripts:
4949
<h2>Variants</h2>
5050
{% for variant in item.variants %}
5151
<h3 id="{{ variant.data.title | slug }}">{{ variant.data.title }}</h3>
52-
<div class="flow-space-size-1">
52+
<div class="design-system__components-section gap-top-size-1">
5353
{{ designSystemComponent(variant.previewUrl, variant.markup, variant.rendered, variant.handle) }}
5454
</div>
5555
{% endfor %}

0 commit comments

Comments
 (0)