Skip to content

Commit 68b20b6

Browse files
authored
Guides layout fixes (rails#51385)
* Moving $gray-900 slightly darker to increase contrast ratios in body * Hn to white in dark mode * “Guides” logo word mark to white * Fixing yellow block overlap in subCol * Setting sidebar for intermediate desktop range * Fixing missing bottom border on interstitials due to dd collision * Simplifying layout, adding break points * pointer cursor on code copy * Fixing border regression on code interstitial
1 parent 31e795b commit 68b20b6

File tree

4 files changed

+32
-39
lines changed

4 files changed

+32
-39
lines changed

guides/assets/stylesrc/_dark.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@
6363
}
6464
} // table
6565

66-
h3 {
66+
h3, h4, h5, h6 {
6767
a,
6868
a:link,
6969
a:visited {
70-
color: $gray-100;
70+
color: #fff;
7171
} // a, a:link, a:visited
7272
} // h3
7373

@@ -110,6 +110,9 @@
110110
header#page_header {
111111
nav#feature_nav {
112112
.header-logo {
113+
a, a:link, a:visited {
114+
color: #fff;
115+
}
113116
span#version_switcher {
114117
color: $gray-400;
115118

guides/assets/stylesrc/_main.scss

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,11 @@ body.guide {
5555
hyphenate-limit-chars: 6 3 2; /* Not Safari */
5656
hyphenate-limit-last: always;
5757

58-
@include media('>tablet') {
59-
// On larger screens, set a width of 45-75 characters, using em as ch
60-
// has too much variation between various fonts
61-
min-width: 23em;
62-
max-width: 38em;
63-
}
64-
6558
margin: 0 0 0.75em 0; // Space after paragraph
6659
text-align: left;
6760

6861
} // p
6962

70-
table,
71-
ul,
72-
.interstitial {
73-
@include media('>tablet') {
74-
min-width: 23em;
75-
max-width: 38em;
76-
text-align: left;
77-
margin-left: 0 !important;
78-
}
79-
}
80-
8163
// Links
8264

8365
a {
@@ -271,7 +253,9 @@ body.guide {
271253
border-bottom: 1px solid $gray-500;
272254
margin: 0 0 1em 0;
273255

274-
&:last-child {border-bottom: none;}
256+
&:last-child {
257+
border-bottom: none;
258+
}
275259
} // dd
276260
} // dl
277261

@@ -342,11 +326,10 @@ body.guide {
342326
:where(body[dir="ltr"]) & { text-align: left; }
343327
:where(body[dir="rtl"]) & { text-align: right; }
344328

345-
@include media('>desktop') {
346-
width: 60vw;
347-
max-width: calc(55rem + 400px);
329+
@include media('>desktop') { // 1024
330+
max-width: calc(55rem + 420px);
348331
margin: 0 auto;
349-
padding-right: 400px;
332+
padding-right: 470px;
350333
}
351334
} // .wrapper
352335

@@ -682,18 +665,11 @@ body.guide {
682665
}
683666
}
684667

685-
main#container {
686-
@include media('>desktop') {
687-
// padding-right: 400px;
688-
}
689-
}
690-
691668
#feature {
692669
background-color: $gray-100;
693670

694671
@include media('>desktop') {
695672
background-color: #fff;
696-
// padding-right: 400px;
697673
}
698674

699675
#subCol {
@@ -706,10 +682,18 @@ body.guide {
706682
display: block;
707683
position: fixed;
708684
top: 100px;
709-
right: calc(40vw - 400px);
685+
right: 50px;
710686
max-height: calc(100vh - 90px);
711-
width: 30vw;
712-
max-width: 380px;
687+
width: 400px;
688+
}
689+
690+
@include media('>desktop-ultra-wide') {
691+
right: calc(30vw - 400px);
692+
}
693+
694+
@include media('>desktop-hd') { // 1920
695+
696+
right: calc(40vw - 400px);
713697
}
714698

715699
h3.chapter img {
@@ -768,12 +752,15 @@ body.guide {
768752
margin-top: 0.5em;
769753
margin-bottom: 0.75em;
770754
padding-inline-start: 1em;
771-
max-width: unset;
755+
@include media('>desktop') {
756+
max-width: 310px;
757+
width: 310px;
758+
}
772759

773760
li {
774761
font-weight: 400;
775762
@include media('>desktop') {
776-
width: 320px;
763+
width: 310px;
777764
}
778765
} // li
779766
} // ul

guides/assets/stylesrc/components/_code-container.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ intermediate whitespace looks uniform. */
1313
background-size: 36px 36px;
1414
border-radius: $base-border-radius;
1515
border: 2px solid $gray-500;
16+
border-style: solid !important;
17+
border-width: 2px !important;
1618
min-height: calc(36px + 1.2em);
1719
margin: 2em auto;
1820
padding: 0.75em !important;
@@ -33,7 +35,7 @@ intermediate whitespace looks uniform. */
3335
}
3436

3537
&.code {
36-
border: none;
38+
border: none !important;
3739
background-color: $gray-900;
3840
min-height: auto; // remove if icon is restored
3941
padding-left: 1em !important; // remove if icon is restored
@@ -42,6 +44,7 @@ intermediate whitespace looks uniform. */
4244

4345
button.clipboard-button {
4446
color: $gray-100;
47+
cursor: pointer;
4548
background-color: $gray-700;
4649
border: 1px solid $gray-500;
4750
border-radius: 4px;

guides/assets/stylesrc/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ $gray-600: #666666;
5151
$gray-650: #505050;
5252
$gray-700: #3A3939;
5353
$gray-800: #343434;
54-
$gray-900: #2E2E2E;
54+
$gray-900: #292929;
5555
$gray-1000: #181818;
5656

5757
$note: #FFD600;

0 commit comments

Comments
 (0)