Skip to content

Commit f875c6f

Browse files
Jesse Bordenfedericobucchi
authored andcommitted
Update code-box and full-width-text-code-column markup and styles.
1 parent 9a5e8c2 commit f875c6f

File tree

3 files changed

+42
-31
lines changed

3 files changed

+42
-31
lines changed

_includes/new-includes/components/code-box.html

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,29 @@
11
<div
22
class="code-box content-wrapper {% if include.with-tabs %}code-box-with-tabs{% endif %}"
33
>
4-
<div class="content-body">
5-
<h2>{{include.content.headline}}</h2>
6-
{% if include.content.pre-code-text %}
7-
<p class="body-copy">{{include.content.pre-code-text}}</p>
8-
{% endif %}
9-
{% if include.content.tabs %}
10-
<nav>
11-
<ul class="code-box-tabs">
12-
{% for tab in include.content.tabs %}
13-
<li class="body-copy{% if forloop.first %} active{% endif %}">
14-
<button data-tab-index="{{forloop.index0}}">{{tab.label}}</button>
15-
</li>
16-
{% endfor %}
17-
</ul>
18-
</nav>
19-
{% for tab in include.content.tabs %}
20-
<pre
21-
data-tab-index="{{forloop.index0}}"
22-
class="{% if forloop.first %}active{% endif %}"
23-
><code>{{tab.code}}</code></pre>
24-
{% endfor %} {% else %}
25-
{% if include.content.code %}
26-
<pre><code>{{include.content.code}}</code></pre>
27-
{% endif %}
28-
{% endif %} {% if include.content.after-code-text %}
29-
<p class="body-copy">{{include.content.after-code-text}}</p>
30-
{% endif %}
31-
</div>
32-
{% if include.content.links %}
4+
<h2>{{include.content.headline}}</h2>
5+
{% if include.content.pre-code-text %}
6+
<p class="body-copy">{{include.content.pre-code-text}}</p>
7+
{% endif %} {% if include.content.tabs %}
8+
<nav>
9+
<ul class="code-box-tabs">
10+
{% for tab in include.content.tabs %}
11+
<li class="body-copy{% if forloop.first %} active{% endif %}">
12+
<button data-tab-index="{{forloop.index0}}">{{tab.label}}</button>
13+
</li>
14+
{% endfor %}
15+
</ul>
16+
</nav>
17+
{% for tab in include.content.tabs %}
18+
<pre
19+
data-tab-index="{{forloop.index0}}"
20+
class="{% if forloop.first %}active{% endif %}"
21+
><code>{{tab.code | escape}}</code></pre>
22+
{% endfor %} {% else %} {% if include.content.code %}
23+
<pre><code>{{include.content.code | escape}}</code></pre>
24+
{% endif %} {% endif %} {% if include.content.after-code-text %}
25+
<p class="body-copy">{{include.content.after-code-text}}</p>
26+
{% endif %}{% if include.content.links %}
3327
<div class="link-wrapper">
3428
{% for link in include.content.links %}
3529
<a class="body-copy" href="{{ link.href }}"> {{ link.copy }} <i></i> </a>

_includes/new-includes/components/full-width-text-code-column.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
<h2>{{ include.content.headline }}</h2>
66
{% for paragraph in include.content.paragraphs %}
77
<p class="body-copy">{{paragraph}}</p>
8-
{% endfor %}
8+
{% endfor %} {% if include.content.link %}
99
<a class="body-copy" href="{{ include.content.link.url }}"
1010
>{{ include.content.link.text }} <i></i
1111
></a>
12+
{% endif %}
1213
</div>
1314
<!-- prettier-ignore -->
1415
<div class="code body-copy" markdown="1">

assets/stylesheets/new-stylesheets/pages/_get-started.scss

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,17 @@
379379
flex-direction: column;
380380
align-items: flex-start;
381381
text-align: left;
382-
padding: 37px 111px 41px 49px;
382+
padding: 37px 50px 41px 50px;
383383
margin-bottom: 70px;
384384
box-sizing: border-box;
385385
border-radius: 22px;
386386

387+
pre {
388+
max-height: 400px;
389+
}
390+
387391
&.code-box-with-tabs {
392+
overflow: hidden;
388393
pre {
389394
display: none;
390395

@@ -397,6 +402,7 @@
397402
&-tabs {
398403
margin-bottom: 20px;
399404
padding-left: 0 !important;
405+
400406
button {
401407
outline: none;
402408
border: none;
@@ -469,6 +475,16 @@
469475
a {
470476
@include link-with-right-arrow;
471477
}
478+
479+
@media only screen and (max-width: 768px) {
480+
nav {
481+
ul {
482+
white-space: nowrap;
483+
width: calc(100% - 59px);
484+
overflow: scroll;
485+
}
486+
}
487+
}
472488
}
473489

474490
.headline-section {

0 commit comments

Comments
 (0)