Skip to content

Commit 038ac32

Browse files
authored
Merge pull request #50 from couchbase/ui-bug-fixes
Fixed removing $ issues while copying & version dropdown style
2 parents e2e4ea7 + c859adb commit 038ac32

File tree

9 files changed

+82
-25
lines changed

9 files changed

+82
-25
lines changed

src/css/clipboard.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ a.copy-code-button:hover {
146146
}
147147
}
148148

149-
code.language-console.hljs.shell,
149+
/* code.language-console.hljs.shell,
150150
pre code.language-bash.hljs {
151151
white-space: nowrap;
152152
overflow-x: auto;
153-
}
153+
} */
154154

155155
code::-webkit-scrollbar {
156156
width: 0.25rem;

src/css/component-frame.css

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,63 @@
11
.component-frame {
22
/* rgba(87, 160, 255, 1) */
33
background: var(--color-brand-gray6);
4-
/* padding: 12px 15px 12px 15px; */
4+
padding: 0 15px 0 15px;
55
display: flex;
66
/* align-items: center; */
77
justify-content: center;
88
position: relative;
99
}
1010

1111
.frame-icon {
12-
padding: 12px 0 12px 15px;
12+
padding: 12px 0 12px 0;
13+
display: inline-block;
14+
line-height: 1;
15+
}
16+
17+
.frame-icon img {
18+
width: 34px;
1319
}
1420

1521
.frame-body {
1622
margin-left: var(--base-extra-small-space);
1723
position: relative;
1824
padding-top: 12px;
1925
padding-bottom: 12px;
20-
padding-right: 15px;
26+
padding-right: 0;
2127
line-height: 2;
2228
display: flex;
2329
align-items: center;
2430
flex-wrap: wrap;
2531
}
2632

2733
.frame-body .title {
28-
margin: 0 4px 0 0;
34+
margin: 0 0 0 0;
2935
font-size: var(--font-medium);
3036
line-height: 1.5rem;
3137
font-weight: var(--weight-semibold);
3238
color: var(--color-brand-gray1);
3339
display: inline-block;
40+
word-break: break-word;
41+
font-family: "Source Sans Pro", sans-serif;
42+
}
43+
44+
.frame-body .title span {
45+
display: inline;
3446
}
3547

3648
.component-frame .frame-link-dropdowns {
3749
display: inline-block;
3850
line-height: 1;
51+
/* position: relative;
52+
padding-bottom: 20px;
53+
margin-bottom: -20px; */
3954
}
4055

4156
.frame-body .frame-link {
4257
position: relative;
58+
color: var(--color-brand-gray1);
59+
font-size: 18px;
60+
margin-left: 4px;
4361
}
4462

4563
.frame-dropdown {
@@ -59,10 +77,13 @@
5977
.frame-link-dropdowns .frame-link {
6078
color: var(--color-brand-gray1);
6179
font-weight: var(--weight-semibold);
80+
margin: 0;
81+
font-family: "Source Sans Pro", sans-serif;
6282
}
6383

6484
.frame-link-dropdowns .frame-link svg {
6585
color: var(--color-brand-black);
86+
font-size: var(--font-base);
6687
}
6788

6889
.frame-dropdown .frame-dropdown-list,

src/css/doc.css

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,27 @@
2525
margin: 2.5rem 0 0;
2626
}
2727

28+
.page-heading-title {
29+
display: flex;
30+
align-items: center;
31+
flex-wrap: wrap;
32+
}
33+
2834
.doc h1.page {
2935
font-size: var(--heading-h1);
36+
line-height: 50px;
3037
margin-top: 0;
38+
margin-right: var(--base-space);
3139
display: inline-block;
3240
}
3341

3442
.doc h1.page + .labels {
3543
display: inline-block;
36-
position: relative;
37-
top: -5px;
38-
margin-left: var(--base-space);
3944
}
4045

4146
.doc h2 {
4247
font-size: var(--heading-h2);
4348
max-width: fit-content;
44-
display: inline-block;
4549
width: 100%;
4650
/* NOTE used to restrict width of key line */
4751
}
@@ -64,7 +68,7 @@
6468
}
6569

6670
.doc h5 {
67-
font-size: var(--heading-h4);
71+
font-size: var(--heading-h5);
6872
}
6973

7074
.doc h1 > a.anchor,
@@ -77,10 +81,20 @@
7781
position: absolute;
7882
text-decoration: none;
7983
width: 3ex;
80-
margin-left: -2.5ex;
84+
margin-left: -2.75ex;
8185
visibility: hidden;
8286
text-align: center;
87+
transform: scale(0.85);
88+
}
89+
90+
.doc h1 > a.anchor {
91+
transform: scale(0.65);
92+
margin-left: -2.25ex;
93+
}
94+
95+
.doc h2 > a.anchor {
8396
transform: scale(0.75);
97+
margin-left: -2.5ex;
8498
}
8599

86100
.doc h1:hover a.anchor,
@@ -1015,6 +1029,7 @@ table.tableblock pre code.language-bash.hljs {
10151029
font-size: var(--heading-h1-sm);
10161030
margin-bottom: 10px;
10171031
display: block;
1032+
line-height: 46px;
10181033
}
10191034

10201035
.doc h2 {

src/css/main.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ main {
66
main [id]::before {
77
content: "";
88
display: inherit;
9-
height: var(--height-to-body);
10-
margin-top: calc(-1 * var(--height-to-body));
9+
height: var(--h2-heading-top-space);
10+
margin-top: calc(-1 * var(--h2-heading-top-space));
1111
visibility: hidden;
1212
width: 0;
1313
}

src/css/table.css

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ table.tableblock > tbody th {
5858
display: block;
5959
border-bottom: 1px solid var(--color-brand-gray8);
6060
padding-left: var(--base-small-space);
61-
padding-top: var(--base-space);
61+
/* padding-top: var(--base-space); */
6262
padding-bottom: var(--base-space);
6363
}
6464

@@ -69,10 +69,14 @@ table.tableblock tbody td p {
6969
font-weight: var(--weight-medium);
7070
}
7171

72-
table.tableblock .content .paragraph,
72+
table.tableblock tbody td.tableblock p.tableblock {
73+
margin-top: 1rem;
74+
}
75+
76+
/* table.tableblock .content .paragraph,
7377
table.tableblock .content .ulist {
7478
margin-top: 0;
75-
}
79+
} */
7680

7781
/* table.tableblock tr:nth-child(odd) {
7882
background: rgba(0, 0, 0, 0.07);g29
@@ -105,6 +109,12 @@ table.table-tutorial tr td:last-child {
105109
background-color: var(--color-brand-gray7);
106110
}
107111

112+
.tableblock thead a,
113+
.tableblock tbody a,
114+
.tableblock p {
115+
font-family: inherit;
116+
}
117+
108118
/* Responsive css */
109119

110120
@media screen and (min-width: 768px) {
@@ -147,6 +157,7 @@ table.table-tutorial tr td:last-child {
147157
table.tableblock tbody td,
148158
table.tableblock > tbody th {
149159
display: table-cell;
160+
min-width: 5rem;
150161
}
151162

152163
table.tableblock td,

src/css/vars.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
--height-nav: calc(var(--height-min-body) + var(--height-spacer));
7474
--height-nav-with-version: calc(100vh - var(--height-to-body) - var(--height-version-control));
7575
--nav-menu-top-space: calc(var(--height-to-body) + var(--height-version-control));
76+
--h2-heading-top-space: calc(var(--height-to-body) + 0.5rem);
7677
/* --width-main-gutter: 1.5rem; */
7778
--width-main-gutter: 2.5rem;
7879
--width-container: 90rem;
@@ -110,7 +111,8 @@
110111
--heading-h1: 2.5rem; /* ~40px */
111112
--heading-h2: 2rem; /* ~32px */
112113
--heading-h3: 1.5rem; /* ~24px */
113-
--heading-h4: 1rem; /* ~16px */
114+
--heading-h4: 1.25rem; /* ~20px */
115+
--heading-h5: var(--font-base); /* ~16px */
114116

115117
/* line height */
116118
--line-height-body: 160%;

src/js/07-copy-to-clipboard.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@
2828
copyButton.addEventListener('click', function (e) {
2929
// NOTE: ignore event on pseudo-element
3030
if (e.currentTarget === e.target) return
31-
// for console text
32-
if (codeBlock.dataset.lang === 'console') {
33-
var bashText = codeBlock.innerText
34-
// remove $ from text
35-
navigator.clipboard.writeText(bashText.slice(2)).then(
31+
var bashText = codeBlock.innerText
32+
// bashText.slice(2)
33+
// remove '$' from copy to code functionality in code block console
34+
var spliceData = bashText.split('$').join('')
35+
if (codeBlock.dataset.lang === 'console' || bashText.includes('$')) {
36+
navigator.clipboard.writeText(spliceData).then(
3637
function () {
3738
/* Chrome doesn't seem to blur automatically,
3839
leaving the button in a focused state. */

src/partials/article.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<article class="doc">
22
{{#if page.title}}
3+
<div class="page-heading-title">
34
<h1 class="page">{{{page.title}}}</h1>
45
{{> labels}}
6+
</div>
57
{{/if}}
68
{{> contributor-bot}}
79
{{{page.contents}}}

src/partials/nav-version-control.hbs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
<img src="{{{uiRootPath}}}/img/server-icon.png" alt="">
99
</div>
1010
<div class="frame-body">
11-
<h4 class="title"><span class="title">{{{page.component.title}}}</span></h4>
11+
<h4 class="title">
12+
<span class="">
13+
{{{page.component.title}}}
14+
</span>
1215
<div class="frame-link-dropdowns">
1316
<a class="frame-link component" href="{{relativize page.componentVersion.url}}"><span class="version">{{page.componentVersion.displayVersion}}</span> <i class="fas fa-chevron-down"></i></a>
1417
<div class="frame-dropdown versions">
@@ -32,6 +35,8 @@
3235
</div>
3336
</div>
3437
</div>
38+
</h4>
39+
3540
</div>
3641
</div>
3742
{{else}}
@@ -40,7 +45,7 @@
4045
<img src="{{{uiRootPath}}}/img/server-icon.png" alt="">
4146
</div>
4247
<div class="frame-body">
43-
<h4 class="title"><span class="title">{{{page.component.title}}}</span></h4>
48+
<h4 class="title"><span class="">{{{page.component.title}}}</span></h4>
4449
<a class="navbar-item component" href="{{relativize page.componentVersion.url}}">{{#unless (eq page.componentVersion.displayVersion 'master')}} <span class="version">{{page.componentVersion.displayVersion}}</span>{{/unless}}</a>
4550
</div>
4651
</div>

0 commit comments

Comments
 (0)