Skip to content

Commit 2454911

Browse files
make h3 smaller, remove mid-word hyphens, animate landing link arrows, update docsearch index, open first nav-item (#47)
* make h3 smaller * add landing-a hover animation * turn off auto hyphens * include survey on most pages * open first nav item if there isn't a current page, update search index name * remove fade from nav animation * fix weird fade issue on mobile
1 parent 47926e1 commit 2454911

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed

src/css/doc.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.doc {
22
color: var(--doc-font-color);
33
font-size: var(--doc-font-size);
4-
hyphens: auto;
4+
/* hyphens: auto; */
55
line-height: var(--doc-line-height);
66
margin: var(--doc-margin);
77
max-width: var(--doc-max-width);

src/css/ds-layout.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ html[data-theme="dark"] .doc .landing-card-icon {
157157
position: absolute;
158158
margin-left: var(--ds-space-h);
159159
margin-top: calc(4 / var(--rem-base) * -1 * 1rem);
160+
161+
@apply transition-transform;
162+
}
163+
164+
.landing-a a:hover::after {
165+
transform: translateX(0.5rem);
160166
}
161167

162168
.landing-support a.support::before,

src/css/ds-typography.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
}
1515

1616
@mixin text-h3 {
17-
font-size: calc(20 / var(--rem-base) * 1rem);
17+
font-size: calc(16 / var(--rem-base) * 1rem);
1818
font-weight: 600;
1919
}
2020

2121
@mixin text-h4 {
22-
font-size: calc(16 / var(--rem-base) * 1rem);
22+
font-size: calc(15 / var(--rem-base) * 1rem);
2323
font-weight: 600;
2424
}
2525

src/css/nav.css

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
left: 0;
77
width: 100%;
88
z-index: var(--z-index-nav);
9-
visibility: hidden;
9+
display: none;
1010

1111
--transition-duration: 300ms;
1212
}
@@ -22,12 +22,12 @@
2222
flex: none;
2323
position: static;
2424
top: 0;
25-
visibility: visible;
25+
display: block;
2626
}
2727
}
2828

2929
.nav-container.is-active {
30-
visibility: visible;
30+
display: block;
3131
}
3232

3333
.nav {
@@ -100,16 +100,14 @@ html.is-clipped--nav {
100100
.nav-item > .nav-list {
101101
transition-duration: var(--transition-duration);
102102
transition-delay: 0s;
103-
transition-timing-function: cubic-bezier(0, 1, 0, 1), ease, linear;
104-
transition-property: max-height, opacity, visibility;
103+
transition-timing-function: cubic-bezier(0, 1, 0, 1), linear;
104+
transition-property: max-height, visibility;
105105
max-height: 100vh;
106-
opacity: 1;
107106
}
108107

109108
.nav-item:not(.is-active) > .nav-list {
110-
transition-delay: 0s, 0s, var(--transition-duration);
109+
transition-delay: 0s, var(--transition-duration);
111110
max-height: 0;
112-
opacity: 0;
113111
visibility: hidden;
114112
overflow: hidden;
115113
}

src/js/01-nav.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
scrollItemToMidpoint(menuPanel, currentPageItem.querySelector('.nav-link'))
2525
} else {
2626
menuPanel.scrollTop = 0
27+
menuPanel.querySelector('.nav-item:first-child').classList.add('is-active')
2728
}
2829

2930
find(menuPanel, '.nav-item-toggle').forEach(function (btn) {

src/partials/article.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
{{> tutorial-info}}
77
{{/if}}
88
{{{page.contents}}}
9-
{{#if (eq page.layout 'tutorial')}}
9+
{{#unless (eq page.layout 'full')}}
1010
{{> survey }}
11-
{{/if}}
11+
{{/unless}}
1212
{{> pagination}}
1313
</article>

src/partials/footer-scripts.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
docsearch({
88
container: '#docsearch',
99
appId: '2ELPRZR9UC',
10-
indexName: 'crawler_DocSearch Astra Serverless',
10+
indexName: 'crawler_docsearch-astra',
1111
{{!-- This is the public API key which can be safely used in frontend code. --}}
1212
apiKey: '1f4acbf51d118e4137e9a63b38bd8456',
1313
})

0 commit comments

Comments
 (0)