Skip to content

Commit 41e3e8a

Browse files
Merge pull request #13 from etchteam/feature/etch-877-images-code-samples-and-codepens-need-to-break-out-of-the
refactor: less scrolling in code examples
2 parents 220a6d0 + dde3a08 commit 41e3e8a

7 files changed

Lines changed: 52 additions & 15 deletions

File tree

src/guide/apply-diamond-ui/index.webc

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ In code form the separated components might now look like:
4141
<h1>Page title</h1>
4242
<p>Lorem ipsum dolor [...etc]</p>
4343
</div>
44-
<a class="button button--primary" href="#">Call to action</a>
44+
<a class="button button--primary" href="#">
45+
Call to action
46+
</a>
4547
</div>
4648
</section>
4749
```
@@ -64,10 +66,14 @@ Adding the eyebrow text and secondary paragraph is pretty straightforward. Becau
6466
<h1>Page title</h1>
6567
<p>Lorem ipsum dolor [...etc]</p>
6668
+ <p class="text-size-sm">
67-
+ Suspendisse sed dictum dolor, at hendrerit nibh. Curabitur euismod ipsum jut mi <a href="#">elementum interdum</a>.
69+
+ Suspendisse sed dictum dolor, at hendrerit nibh.
70+
+ Curabitur euismod ipsum jut mi
71+
+ <a href="#">elementum interdum</a>.
6872
+ </p>
6973
</div>
70-
<a class="button button--primary" href="#">Call to action</a>
74+
<a class="button button--primary" href="#">
75+
Call to action
76+
</a>
7177
</div>
7278
</section>
7379
```
@@ -90,15 +96,21 @@ Next let’s look at the two button Controls, one has a new ‘secondary’ styl
9096
<h1>Page title</h1>
9197
<p>Lorem ipsum dolor [...etc]</p>
9298
<p class="text-size-sm">
93-
Suspendisse sed dictum dolor, at hendrerit nibh. Curabitur euismod ipsum jut mi <a href="#">elementum interdum</a>.
99+
Suspendisse sed dictum dolor, at hendrerit nibh.
100+
Curabitur euismod ipsum jut mi
101+
<a href="#">elementum interdum</a>.
94102
</p>
95103
</div>
96104
+ <div class="grid">
97105
+ <div class="grid__item">
98-
<a class="button button--primary" href="#">Main action</a>
106+
<a class="button button--primary" href="#">
107+
Main action
108+
</a>
99109
+ </div>
100110
+ <div class="grid__item">
101-
+ <a class="button button--secondary" href="#">Secondary action</a>
111+
+ <a class="button button--secondary" href="#">
112+
+ Secondary action
113+
+ </a>
102114
+ </div>
103115
+ </div>
104116
</div>
@@ -127,7 +139,13 @@ Now when the product team decide they need an email signup in the main hero or t
127139
+ <email-input><input type="email" /></email-input>
128140
</div>
129141
<div class="grid__item">
130-
+ <button type="submit" class="button button--primary" href="#">Sign up</button>
142+
+ <button
143+
+ type="submit"
144+
+ class="button button--primary"
145+
+ href="#"
146+
+ >
147+
+ Sign up
148+
+ </button>
131149
</div>
132150
</div>
133151
+ </form>

src/guide/canvas/index.webc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Typical examples of canvas components are:
2727
alt="An example of UI with the canvas highlighted"
2828
/>
2929

30-
<p class="codepen" data-height="300" data-theme-id="dark" data-default-tab="html,result" data-slug-hash="vYjypKv" data-pen-title="Canvas" data-preview="true" data-user="gavmck" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">
30+
<p class="codepen" data-height="500" data-theme-id="dark" data-default-tab="result" data-slug-hash="vYjypKv" data-pen-title="Canvas" data-preview="true" data-user="gavmck" style="height: 500px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">
3131
<span>See the Pen <a href="https://codepen.io/gavmck/pen/vYjypKv">
3232
Canvas</a> by gavmck (<a href="https://codepen.io/gavmck">@gavmck</a>)
3333
on <a href="https://codepen.io">CodePen</a>.</span>

src/guide/composition/index.webc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Typical examples of a composition component are:
2525
alt="An example of UI with the composition elements highlighted"
2626
/>
2727

28-
<p class="codepen" data-height="300" data-theme-id="dark" data-default-tab="html,result" data-slug-hash="ExLNbbg" data-pen-title="Composition" data-preview="true" data-user="gavmck" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">
28+
<p class="codepen" data-height="500" data-theme-id="dark" data-default-tab="result" data-slug-hash="ExLNbbg" data-pen-title="Composition" data-preview="true" data-user="gavmck" style="height: 500px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">
2929
<span>See the Pen <a href="https://codepen.io/gavmck/pen/ExLNbbg">
3030
Composition</a> by gavmck (<a href="https://codepen.io/gavmck">@gavmck</a>)
3131
on <a href="https://codepen.io">CodePen</a>.</span>

src/guide/content/index.webc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,17 @@ Typical examples of content components are:
2626
alt="An example of UI with content highlighted"
2727
/>
2828

29-
<p class="codepen" data-height="300" data-theme-id="dark" data-default-tab="html,result" data-slug-hash="bGMBLgR" data-pen-title="Content" data-preview="true" data-user="gavmck" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">
29+
<p
30+
class="codepen"
31+
data-height="500"
32+
data-theme-id="dark"
33+
data-default-tab="result"
34+
data-slug-hash="bGMBLgR"
35+
data-pen-title="Content"
36+
data-preview="true"
37+
data-user="gavmck"
38+
style="height: 500px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"
39+
>
3040
<span>See the Pen <a href="https://codepen.io/gavmck/pen/bGMBLgR">
3141
Content</a> by gavmck (<a href="https://codepen.io/gavmck">@gavmck</a>)
3242
on <a href="https://codepen.io">CodePen</a>.</span>

src/guide/controls/index.webc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Typical examples of controls are:
2525
alt="An example of UI with controls highlighted"
2626
/>
2727

28-
<p class="codepen" data-height="300" data-theme-id="dark" data-default-tab="html,result" data-slug-hash="NWMbyaw" data-pen-title="Controls" data-preview="true" data-user="gavmck" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">
28+
<p class="codepen" data-height="500" data-theme-id="dark" data-default-tab="result" data-slug-hash="NWMbyaw" data-pen-title="Controls" data-preview="true" data-user="gavmck" style="height: 500px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">
2929
<span>See the Pen <a href="https://codepen.io/gavmck/pen/NWMbyaw">
3030
Controls</a> by gavmck (<a href="https://codepen.io/gavmck">@gavmck</a>)
3131
on <a href="https://codepen.io">CodePen</a>.</span>

src/guide/the-problem/index.webc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ Over the months, more requirements come in and more props get added. Different t
9595
on-secondary-button-click="handleButtonClick()"
9696
>
9797
<p slot="secondary-text">
98-
Suspendisse sed dictum dolor, at hendrerit nibh. Curabitur euismod
99-
ipsum ut mi <a href="#">elementum interdum</a>.
98+
Suspendisse sed dictum dolor, at hendrerit nibh.
99+
Curabitur euismod ipsum ut mi
100+
<a href="#">elementum interdum</a>.
100101
</p>
101102
</page-hero>
102103
```

src/guide/the-solution.webc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,18 @@ function pageHero(
3838
let result = `<header class="page-hero page-hero--${theme}">`;
3939

4040
if (eyebrow) {
41-
result += `<${eyebrowTag} class="page-hero__eyebrow">${eyebrow}</${eyebrowTag}>`;
41+
result += `
42+
<${eyebrowTag} class="page-hero__eyebrow">
43+
${eyebrow}
44+
</${eyebrowTag}>
45+
`;
4246
}
4347

44-
result += `<${titleTag} class="page-hero__title">${title}</${titleTag}>`;
48+
result += `
49+
<${titleTag} class="page-hero__title">
50+
${title}
51+
</${titleTag}>
52+
`;
4553

4654
// ...horror continues...
4755

0 commit comments

Comments
 (0)