Skip to content

Commit 6b2cd8e

Browse files
Merge pull request #4393 from platformsh/4389-docs-improvments---css
4389 docs improvments css
2 parents 7ff56af + 55dfa3c commit 6b2cd8e

File tree

8 files changed

+65
-40
lines changed

8 files changed

+65
-40
lines changed

sites/upsun/static/scripts/xss/src/containers/Search.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ const Search = ({ fullPage }) => {
131131
<input
132132
id={`searchwicon-${fullPage ? 'fullpage' : 'header'}`}
133133
value={query}
134-
placeholder="What are you looking for?"
134+
placeholder="Can we help you find something?"
135135
onChange={handleInputChange}
136-
className={`bg-no-repeat bg-[length:15px_15px] bg-left-4 h-16 w-full pl-12 text-slate border-none focus-visible:outline-none ${fullPage ? 'bg-grey' : ''}`}
136+
className={`bg-no-repeat bg-[length:15px_15px] bg-left-4 h-16 w-full pl-12 text-slate rounded border-none focus-visible:outline-none ${fullPage ? 'bg-grey' : ''}`}
137137
style={{ 'background-image': 'url(/images/svg/search-solid.svg)' }}
138138
autoComplete="off"
139139
/>

themes/psh-docs/layouts/_default/_markup/render-codeblock.html

+10-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
{{ $configFiles := .Page.Site.Params.vendor.config.files }}
1111
{{ $configDir := .Page.Site.Params.vendor.config.dir }}
1212

13+
<div class="relative">
1314
{{ with $location }}
1415
{{ $fullFile := . }}
1516
{{ $prefixLen := len $prefixdir }}
@@ -18,15 +19,21 @@
1819
{{ else if gt $prefixLen 0 }}
1920
{{ $fullFile = delimit ( slice $prefixdir . ) "/" }}
2021
{{ end }}
21-
<div class="bg-stone px-4 pt-2 rounded-t-lg inline-block text-base pb-1">{{ $fullFile }}</div>
22+
<div class="bg-stone px-4 pt-2 rounded-t-lg inline-block text-base relative">
23+
<span class="relative z-10">{{ $fullFile }}</span>
24+
<div class="absolute bottom-[-0.5rem] left-0 w-full h-4 bg-stone"></div>
25+
</div>
2226
{{ end }}
2327
{{ with $configFile }}
2428
{{ $fullFile := index $configFiles . }}
2529
{{ $prefixLen := len $prefixdir }}
2630
{{ if gt $prefixLen 0 }}
2731
{{ $fullFile = delimit ( slice $prefixdir (index $configFiles .) ) "/" }}
2832
{{ end }}
29-
<div class="bg-stone px-4 pt-2 rounded-t-lg inline-block text-base pb-1">{{ $fullFile }}</div>
33+
<div class="bg-stone px-4 pt-2 rounded-t-lg inline-block text-base relative">
34+
<span class="relative z-10">{{ $fullFile }}</span>
35+
<div class="absolute bottom-[-0.5rem] left-0 w-full h-4 bg-stone"></div>
36+
</div>
3037
{{ end }}
3138
{{ if transform.CanHighlight $lang }}
3239
{{ $content := .Inner | safeHTML }}
@@ -45,5 +52,6 @@
4552
{{ else }}
4653
<pre><code>{{ .Inner }}</code></pre>
4754
{{ end }}
55+
</div>
4856

4957
{{ end }}

themes/psh-docs/layouts/_default/baseof.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
{{ partial "sidebar/sidebar" . }}
4040

4141
<!-- Main content block -->
42-
<main class="md:col-span-8 xl:max-w-[120ch] xl:text-lg px-4 md:px-8 pt-4 pb-12 print:border-none print:max-w-full xl:print:max-w-full print:text-sm xl:print:text-sm">
42+
<main class="md:col-span-8 xl:max-w-[120ch] xl:text-lg px-4 md:pr-0 md:pl-8 pt-4 pb-12 print:border-none print:max-w-full xl:print:max-w-full print:text-sm xl:print:text-sm">
4343

4444
{{- block "main" . }}{{- end }}
4545
</main>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<!-- Edit page button link -->
2-
<div class="mb-6">
2+
<div class="hidden md:block mb-6 mr-2 text-right">
33
{{ $editLocation := printf "%sedit/main/%s/src/%s" site.Params.repo site.Params.folder .File.Path }}
4-
<a href="{{ $editLocation }}" rel="noopener" class="print:hidden text-sm {{ partial "pink-button-styles" }}">
5-
Edit page <img class="inline" aria-hidden="true" alt="" src="/images/icons/chevrons.svg" />
4+
<a href="{{ $editLocation }}" rel="noopener" class="print:hidden font-semibold bg-gray-400 text-white hover:bg-ebony focus:bg-ebony pl-4 pr-3 py-2 font-['Space_Grotesk'] text-xs rounded-full inline-flex items-center gap-2">
5+
6+
Edit page<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="inline">
7+
<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/>
8+
<path d="m15 5 4 4"/>
9+
</svg>
610
</a>
711
</div>

themes/psh-docs/layouts/partials/feedback/form.html

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<div class="p-4" x-data="FeedbackForm()">
22
<h3 class="pt-4 pb-2 font-light">Is this page helpful?</h3>
33
<div class="text-sm">
4-
<button x-show="!feedbackSubmitted" @click="handleClick" title="Yes" class="py-4 px-4 hover:bg-skye-light text-xl">
5-
👍️
4+
<button x-show="!feedbackSubmitted" @click="handleClick" title="Yes" class="py-2 px-4 hover:bg-skye-light text-xl">
5+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
6+
<path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"/>
7+
</svg>
68
</button>
7-
<button x-show="!feedbackSubmitted" @click="handleClick" title="No" class="py-4 px-4 hover:bg-skye-light text-xl">
8-
👎️
9+
<button x-show="!feedbackSubmitted" @click="handleClick" title="No" class="py-2 px-4 hover:bg-skye-light text-xl">
10+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
11+
<path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"/>
12+
</svg>
913
</button>
1014
<div
1115
x-show="feedbackSubmitted && feedback === 'positive'"
@@ -48,7 +52,9 @@ <h3 class="pt-4 pb-2 font-light">Is this page helpful?</h3>
4852
"&title=%F0%9F%90%9B%20Issue%20on%20the%20page%20" +
4953
document.title.replace({{ printf " · %s Documentation" .Site.Params.vendor.name }}, ""),
5054
handleClick(event) {
51-
const title = event.target.getAttribute("title");
55+
// Get the closest button element from the click target
56+
const button = event.target.closest('button');
57+
const title = button ? button.getAttribute("title") : null;
5258

5359
if (title === "Yes") this.feedback = "positive";
5460
else if (title === "No") this.feedback = "negative";

themes/psh-docs/layouts/partials/note.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{{- $bg = "skye-light" -}}
1414
{{- end -}}
1515
{{- end -}}
16-
<div class="bg-{{ $bg }} p-4 mb-4 [&>p:last-child]:mb-0 [&>h3]:mt-0" role="alert" {{if eq .theme "info-sticky"}}style="position: sticky; top: 6rem;"{{ end }}>
16+
<div class="bg-{{ $bg }} p-4 mb-4 [&>p:last-child]:mb-0 [&>h3]:mt-0 rounded-lg" role="alert" {{if eq .theme "info-sticky"}}style="position: sticky; top: 6rem;"{{ end }}>
1717
{{- if ne $title "none" -}}
1818
<h3 class="font-bold text-base">{{ $title }}</h3>
1919
{{- end -}}

themes/psh-docs/layouts/partials/page-content.html

+21-14
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
<h1 class="font-black text-2xl mb-8 xl:text-4xl">{{ .context.Title | .context.RenderString }}</h1>
2828
{{ end }}
2929

30-
<div class="grid md:grid-cols-80-20 md:gap-4 print:block">
30+
<div class="grid md:grid-cols-[minmax(0,1fr),270px] md:gap-4 md:pr-4 print:block">
3131

32-
<div class="print:hidden max-w-[92vw] md:max-w-none md:order-2 md:top-24 md:sticky md:max-h-fullv md:overflow-y-auto border-t border-stone">
32+
<div class="print:hidden max-w-[92vw] md:max-w-none md:order-2 md:top-24 md:sticky md:h-[calc(100vh-6rem)] md:overflow-y-auto border-t border-stone">
3333
<!-- Table of contents -->
3434
{{ if and (ne .context.Params.toc false) (ne .context.TableOfContents "<nav id=\"TableOfContents\"></nav>") }}
35-
<div class="border border-stone border-t-0 px-6 pt-1 pb-4 mb-8 md:mb-0 text-sm [&_a]:text-skye-dark hover:[&_a]:underline focus:[&_a]:underline [&_ul_ul]:pl-4">
35+
<div class="border border-stone border-t-0 px-6 pt-1 pb-4 mb-8 md:mb-0 text-sm [&_a]:text-skye-dark hover:[&_a]:underline focus:[&_a]:underline [&_ul_ul]:pl-4 [&_nav_ul>li]:mb-2 [&_nav_ul_ul>li]:mt-2">
3636

3737
{{ if not .context.Page.IsHome }}
3838
<h3 class="pt-4 pb-2 font-light text-base text-slate"><a href="/">Back to home</a></h3>
@@ -57,7 +57,7 @@ <h3 class="pt-4 pb-2 font-light text-base text-slate">On this page</h3>
5757
{{ end }}
5858

5959
<div
60-
class="bg-gradient-to-b from-[#FF4A11] from-0% via-[#ED49F0] via-45% to-[#DDF933] to-100% rounded-2xl p-[1px] my-1">
60+
class="bg-gradient-to-b from-[#FF4A11] from-0% via-[#ED49F0] via-45% to-[#DDF933] to-100% rounded-2xl p-[1px] mt-1 mb-4">
6161
<div class="rounded-2xl p-5 bg-[#f9f9f9] flex-col justify-start items-start gap-4 inline-flex">
6262
{{ $recruitment := .context.Site.Params.vendor.recruit }}
6363
{{ $vendorName := .context.Site.Params.vendor.name }}
@@ -89,21 +89,22 @@ <h3 class="pt-4 pb-2 font-light text-base text-slate">On this page</h3>
8989
<div class="cta-body">
9090
{{ index $recruitment "description"}}
9191
</div>
92-
<div class="cta-terms">
93-
{{ index $recruitment "fine" }}
94-
</div>
92+
9593
</div>
9694
</div>
9795
<a href="{{ index $recruitment "link" }}" class="px-6 py-2 bg-[#6046FF] hover:!bg-[#4D38CC] rounded-3xl text-white text-center text-sm font-semibold">
9896
{{ index $recruitment "cta" }}
9997
</a>
98+
<div class="cta-terms">
99+
{{ index $recruitment "fine" }}
100+
</div>
100101
</div>
101102
</div>
102103
{{ end }}
103104

104105
</div>
105106

106-
<div class="prose xl:prose-lg max-w-[96vw] md:max-w-none prose-code:!mb-0 prose-h2:text-xl prose-h3:text-xl prose-h4:text-lg">
107+
<div class="prose xl:prose-lg max-w-[96vw] md:max-w-full w-full prose-code:!mb-0 prose-h2:text-xl prose-h3:text-xl prose-h4:text-lg">
107108
<!-- Add the stack picker for Get started section -->
108109
{{ if and ( eq .context.Section "get-started" ) ( ne .context.Title "Introduction" ) }}
109110
{{ if eq $.Site.Params.vendor.name "Platform.sh" }}
@@ -116,12 +117,18 @@ <h3 class="pt-4 pb-2 font-light text-base text-slate">On this page</h3>
116117

117118
<!-- If the page is a list page, add section cards -->
118119
{{ if .isList }}
119-
{{ range .context.Pages }}
120-
<button onclick="location.href = '{{ .RelPermalink }}';" class="block text-left mb-7 p-8 text-primary-darker border-l-4 border-skye-dark hover:no-underline bg-stone hover:bg-skye-dark hover:text-white focus:bg-skye-dark focus:text-white hover:cursor-pointer [&:hover_a]:text-snow [&:focus_a]:text-snow [&:hover_a]:font-extrabold [&:focus_a]:font-extrabold">
121-
<span class="block font-bold mb-4">{{ if isset .Params "sidebartitle" }}{{ .Params.sidebarTitle | .RenderString }}{{ else }}{{ .Title | .RenderString }}{{ end }}</span>
122-
<span class="block">{{ .Params.description | .RenderString }}</span>
123-
</button>
124-
{{ end }}
120+
<div class="space-y-4 not-prose">
121+
{{ range .context.Pages }}
122+
<a href="{{ .RelPermalink }}" class="block p-[2px] bg-stone hover:bg-skye-dark rounded-xl transition-all">
123+
<div class="p-8 bg-white rounded-xl h-full hover:shadow-lg">
124+
<h3 class="text-xl font-medium mb-2 text-gray-900">
125+
{{ if isset .Params "sidebartitle" }}{{ .Params.sidebarTitle | .RenderString }}{{ else }}{{ .Title | .RenderString }}{{ end }}
126+
</h3>
127+
<p class="text-gray-600 m-0">{{ .Params.description | .RenderString }}</p>
128+
</div>
129+
</a>
130+
{{ end }}
131+
</div>
125132
{{ end }}
126133

127134
{{ if .context.Params.related }}

themes/psh-docs/layouts/shortcodes/guide-buttons.html

+12-12
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,30 @@
3636

3737
{{ if $prevLink }}
3838
<!-- Back button -->
39-
<a href="{{ ref . $prevLink }}" type="button" class="p-2 text-ebony hover:no-underline font-mono">
40-
<img class="inline rotate-180" aria-hidden="true" alt="" src="/images/icons/chevrons.svg" />
39+
<a href="{{ ref . $prevLink }}" type="button" class="font-semibold text-sm xl:text-base pr-4 pl-2 py-2 rounded-full text-white hover:bg-skye-light focus:bg-skye-light">
40+
<svg class="inline rotate-90" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true">{{ readFile "layouts/shortcodes/icon-paths/chevron.html" | safeHTML }}</svg>
4141
{{ if $previous }}{{ $previous }}{{ else }}{{ .Page.NextInSection.LinkTitle }}{{ end }}
4242
</a>
4343
{{ else if or (.Page.NextInSection) ($previous) }}
4444
<!-- Back button -->
45-
<a href="{{ if .Page.NextInSection }}{{ .Page.NextInSection.RelPermalink }}{{ else }}{{ .Page.CurrentSection.RelPermalink }}{{ end }}" type="button" class="p-2 text-ebony hover:no-underline font-mono">
46-
<img class="inline rotate-180" aria-hidden="true" alt="" src="/images/icons/chevrons.svg" />
45+
<a href="{{ if .Page.NextInSection }}{{ .Page.NextInSection.RelPermalink }}{{ else }}{{ .Page.CurrentSection.RelPermalink }}{{ end }}" type="button" class="font-semibold text-sm xl:text-base pr-4 pl-2 py-2 rounded-full text-white hover:bg-skye-light focus:bg-skye-light">
46+
<svg class="inline rotate-90" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true">{{ readFile "layouts/shortcodes/icon-paths/chevron.html" | safeHTML }}</svg>
4747
{{ if $previous }}{{ $previous }}{{ else }}{{ .Page.NextInSection.LinkTitle }}{{ end }}
4848
</a>
4949
{{ end }}
5050

5151
{{ if $nextLink }}
5252
<!-- Next button -->
53-
<a href="{{ ref . $nextLink }}" type="button" class="{{ partial "pink-button-styles" }}">
53+
<a href="{{ ref . $nextLink }}" class="font-semibold text-sm xl:text-base pl-4 pr-2 py-2 bg-[#6046FF] hover:!bg-[#4D38CC] rounded-full !text-white hover:!text-white inline-flex items-center gap-2">
5454
{{ if $next }}{{ $next }}{{ else }}{{ .Page.PrevInSection.LinkTitle }}{{ end }}
55-
<img class="inline" aria-hidden="true" alt="" src="/images/icons/chevrons.svg" />
55+
<svg class="inline -rotate-90" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true">{{ readFile "layouts/shortcodes/icon-paths/chevron.html" | safeHTML }}</svg>
5656
</a>
5757

5858
{{ else if .Page.PrevInSection }}
5959
<!-- Next button -->
60-
<a href="{{ if .Page.PrevInSection }}{{ .Page.PrevInSection.RelPermalink }}{{ else }}{{ .Page.CurrentSection.RelPermalink }}{{ end }}" type="button" class="{{ partial "pink-button-styles" }}">
60+
<a href="{{ if .Page.PrevInSection }}{{ .Page.PrevInSection.RelPermalink }}{{ else }}{{ .Page.CurrentSection.RelPermalink }}{{ end }}" class="font-semibold text-sm xl:text-base pl-4 pr-2 py-2 bg-[#6046FF] hover:!bg-[#4D38CC] rounded-full !text-white hover:!text-white inline-flex items-center gap-2">
6161
{{ if $next }}{{ $next }}{{ else }}{{ .Page.PrevInSection.LinkTitle }}{{ end }}
62-
<img class="inline" aria-hidden="true" alt="" src="/images/icons/chevrons.svg" />
62+
<svg class="inline -rotate-90" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true">{{ readFile "layouts/shortcodes/icon-paths/chevron.html" | safeHTML }}</svg>
6363
</a>
6464
{{ end }}
6565

@@ -68,8 +68,8 @@
6868

6969
<!-- Only contains a back button -->
7070
{{ if eq $navType "last" }}
71-
<a href="{{ if .Page.NextInSection }}{{ .Page.NextInSection.RelPermalink }}{{ else }}{{ .Page.CurrentSection.RelPermalink }}{{ end }}" type="button" class="p-2 text-ebony hover:no-underline font-mono">
72-
<img class="inline rotate-180" aria-hidden="true" alt="" src="/images/icons/chevrons.svg" />
71+
<a href="{{ if .Page.NextInSection }}{{ .Page.NextInSection.RelPermalink }}{{ else }}{{ .Page.CurrentSection.RelPermalink }}{{ end }}" type="button" class="font-semibold text-sm xl:text-base px-4 py-2 rounded text-white hover:bg-skye-light focus:bg-skye-light">
72+
<svg class="inline rotate-90" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true">{{ readFile "layouts/shortcodes/icon-paths/chevron.html" | safeHTML }}</svg>
7373
Back
7474
</a>
7575

@@ -83,9 +83,9 @@
8383
{{ $loop = 1}}
8484
{{ end }}
8585
{{ end }}
86-
<a href="{{ $firstPageInSection.RelPermalink }}" type="button" class="{{ partial "pink-button-styles" }}">
86+
<a href="{{ $firstPageInSection.RelPermalink }}" class="font-semibold text-sm xl:text-base px-4 py-2 bg-skye rounded !text-white hover:!text-white hover:!bg-skye-dark focus:!bg-skye-dark inline-flex items-center gap-2">
8787
{{ with .Get "next" }}{{ . | $pageContext.RenderString }}{{ end }}
88-
<img class="inline" aria-hidden="true" alt="" src="/images/icons/chevrons.svg" />
88+
<svg class="inline -rotate-90" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true">{{ readFile "layouts/shortcodes/icon-paths/chevron.html" | safeHTML }}</svg>
8989
</a>
9090
{{ end }}
9191

0 commit comments

Comments
 (0)