Skip to content

Commit 59725a1

Browse files
Site padding fixes + miscellaneous (#7)
* logo fix for prefers theme, site padding fixes, random style fixes * input padding
1 parent bcadf74 commit 59725a1

File tree

10 files changed

+96
-54
lines changed

10 files changed

+96
-54
lines changed

src/css/doc.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
font-size: var(--doc-font-size);
44
hyphens: auto;
55
line-height: var(--doc-line-height);
6-
margin: 0; /* var(--doc-margin); */
6+
margin: var(--doc-margin);
77
max-width: var(--doc-max-width);
8-
padding-right: calc(40 / var(--rem-base) * 1rem);
8+
padding-right: calc(24 / var(--rem-base) * 1rem);
99
padding-left: calc(24 / var(--rem-base) * 1rem);
1010
padding-bottom: 4rem;
1111
}
@@ -14,7 +14,7 @@
1414
.doc {
1515
flex: auto;
1616
font-size: var(--doc-font-size--desktop);
17-
margin: 0; /* var(--doc-margin--desktop); */
17+
margin: var(--doc-margin--desktop);
1818
max-width: var(--doc-max-width--desktop);
1919
min-width: 0;
2020
}
@@ -132,6 +132,7 @@
132132
.doc h5 .anchor::before,
133133
.doc h6 .anchor::before {
134134
font-family: "Material Icons Outlined", sans-serif;
135+
font-weight: 400;
135136
content: "\f1cd";
136137
}
137138

src/css/ds-input.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,15 @@
4848
font-size: 20px;
4949
}
5050

51+
.ds-input--leading-icon + .ds-input {
52+
padding-left: 0;
53+
}
54+
5155
.ds-input--trailing-icon {
5256
margin-right: 10px;
5357
font-size: 20px;
5458
}
59+
60+
.ds-input--trailing-icon + .ds-input {
61+
padding-right: 0;
62+
}

src/css/ds-logo.css

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
html[data-theme="dark"] #datastax-docs-logo-main {
2+
background: url('../img/datastax-docs-logo-light-bg.svg') no-repeat center / contain;
3+
}
4+
5+
html[data-theme="light"] #datastax-docs-logo-main {
6+
background: url('../img/datastax-docs-logo-dark-bg.svg') no-repeat center / contain;
7+
}
8+
9+
#datastax-docs-logo-main {
10+
width: 287px;
11+
height: 40px;
12+
}
13+
14+
@media (prefers-color-scheme: light) {
15+
:root:not([data-theme="light"]):not([data-theme="dark"]) #datastax-docs-logo-main {
16+
background: url('../img/datastax-docs-logo-light-bg.svg') no-repeat center / contain;
17+
}
18+
}
19+
20+
@media (prefers-color-scheme: dark) {
21+
:root:not([data-theme="light"]):not([data-theme="dark"]) #datastax-docs-logo-main {
22+
background: url('../img/datastax-docs-logo-light-bg.svg') no-repeat center / contain;
23+
}
24+
}
25+
26+
@media screen and (max-width: 768.5px) {
27+
#datastax-docs-logo-main {
28+
width: 162px;
29+
height: 40px;
30+
}
31+
32+
html[data-theme="dark"] #datastax-docs-logo-main {
33+
background: url('../img/datastax-docs-logo-small-light-bg.svg') no-repeat center / contain;
34+
}
35+
36+
html[data-theme="light"] #datastax-docs-logo-main {
37+
background: url('../img/datastax-docs-logo-small-dark-bg.svg') no-repeat center / contain;
38+
}
39+
}
40+
41+
@media screen and (max-width: 768.5px) and (prefers-color-scheme: light) {
42+
:root:not([data-theme="light"]):not([data-theme="dark"]) #datastax-docs-logo-main {
43+
background: url('../img/datastax-docs-logo-small-dark-bg.svg') no-repeat center / contain;
44+
}
45+
}
46+
47+
@media screen and (max-width: 768.5px) and (prefers-color-scheme: dark) {
48+
:root:not([data-theme="light"]):not([data-theme="dark"]) #datastax-docs-logo-main {
49+
background: url('../img/datastax-docs-logo-small-light-bg.svg') no-repeat center / contain;
50+
}
51+
}

src/css/header.css

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ body {
99
.navbar {
1010
background: var(--navbar-background);
1111
color: var(--navbar-font-color);
12-
/* font-size: calc(16 / var(--rem-base) * 1rem); */
1312
height: var(--navbar-height);
1413
position: fixed;
1514
top: 0;
@@ -23,7 +22,6 @@ body {
2322

2423
.navbar-brand {
2524
display: flex;
26-
/* flex: auto; */
2725
align-items: center;
2826
justify-content: space-between;
2927
padding: 0 var(--site-padding);
@@ -50,6 +48,7 @@ body {
5048

5149
.navbar-burger::before {
5250
font-family: "Material Icons Outlined", sans-serif;
51+
font-weight: 400;
5352
font-size: 20px;
5453
content: "\e5d2";
5554
}
@@ -58,25 +57,18 @@ body {
5857
content: "\e5cd";
5958
}
6059

61-
#datastax-docs-logo-main {
62-
width: 287px;
63-
height: 40px;
64-
}
65-
66-
html[data-theme="dark"] #datastax-docs-logo-main {
67-
background: url('../img/datastax-docs-logo-light-bg.svg') no-repeat center / contain;
68-
}
69-
70-
html[data-theme="light"] #datastax-docs-logo-main {
71-
background: url('../img/datastax-docs-logo-dark-bg.svg') no-repeat center / contain;
72-
}
73-
7460
@media screen and (min-width: 769px) {
7561
#search-input {
7662
width: 200px;
7763
}
7864
}
7965

66+
@media screen and (max-width: 768.5px) {
67+
#search-button {
68+
display: none;
69+
}
70+
}
71+
8072
@media screen and (max-width: 1023.5px) {
8173
#get-support {
8274
width: 40px;
@@ -87,36 +79,10 @@ html[data-theme="light"] #datastax-docs-logo-main {
8779
#get-support .ds-button--leading-icon {
8880
margin: 0;
8981
}
90-
}
91-
92-
@media screen and (max-width: 768.5px) {
93-
#search-button {
94-
display: none;
95-
}
96-
97-
#datastax-docs-logo-main {
98-
width: 162px;
99-
height: 40px;
100-
}
101-
102-
html[data-theme="dark"] #datastax-docs-logo-main {
103-
background: url('../img/datastax-docs-logo-small-light-bg.svg') no-repeat center / contain;
104-
}
105-
106-
html[data-theme="light"] #datastax-docs-logo-main {
107-
background: url('../img/datastax-docs-logo-small-dark-bg.svg') no-repeat center / contain;
108-
}
109-
}
110-
111-
@media screen and (min-width: 769px) {
112-
#search-input {
113-
width: 200px;
114-
}
115-
}
11682

117-
@media screen and (max-width: 1023.5px) {
11883
.navbar-brand {
11984
height: inherit;
85+
padding: 0 var(--site-padding--mobile);
12086
}
12187

12288
.navbar-brand .navbar-item {
@@ -130,7 +96,7 @@ html[data-theme="light"] #datastax-docs-logo-main {
13096
max-height: var(--body-min-height);
13197
overflow-y: auto;
13298
overscroll-behavior: none;
133-
padding: 16px var(--site-padding);
99+
padding: var(--site-padding--mobile);
134100
border-top: 1px solid var(--ds-divider);
135101
border-bottom: 1px solid var(--ds-divider);
136102
}

src/css/main.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
main {
2+
padding-right: var(--site-padding);
3+
}
4+
15
@media screen and (max-width: 1023.5px) {
26
aside.toc.sidebar {
37
display: none;
@@ -6,6 +10,10 @@
610
main > .content {
711
overflow-x: auto;
812
}
13+
14+
main {
15+
padding-right: 0;
16+
}
917
}
1018

1119
@media screen and (min-width: 1024px) {
@@ -33,7 +41,3 @@
3341
flex-basis: var(--toc-width--widescreen);
3442
}
3543
}
36-
37-
main {
38-
padding-right: calc(24 / var(--rem-base) * 1rem);
39-
}

src/css/page-versions.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
padding: 0.5rem 1.5rem 0.5rem 0.5rem;
2222
position: relative;
2323
z-index: var(--z-index-page-version-menu);
24+
border-radius: 6px;
2425
}
2526

2627
.page-versions .version-menu {
@@ -34,6 +35,8 @@
3435
top: 0;
3536
right: 0;
3637
white-space: nowrap;
38+
border-radius: 6px;
39+
border: 1px solid var(--ds-divider);
3740
}
3841

3942
.page-versions:not(.is-active) .version-menu {

src/css/site.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
@import "ds-typography.css";
1313
@import "ds-button.css";
1414
@import "ds-input.css";
15+
@import "ds-logo.css";
1516
@import "toolbar.css";
1617
@import "breadcrumbs.css";
1718
@import "page-versions.css";

src/css/toolbar.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
position: sticky;
1010
top: var(--navbar-height);
1111
z-index: var(--z-index-toolbar);
12-
padding: 0 var(--site-padding) 0 24px;
12+
padding-left: calc(24 / var(--rem-base) * 1rem);
1313
}
1414

1515
.toolbar ul li:last-of-type {
@@ -22,6 +22,7 @@
2222

2323
.nav-toggle::after {
2424
font-family: "Material Icons Outlined", sans-serif;
25+
font-weight: 400;
2526
font-size: 20px;
2627
content: "\e9bd";
2728
}
@@ -50,3 +51,9 @@
5051
.toolbar .edit-this-page a {
5152
color: var(--toolbar-font-color);
5253
}
54+
55+
@media screen and (max-width: 1023.5px) {
56+
.toolbar {
57+
padding-right: var(--site-padding--mobile);
58+
}
59+
}

src/css/vars.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
--toolbar-border-color: var(--ds-divider);
4242
--toolbar-font-color: var(--ds-primary-main);
4343
--toolbar-muted-color: var(--ds-text-tertiary);
44-
--page-version-menu-background: var(--ds-background-level3);
45-
--page-version-missing-font-color: var(--ds-text-tertiary);
44+
--page-version-menu-background: var(--ds-background-body);
45+
--page-version-missing-font-color: var(--ds-text-disabled);
4646
/* admonitions */
4747
--caution-color: var(--ds-primary-main);
4848
--caution-on-color: var(--ds-text-inverse);
@@ -105,6 +105,7 @@
105105
--footer-link-font-color: var(--link-font-color);
106106
/* dimensions and positioning */
107107
--site-padding: calc(32 / var(--rem-base) * 1rem);
108+
--site-padding--mobile: calc(24 / var(--rem-base) * 1rem);
108109
--navbar-height: calc(100 / var(--rem-base) * 1rem);
109110
--toolbar-height: calc(45 / var(--rem-base) * 1rem);
110111
--drawer-height: var(--toolbar-height);

src/partials/nav-toggle.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<button class="nav-toggle ds-button ds-button--color-neutral ds-button--variant-plain"></button>
1+
<button class="nav-toggle ds-button ds-button--color-neutral ds-button--variant-plain ds-button--is-icon"></button>

0 commit comments

Comments
 (0)