Skip to content

Commit 2e85e99

Browse files
Primary Navigation (Side Nav) (#10)
* logo fix for prefers theme, site padding fixes, random style fixes * input padding * add mixins * set spacing system to an 8px base unit * style the nav * add ds css variables for spacing system * border instead of box-shadow * general spacing updates * update nvmrc with updated postcss deps, use mixins for theme, fix build, change theme scripts, preload fonts * aditional spacing updates * fix button size error * secondary nav links * correct button size * use font for button * implement new spacing all over * fix conflict * site padding back to 32 --------- Co-authored-by: Josué Bran <[email protected]>
1 parent d471ee3 commit 2e85e99

16 files changed

+251
-152
lines changed

.vscode/settings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"editor.tabSize": 2,
3+
"files.associations": {
4+
"*.css": "postcss"
5+
},
6+
"emmet.includeLanguages":{
7+
"postcss": "css"
8+
},
9+
"emmet.syntaxProfiles": {
10+
"postcss": "css"
11+
},
12+
}

src/css/doc.css

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
}
2121
}
2222

23+
@media screen and (max-width: 1023.5px) {
24+
.doc {
25+
padding-left: var(--site-padding);
26+
padding-right: var(--site-padding);
27+
}
28+
}
29+
2330
.doc h1,
2431
.doc h2,
2532
.doc h3,
@@ -33,38 +40,27 @@
3340
}
3441

3542
.doc > h1.page:first-child {
36-
/* font-size: calc(36 / var(--rem-base) * 1rem); */
3743
margin: calc(24 / var(--rem-base) * 1rem) 0;
3844
}
3945

4046
.doc h1 {
41-
/* .ds-text-h1 */
42-
font-size: calc(24 / var(--rem-base) * 1rem);
43-
font-weight: 600;
47+
@include text-h1;
4448
}
4549

4650
.doc h2 {
47-
/* .ds-text-h2 */
48-
font-size: calc(20 / var(--rem-base) * 1rem);
49-
font-weight: 600;
51+
@include text-h2;
5052
}
5153

5254
.doc h3 {
53-
/* .ds-text-h3 */
54-
font-size: calc(20 / var(--rem-base) * 1rem);
55-
font-weight: 600;
55+
@include text-h3;
5656
}
5757

5858
.doc h4 {
59-
/* .ds-text-h4 */
60-
font-size: calc(16 / var(--rem-base) * 1rem);
61-
font-weight: 600;
59+
@include text-h4;
6260
}
6361

6462
.doc h5 {
65-
/* .ds-text-h5 */
66-
font-size: calc(15 / var(--rem-base) * 1rem);
67-
font-weight: 600;
63+
@include text-h5;
6864
}
6965

7066
.doc a.link,
@@ -119,9 +115,7 @@
119115
width: 2.75ex;
120116
margin-left: -2ex;
121117
visibility: hidden;
122-
/* font-size: 0.8em; */
123118
font-weight: normal;
124-
/* padding-top: 0.05em; */
125119
color: var(--ds-primary-soft-hover-bg);
126120
}
127121

@@ -946,16 +940,17 @@
946940
}
947941

948942
.doc .conum[data-value] {
949-
border: 1px solid currentColor;
943+
@include text-overline;
944+
945+
color: var(--ds-text-inverse);
946+
background: var(--ds-text-primary);
950947
border-radius: 100%;
951948
display: inline-block;
952-
font-family: var(--body-font-family);
953-
font-size: calc(12 / var(--rem-base) * 1rem);
954949
font-style: normal;
955-
line-height: 1.5;
950+
line-height: 2;
956951
text-align: center;
957-
width: 1.25em;
958-
height: 1.25em;
952+
width: 2em;
953+
height: 2em;
959954
letter-spacing: -0.25ex;
960955
text-indent: -0.25ex;
961956
}

src/css/ds-button.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.ds-button {
2+
@include text-button;
3+
24
border-radius: 6px;
3-
padding: 0 12px;
4-
height: 40px;
5-
font-size: calc(16 / var(--rem-base) * 1rem);
6-
font-weight: 600;
5+
padding: 0 1.5rem;
6+
height: var(--ds-space-5);
77
transition: var(--ds-transition);
88
border: 1px solid transparent;
99
display: flex;
@@ -17,17 +17,17 @@
1717

1818
/* icon button */
1919
.ds-button--is-icon {
20-
height: 40px;
21-
width: 40px;
20+
height: var(--ds-space-5);
21+
width: var(--ds-space-5);
2222
padding: 0;
2323
}
2424

2525
.ds-button--leading-icon {
26-
margin-right: 8px;
26+
margin-right: var(--ds-space-1);
2727
}
2828

2929
.ds-button--trailing-icon {
30-
margin-left: 8px;
30+
margin-left: var(--ds-space-1);
3131
}
3232

3333
.ds-button--variant-outlined {

src/css/ds-input.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.ds-input-container {
2-
height: 40px;
3-
font-size: var(--ds-space-2);
4-
font-weight: 400;
2+
@include text-body;
3+
4+
height: var(--ds-space-5);
55
color: var(--ds-text-primary);
66
transition: var(--ds-transition);
77
border-radius: 6px;
@@ -32,7 +32,7 @@
3232
display: block;
3333
min-width: 0;
3434
width: 100%;
35-
padding: 5.5px 10px;
35+
padding: 1.4545rem 1.25rem;
3636

3737
&::placeholder {
3838
color: var(--ds-text-placeholder);
@@ -44,17 +44,17 @@
4444
}
4545

4646
.ds-input--leading-icon {
47-
margin-left: 10px;
48-
font-size: 20px;
47+
margin-left: 1.25rem;
48+
font-size: 2.5rem;
4949
}
5050

5151
.ds-input--leading-icon + .ds-input {
5252
padding-left: 0;
5353
}
5454

5555
.ds-input--trailing-icon {
56-
margin-right: 10px;
57-
font-size: 20px;
56+
margin-right: 1.25rem;
57+
font-size: 2.5rem;
5858
}
5959

6060
.ds-input--trailing-icon + .ds-input {

src/css/ds-logo.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ html[data-theme="light"] #datastax-docs-logo-main {
77
}
88

99
#datastax-docs-logo-main {
10-
width: 287px;
11-
height: 40px;
10+
width: calc(287 / var(--rem-base) * 1rem);
11+
height: calc(40 / var(--rem-base) * 1rem);
1212
}
1313

1414
@media (prefers-color-scheme: light) {
@@ -25,8 +25,8 @@ html[data-theme="light"] #datastax-docs-logo-main {
2525

2626
@media screen and (max-width: 768.5px) {
2727
#datastax-docs-logo-main {
28-
width: 162px;
29-
height: 40px;
28+
width: calc(162 / var(--rem-base) * 1rem);
29+
height: calc(40 / var(--rem-base) * 1rem);
3030
}
3131

3232
html[data-theme="dark"] #datastax-docs-logo-main {

src/css/ds-typography.css

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,78 @@
1-
.ds-text-display {
2-
font-size: 2.125rem;
1+
@mixin text-display {
2+
font-size: calc(34 / var(--rem-base) * 1rem);
33
font-weight: 600;
44
}
55

6-
.ds-text-h1 {
7-
font-size: 1.5rem;
6+
@mixin text-h1 {
7+
font-size: calc(24 / var(--rem-base) * 1rem);
88
font-weight: 600;
99
}
1010

11-
.ds-text-h2 {
12-
font-size: 1.25rem;
11+
@mixin text-h2 {
12+
font-size: calc(20 / var(--rem-base) * 1rem);
1313
font-weight: 600;
1414
}
1515

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

21-
.ds-text-h4 {
22-
font-size: 0.938rem;
21+
@mixin text-h4 {
22+
font-size: calc(16 / var(--rem-base) * 1rem);
23+
font-weight: 600;
24+
}
25+
26+
@mixin text-h5 {
27+
font-size: calc(15 / var(--rem-base) * 1rem);
2328
font-weight: 600;
2429
}
2530

26-
.ds-text-body {
27-
font-size: var(--ds-space-2);
31+
@mixin text-body {
32+
font-size: calc(16 / var(--rem-base) * 1rem);
2833
font-weight: 400;
2934
}
3035

31-
.ds-text-body-small {
32-
font-size: 0.906rem;
36+
@mixin text-body-small {
37+
font-size: calc(14.5 / var(--rem-base) * 1rem);
3338
font-weight: 400;
3439
}
3540

36-
.ds-text-caption {
37-
font-size: 0.906rem;
41+
@mixin text-caption {
42+
font-size: calc(14.5 / var(--rem-base) * 1rem);
3843
font-weight: 500;
3944
}
4045

41-
.ds-text-label {
42-
font-size: 0.8125rem;
46+
@mixin text-label {
47+
font-size: calc(13 / var(--rem-base) * 1rem);
4348
font-weight: 600;
4449
}
4550

46-
.ds-text-overline {
47-
font-size: 0.75rem;
51+
@mixin text-overline {
52+
font-size: calc(12 / var(--rem-base) * 1rem);
4853
font-weight: 650;
49-
letter-spacing: 0.075rem;
54+
letter-spacing: calc(1.2 / var(--rem-base) * 1rem);
5055
text-transform: uppercase;
5156
}
5257

53-
.ds-text-button {
54-
font-size: calc(16 / var(--rem-base) * 1rem);
58+
@mixin text-button {
59+
font-size: calc(14.5 / var(--rem-base) * 1rem);
5560
font-weight: 600;
5661
}
5762

58-
.ds-text-tab {
59-
font-size: 1rem;
63+
@mixin text-tab {
64+
font-size: calc(16 / var(--rem-base) * 1rem);
6065
font-weight: 400;
6166
}
6267

63-
.ds-text-mono {
64-
font-family: "Roboto Mono", monospace;
65-
font-size: 0.96875rem;
68+
@mixin text-mono {
69+
font-size: calc(15.5 / var(--rem-base) * 1rem);
6670
font-weight: 400;
71+
font-family: "Roboto Mono", monospace;
6772
}
6873

69-
.ds-text-mono-small {
70-
font-family: "Roboto Mono", monospace;
71-
font-size: 0.875rem;
74+
@mixin text-mono-small {
75+
font-size: calc(14 / var(--rem-base) * 1rem);
7276
font-weight: 400;
77+
font-family: "Roboto Mono", monospace;
7378
}

src/css/header.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ body {
2929

3030
.search {
3131
display: flex;
32-
gap: 8px;
32+
gap: var(--ds-space-1);
3333
margin-right: auto;
3434
}
3535

3636
.navbar-end {
3737
display: flex;
38-
gap: 8px;
38+
gap: var(--ds-space-1);
3939
align-items: center;
4040
flex: auto;
4141
}
@@ -49,7 +49,7 @@ body {
4949
.navbar-burger::before {
5050
font-family: "Material Icons Outlined", sans-serif;
5151
font-weight: 400;
52-
font-size: 20px;
52+
font-size: calc(20 / var(--rem-base) * 1rem);
5353
content: "\e5d2";
5454
}
5555

@@ -60,7 +60,7 @@ body {
6060
#theme-toggle::before {
6161
font-family: "Material Icons Outlined", sans-serif;
6262
font-weight: 400;
63-
font-size: 20px;
63+
font-size: calc(20 / var(--rem-base) * 1rem);
6464
content: "\e51c";
6565
color: var(--ds-primary-400);
6666
}
@@ -72,7 +72,7 @@ html[data-theme="dark"] #theme-toggle::before {
7272

7373
@media screen and (min-width: 769px) {
7474
#search-input {
75-
width: 200px;
75+
width: calc(200 / var(--rem-base) * 1rem);
7676
}
7777
}
7878

@@ -84,7 +84,7 @@ html[data-theme="dark"] #theme-toggle::before {
8484

8585
@media screen and (max-width: 1023.5px) {
8686
#get-support {
87-
width: 40px;
87+
width: var(--ds-space-5);
8888
padding: 0;
8989
font-size: 0;
9090
}
@@ -95,7 +95,7 @@ html[data-theme="dark"] #theme-toggle::before {
9595

9696
.navbar-brand {
9797
height: inherit;
98-
padding: 0 var(--site-padding--mobile);
98+
padding: 0 var(--site-padding);
9999
}
100100

101101
.navbar-brand .navbar-item {
@@ -109,7 +109,7 @@ html[data-theme="dark"] #theme-toggle::before {
109109
max-height: var(--body-min-height);
110110
overflow-y: auto;
111111
overscroll-behavior: none;
112-
padding: var(--site-padding--mobile);
112+
padding: var(--site-padding);
113113
border-top: 1px solid var(--ds-divider);
114114
border-bottom: 1px solid var(--ds-divider);
115115
}

0 commit comments

Comments
 (0)