Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dark mode #158

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ a {
color: #E63054;
}

@media (prefers-color-scheme: dark) {
a {
color: #eb4444;
}
}

.red-1 {
color: #E63054;
}
Expand Down Expand Up @@ -359,6 +365,13 @@ code {
color: brown;
}

@media (prefers-color-scheme: dark) {
code {
font-size: 0.85em;
color: tan;
}
}

pre code {
color: inherit;
}
Expand Down
Binary file added assets/images/hero_image_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
195 changes: 195 additions & 0 deletions assets/images/hero_image_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo/large_logo_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{{ template "_internal/opengraph.html" . }}
</head>

<body>
<body class="bg-white dark:bg-sky-800 text-black dark:text-neutral-200">
<div class="h-screen w-screen">
{{ partial "nav" . }}

Expand Down
4 changes: 2 additions & 2 deletions layouts/blog/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!--Image and content preview starts here-->

<a href="{{ .RelPermalink }}">
<div class="charcoal">
<div class="text-zinc-900 dark:text-zinc-300">
<dl>
<dt class="text-3xl my-5 font-bold">{{ .Title }}</dt>
<div class="flex text-xs gap-1.5">
Expand All @@ -32,7 +32,7 @@
<!--CTA-->
<div class="pt-10">
<a href="{{ .RelPermalink }}"
class="bg-rose-600 py-4 px-12 rounded-full text-white text-xl">Continue Reading</a>
class="bg-rose-600 dark:bg-rose-800 py-4 px-12 rounded-full text-white text-xl">Continue Reading</a>
</div>
<!--CTA-->
</a>
Expand Down
6 changes: 3 additions & 3 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<section>

<!-- Cards start here-->
<div class="w-full grid grid-cols-1 md:grid-cols-3 text-white bg-red-1 md:px-36 md:py-12 py-8">
<div class="w-full grid grid-cols-1 md:grid-cols-3 text-white bg-red-600 dark:bg-red-800 md:px-36 md:py-12 py-8">
{{ range where .Site.Pages "Params.type" "card" }}
{{ partial "card" . }}
{{ end }}
Expand All @@ -32,7 +32,7 @@ <h1 class="md:text-xl text-white text-base">This open source project has been or
<div class="mx-auto md:py-24 md:px-56 px-4 py-8">
<hr>
</div>
<h1 class="md:text-5xl font-bold red-1 leading-10 md:pt-4 text-3xl">100%</h1>
<h1 class="md:text-5xl font-bold text-red-600 dark:text-red-800 leading-10 md:pt-4 text-3xl">100%</h1>
<h1 class="md:text-5xl font-bold text-white leading-10 md:pt-4 text-3xl">Open Source</h1>
<p class="md:text-xl text-white md:w-2/5 mx-auto mt-10 text-lg px-4">
CloudNativePG is 100% open source and community-driven.
Expand All @@ -45,7 +45,7 @@ <h1 class="md:text-5xl font-bold text-white leading-10 md:pt-4 text-3xl">Open So

<div class="text-center pt-24">
<a href="https://github.com/cloudnative-pg/cloudnative-pg"
class="bg-red-1 py-4 px-12 rounded-full text-white text-xl">View on GitHub</a>
class="bg-red-600 dark:bg-red-800 py-4 px-12 rounded-full text-white text-xl">View on GitHub</a>
</div>
</section>
{{ end }}
4 changes: 2 additions & 2 deletions layouts/page/styleguide.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1 class="h2 cnp-blue">Color Palette</h1>
<!--Tile 1 start here-->
<div class="p-4 bg-white drop-shadow-md rounded-md border-2 border-slate-50 w-36">
<div>
<div class="bg-red-1 w-28 h-32 rounded-lg"></div>
<div class="bg-red-600 dark:bg-red-800 w-28 h-32 rounded-lg"></div>
<div class="pt-2"><h1>Red 1 - #E63054</h1></div>
</div>
</div>
Expand Down Expand Up @@ -75,7 +75,7 @@ <h1 class="h2 cnp-blue">Color Palette</h1>
<!--Tile 2 start here-->
<div class="p-4 bg-white drop-shadow-md rounded-md border-2 border-slate-50 w-36">
<div>
<div class="bg-gray-4 w-28 h-32 rounded-lg"></div>
<div class="bg-gray-800 dark:bg-gray-300 w-28 h-32 rounded-lg"></div>
<div class="pt-2"><h1>Gray 4 -#212C31</h1></div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>
<div>
<div>
<h1 class="text-lg charcoal font-bold">
<h1 class="text-lg text-zinc-900 dark:text-zinc-300 font-bold">
<a href="/authors/{{ .Params.author }}">{{$author.Params.name}}</a>
</h1>
</div>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/author_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>
<div class="my-auto">
<div>
<h1 class="text-lg charcoal font-bold">
<h1 class="text-lg text-zinc-900 dark:text-zinc-300 font-bold">
{{$author.Params.name}}
</h1>
</div>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/blog_datetime.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="flex gap-2 text-sm charcoal opacity-75">
<h6 class="flex gap-2 text-sm charcoal">
<div class="flex gap-2 text-sm text-zinc-900 dark:text-zinc-300 opacity-75">
<h6 class="flex gap-2 text-sm text-zinc-900 dark:text-zinc-300">
{{ .PublishDate.Format "January 2, 2006" }}
{{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/blog_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h3 class="text-xl font-bold pb-6 px-4">Latest Posts</h3>
<div class="space-y-10 px-4">
<!--card 1 starts here-->
{{ range first 6 (.Site.GetPage "/blog").Pages}}
<div class="p-8 bg-white drop-shadow-md md:w-2/6 rounded-md border-2 border-slate-50 align-super inline-grid max-w-xs"
<div class="p-8 bg-white dark:bg-sky-800 text-black dark:text-neutral-200 drop-shadow-md md:w-2/6 rounded-md border-2 border-slate-50 dark:border-bg-slate-500 align-super inline-grid max-w-xs"
style="min-width: 260px;">
<!--User profile-->
<div class="flex gap-3 mb-2.5">
Expand All @@ -38,7 +38,7 @@ <h3 class="text-xl font-bold pb-6 px-4">Latest Posts</h3>
<img src="{{ .RelPermalink }}/{{ .Params.image.url }}" class="object-fill"
alt="Blog image">
</div>
<div class="charcoal">
<div class="text-zinc-900 dark:text-zinc-300">
<h2 class="text-lg my-2.5 font-bold">{{.Title}}</h2>
</div>
<!--Blog image and content preview-->
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<footer class="text-center pb-24">
<p class="text-sm charcoal md:w-1/2 mx-auto md:pt-10 px-6 pt-12">
<p class="text-sm text-zinc-900 dark:text-zinc-300 md:w-1/2 mx-auto md:pt-10 px-6 pt-12">

&copy; The CloudNativePG Contributors.<br />

<a href="https://www.linuxfoundation.org/trademark-usage/"
class="red-1">The Linux Foundation has registered trademarks and uses
class="text-red-600 dark:text-red-800 ">The Linux Foundation has registered trademarks and uses
trademarks</a>.<br />

<a href="https://www.postgresql.org/about/policies/trademarks"
class="red-1">Postgres, PostgreSQL and the Slonik Logo are trademarks or
class="text-red-600 dark:text-red-800">Postgres, PostgreSQL and the Slonik Logo are trademarks or
registered trademarks of the PostgreSQL Community Association of Canada, and
used with their permission</a>.

Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/hero.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<div class="md:flex md:flex-row px-4 md:px-56 md:justify-between place-content-center">
<div class="md:w-1/2">
<h1 class="md:text-6xl font-bold cnp-blue text-3xl md:text-left text-center">{{.Title}}</h1>
<h1 class="md:text-6xl font-bold red-1 pt-2.5 text-3xl md:text-left text-center">{{.Params.subtitle}}</h1>
<p class=" gray-4 text-xl md:text-2xl font-light leading-10 py-5 container md:tracking-wider">
<h1 class="md:text-6xl font-bold text-red-600 dark:text-red-800 pt-2.5 text-3xl md:text-left text-center">{{.Params.subtitle}}</h1>
<p class=" text-gray-800 dark:text-gray-300 text-xl md:text-2xl font-light leading-10 py-5 container md:tracking-wider">
{{ .Content | plainify }}
</p>
<div class="pt-7 md:text-left text-center">
<a href="{{.Params.cta.url}}"
class="md:text-3xl bg-red-1 py-4 px-12 rounded-full text-white text-xl">{{.Params.cta.content| plainify}}</a>
class="md:text-3xl bg-red-600 dark:bg-red-800 py-4 px-12 rounded-full text-white text-xl">{{.Params.cta.content| plainify}}</a>
</div>
</div>
<div class="md:ml-8 hidden md:block">
{{ $image := resources.Get "images/hero_image.svg" }}
{{ $image := resources.Get "/images/hero_image.svg" }}
<img src="{{ $image.RelPermalink }}" alt="hero image" class="mx-auto">
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/info.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ if modBool .i 2 }}

<div class="w-full bg-gray-1 py-16 md:px-56 px-4">
<div class="w-full bg-gray-100 dark:bg-sky-700 py-16 md:px-56 px-4">
<section class="container mx-auto text-left md:flex md:flex-row md:justify-between">
<div class="md:block mx-auto my-auto hidden">
<img src="{{ .context.Params.icon }}" alt="{{.context.Title}}" />
Expand All @@ -10,16 +10,16 @@
</div>
<div class="md:w-3/5 md:block">
<h1 class="md:text-3xl py-4 font-medium cnp-blue text-2xl md:text-left text-center">{{ .context.Title }}</h1>
<p class="md:text-xl leading-8 gray-4 text-lg">{{ .context.Content }}</p>
<p class="md:text-xl leading-8 text-gray-800 dark:text-gray-300 text-lg">{{ .context.Content }}</p>
</div>
</section>
</div>
{{ else }}
<div class="md:block hidden w-full bg-white py-16 md:px-56">
<div class="md:block hidden w-full bg-white dark:bg-sky-800 text-black dark:text-neutral-200 py-16 md:px-56">
<section class="container mx-auto text-left md:flex md:flex-row md:justify-between">
<div class="md:w-3/5">
<h1 class="md:text-3xl py-4 font-medium cnp-blue text-2xl">{{ .context.Title }}</h1>
<p class="md:text-xl leading-8 gray-4 text-lg">{{ .context.Content }}</p>
<p class="md:text-xl leading-8 text-gray-800 dark:text-gray-300 text-lg">{{ .context.Content }}</p>
</div>
<div class="items-center my-auto mx-auto">
<img src="{{ .context.Params.icon }}" alt="{{.context.Title}}" class="mx-auto" />
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
</ul>
</div>
<!--For hamburger click-->
<div class="py-4 bg-gray-1 mt-5 hidden" id="navi-list">
<ul class="md:flex gap-14 text-2xl md:medium-gray charcoal">
<div class="py-4 bg-gray-100 dark:bg-sky-700 mt-5 hidden" id="navi-list">
<ul class="md:flex gap-14 text-2xl md:medium-gray text-zinc-900 dark:text-zinc-300">
<li class="text-center py-4"><a href="/docs">Documentation</a></li>
<li class="text-center py-4"><a href="/blog">Blog</a></li>
<li class="text-center py-4"><a href="/support">Support</a></li>
<li class="text-center py-4"><a href="/end_users">End Users</a></li>
</ul>
<div class="flex gap-3 py-4 justify-center bg-gray-1 fill-cnp-blue">
<div class="flex gap-3 py-4 justify-center bg-gray-100 dark:bg-sky-700 fill-cnp-blue">
<a href="https://github.com/cloudnative-pg/cloudnative-pg">
<img src="/icons/Git.svg" alt="Github">
</a>
Expand Down