feat: Update design black

This commit is contained in:
Simon 2023-05-23 23:41:55 +02:00
parent 859eaccd6e
commit b97920e51e
5 changed files with 237 additions and 195 deletions

View File

@ -2,6 +2,8 @@
@import "bootstrap/scss/functions"; @import "bootstrap/scss/functions";
/** Import theme variables */ /** Import theme variables */
$primary: #42b883;
$link-color-dark: $primary;
@import "common/variables"; @import "common/variables";
/** Import Bootstrap */ /** Import Bootstrap */

View File

@ -1,191 +0,0 @@
// Color system
$white: #fff;
$gray-100: #f8f9fa;
$gray-200: #e9ecef;
$gray-300: #dee2e6;
$gray-400: #ced4da;
$gray-500: #adb5bd;
$gray-600: #6c757d;
$gray-700: #495057;
$gray-800: #343a40;
$gray-900: #212529;
$black: #000;
$yellow: #ffe000;
$black: #1d2d35;
$beige: #fbf7f0;
$red: #e55235;
$purple: #5d2f86;
$brown: #aa9c84;
$green: #42b883;
$blue-300: #8ed6fb;
$pink-100: #fcfaff;
$pink-500: #d32e9d;
$primary: $green;
$color-btn-bg: $pink-500;
$color-btn-border: darken($pink-500, 5%);
$color-btn-text: $white;
// Options
//
// Quickly modify global styling by enabling or disabling optional features.
$enable-caret: true;
$enable-rounded: true;
$enable-shadows: false;
$enable-gradients: false;
$enable-transitions: true;
$enable-reduced-motion: true;
$enable-smooth-scroll: true;
$enable-grid-classes: true;
$enable-button-pointers: true;
$enable-rfs: true;
$enable-validation-icons: true;
$enable-negative-margins: true;
$enable-deprecation-messages: true;
$enable-important-utilities: true;
/** Bootstrap navbar fix (https://git.io/fADqW) */
$navbar-dark-toggler-icon-bg: none;
$navbar-light-toggler-icon-bg: none;
// Options
//
// Quickly modify global styling by enabling or disabling optional features.
// $enable-responsive-font-sizes: true;
// Body
//
// Settings for the `<body>` element.
$body-bg: $white;
$body-color: $black;
// Links
//
// Style anchor elements.
$link-color: $primary;
$link-decoration: none;
// Grid containers
//
// Define the maximum width of `.container` for different screen sizes.
$container-max-widths: (
sm: 540px,
md: 720px,
lg: 960px,
xl: 1240px,
xxl: 1320px
);
@include _assert-ascending($container-max-widths, "$container-max-widths");
// Grid columns
//
// Set the number of columns and specify the width of the gutters.
$grid-columns: 16;
$grid-gutter-width: 48px;
$grid-row-columns: 6;
// Components
//
// Define common padding and border radius sizes and more.
$border-color: $gray-200;
// Typography
//
// Font, line-height, and color for body text, headings, and more.
// stylelint-disable value-keyword-case
$font-family-sans-serif: "Jost", -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
$font-family-monospace: sfmono-regular, menlo, monaco, consolas, "Liberation Mono", "Courier New", monospace;
$font-family-base: $font-family-sans-serif;
// stylelint-enable value-keyword-case
$font-size-base: 1rem; // Assumes the browser default, typically `16px`
$font-size-xl: $font-size-base * 1.375;
$font-size-lg: $font-size-base * 1.25;
$font-size-md: $font-size-base * 1.125;
$font-size-sm: $font-size-base * 0.875;
// $line-height-base: 1.5;
$headings-font-family: null;
$headings-font-weight: 700;
$lead-font-weight: 400;
// Spacing
//
// Control the default styling of most Bootstrap elements by modifying these
// variables. Mostly focused on spacing.
// You can add more entries to the $spacers map, should you need more variation.
$spacer: 1rem;
// Navbar
$navbar-padding-y: $spacer / 2;
$navbar-padding-x: null;
$navbar-nav-link-padding-x: 0.5rem;
$navbar-light-color: $black;
$navbar-light-hover-color: $primary;
$navbar-light-active-color: $primary;
// Cards
$card-border-color: $gray-200;
// Alerts
//
// Define alert colors, border radius, and padding.
$alert-padding-y: $spacer;
$alert-padding-x: $spacer * 1.5;
$alert-margin-bottom: 0;
$alert-border-radius: 0;
$alert-link-font-weight: $headings-font-weight;
$alert-border-width: 0;
$alert-bg-scale: 0;
$alert-border-scale: 0;
$alert-color-scale: 0;
// docsearch
$dropdown-config: (
main-color: $primary,
layout-type: normal,
layout-width: normal,
layout-alignment: align,
background-color: $white,
border-radius: 4,
border-width: 1,
border-color: $gray-200,
box-shadow: none,
branding-position: bottom,
spacing: normal,
include-desc: yes,
background-category-header: $white,
font-size: normal,
header-color: $black,
title-color: $black,
subtitle-color: $black,
text-color: $black,
highlight-color: $primary,
highlight-opacity: 0.1,
highlight-type: underline
);
$input-btn-focus-width: 0;

View File

@ -3,10 +3,6 @@
min = "0.80.0" min = "0.80.0"
max = "" max = ""
[[mounts]]
source = "assets"
target = "assets"
[[mounts]] [[mounts]]
source = "node_modules/@hyas/doks/archetypes" source = "node_modules/@hyas/doks/archetypes"
target = "archetypes" target = "archetypes"
@ -15,6 +11,10 @@
source = "node_modules/@hyas/doks/assets" source = "node_modules/@hyas/doks/assets"
target = "assets" target = "assets"
[[mounts]]
source = "assets"
target = "assets"
# [[mounts]] # [[mounts]]
# source = "node_modules/@hyas/doks/content" # source = "node_modules/@hyas/doks/content"
# target = "content" # target = "content"

View File

@ -0,0 +1,32 @@
<!doctype html>
<html data-dark-mode="" lang="{{ .Site.Params.languageTag | default "en-US" }}">
{{ partial "head/head.html" . }}
{{ if eq .Kind "home" -}}
{{ .Scratch.Set "class" "home" -}}
{{ else if eq .Kind "404" -}}
{{ .Scratch.Set "class" "error404" -}}
{{ else if eq .Kind "page" -}}
{{ .Scratch.Set "class" .Type -}}
{{ .Scratch.Add "class" " single" -}}
{{ else -}}
{{ .Scratch.Set "class" .Type -}}
{{ .Scratch.Add "class" " list" -}}
{{ end -}}
<body class="{{ .Scratch.Get "class" }}"{{ if eq .Site.Params.options.scrollSpy true }} data-bs-spy="scroll" data-bs-target="#toc" data-bs-root-margin="0px 0px -90%" data-bs-smooth-scroll="true" tabindex="0"{{ end }}>
{{ partial "header/header.html" . }}
<div class="wrap container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }}" role="document">
<div class="content">
{{ block "main" . }}{{ end }}
</div>
</div>
{{ block "sidebar-prefooter" . }}{{ end }}
{{ block "sidebar-footer" . }}{{ end }}
{{ partial "footer/footer.html" . }}
{{ partial "footer/script-footer.html" . }}
{{ if eq .Site.Params.options.toTopButton true -}}
<div class="d-flex fixed-bottom pb-4 pb-lg-5 pe-4 pe-lg-5">
<a id="toTop" href="#" class="btn btn-outline-primary rounded-circle ms-auto p-2"><span class="visually-hidden">Top</span><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" class="feather feather-chevron-up"><polyline points="18 15 12 9 6 15"></polyline></svg></a>
</div>
{{ end }}
</body>
</html>

View File

@ -0,0 +1,199 @@
{{ if .Site.Params.alert -}}
{{ partial "header/alert.html" . }}
{{ end -}}
{{ if eq .Site.Params.options.navbarSticky true -}}
<div class="sticky-top">
{{ end -}}
<div class="header-bar"></div>
<header class="navbar navbar-expand-lg navbar-light doks-navbar">
<nav class="container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }} flex-wrap flex-lg-nowrap" aria-label="Main navigation">
<a class="navbar-brand order-0" href="{{ "/" | relLangURL }}" aria-label="{{ .Site.Params.Title }}">
{{ .Site.Params.Title }}
</a>
{{ if (in .Site.Params.sections.sectionNav .Section) -}}
<button class="btn btn-link order-0 ms-auto d-lg-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasExample" aria-controls="offcanvasExample">
<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" class="feather feather-more-horizontal"><circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle></svg>
</button>
<div class="offcanvas offcanvas-start d-lg-none" tabindex="-1" id="offcanvasExample" aria-labelledby="offcanvasExampleLabel">
<div class="header-bar"></div>
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="offcanvasExampleLabel">{{ i18n "browse" }} {{ .Section }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<aside class="doks-sidebar mt-n3">
<nav id="doks-docs-nav" aria-label="Tertiary navigation">
{{ partial "sidebar/docs-menu.html" . }}
</nav>
</aside>
</div>
</div>
{{ end -}}
<button class="btn btn-menu order-2 d-block d-lg-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasDoks" aria-controls="offcanvasDoks" aria-label="Open main menu">
<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" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>
</button>
<div class="offcanvas offcanvas-end border-0 py-lg-1" tabindex="-1" id="offcanvasDoks" data-bs-backdrop="true" aria-labelledby="offcanvasDoksLabel">
<div class="header-bar d-lg-none"></div>
<div class="offcanvas-header d-lg-none">
<h2 class="h5 offcanvas-title ps-2" id="offcanvasDoksLabel"><a class="text-dark" href="{{ "/" | relLangURL }}">{{ .Site.Params.Title }}</a></h2>
<button type="button" class="btn-close text-reset me-2" data-bs-dismiss="offcanvas" aria-label="Close main menu"></button>
</div>
<div class="offcanvas-body p-4 p-lg-0">
<ul class="nav flex-column flex-lg-row align-items-lg-center mt-2 mt-lg-0 ms-lg-2 me-lg-auto">
{{- $current := . -}}
{{- $section := $current.Section -}}
{{ range .Site.Menus.main -}}
{{- $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) -}}
{{- $active = or $active (eq .Name $current.Title) -}}
{{- $active = or $active (and (eq .Name ($section | humanize)) (eq $current.Section $section)) -}}
{{- $active = or $active (and (eq .Name "Blog") (eq $current.Section "blog" "contributors" "categories" "tags")) -}}
{{ if .HasChildren }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle ps-0 py-1" href="#" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
{{ .Name }}
<span class="dropdown-caret"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></span>
</a>
<ul class="dropdown-menu dropdown-menu-main shadow rounded border-0" aria-labelledby="navbarDropdownMenuLink">
{{ range .Children -}}
{{- $active = eq .Name $current.Title -}}
<li>
<a class="dropdown-item{{ if $active }} active{{ end }}" href="{{ .URL | relLangURL }}"{{ if $active }} aria-current="true"{{ end }}>{{ .Name }}</a>
</li>
{{ end -}}
</ul>
</li>
{{ else }}
<li class="nav-item">
<a class="nav-link ps-0 py-1{{ if $active }} active{{ end }}" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end -}}
</ul>
{{- $showFlexSearch := .Site.Params.options.flexSearch }}
{{- if $showFlexSearch }}
{{- if and (isset .Site.Params.options "searchsectionsshow") (not (eq .Site.Params.options.searchSectionsShow "ALL")) }}
{{- $showFlexSearch = or (eq (len .Site.Params.options.searchSectionsShow) 0) (in .Site.Params.options.searchSectionsShow .Section) (and .IsHome (in .Site.Params.options.searchSectionsShow "HomePage")) }}
{{- end }}
{{- end }}
{{ if $showFlexSearch -}}
<hr class="text-black-50 my-4 d-lg-none">
<form class="doks-search position-relative flex-grow-1 ms-lg-auto me-lg-2">
<input id="search" class="form-control is-search" type="search" placeholder="{{ i18n "search-text" }}" aria-label="{{ i18n "search-text" }}" autocomplete="off">
<div id="suggestions" class="shadow bg-white rounded d-none"></div>
</form>
{{ end -}}
<hr class="text-black-50 my-4 d-lg-none">
<ul class="nav flex-column flex-lg-row">
{{ range .Site.Menus.social -}}
<li class="nav-item">
<a class="nav-link social-link" href="{{ .URL | relURL }}">{{ .Pre | safeHTML }}<small class="ms-2 d-lg-none">{{ .Name | safeHTML }}</small></a>
</li>
{{ end -}}
</ul>
{{/* {{ if .Site.Params.options.darkMode -}}
<hr class="text-black-50 my-4 d-lg-none">
<button id="mode" class="btn btn-link" type="button" aria-label="Toggle user interface mode">
<span class="toggle-dark"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg></span>
<span class="toggle-light"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sun"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg></span>
</button>
{{ end -}} */}}
{{ if eq .Site.Params.options.multilingualMode true -}}
<hr class="text-black-50 my-4 d-lg-none">
<div class="dropdown">
<button class="btn btn-doks-light dropdown-toggle" id="doks-languages" data-bs-toggle="dropdown" aria-expanded="false" data-bs-display="static">
{{ .Site.Params.languageName }}
<span class="dropdown-caret"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></span>
</button>
<ul class="dropdown-menu dropdown-menu-lg-end me-lg-2 shadow rounded border-0" aria-labelledby="doks-languages">
<li><a class="dropdown-item current" aria-current="true" href="{{ .RelPermalink }}">{{ .Site.Language.LanguageName }}</a></li>
<li><hr class="dropdown-divider"></li>
{{ if .IsTranslated -}}
{{ range .Translations }}
<li><a class="dropdown-item" rel="alternate" href="{{ .RelPermalink }}" hreflang="{{ .Lang }}" lang="{{ .Lang }}">{{ .Language.LanguageName }}</a></li>
{{ end -}}
{{ else -}}
{{ range .Site.Languages -}}
{{ if ne $.Site.Language.Lang .Lang }}
<li><a class="dropdown-item" rel="alternate" href="{{ .Lang | relLangURL }}" hreflang="{{ .Lang }}" lang="{{ .Lang }}">{{ .LanguageName }}</a></li>
{{ end -}}
{{ end -}}
{{ end -}}
<!--
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="/docs/contributing/how-to-contribute/">Help Translate</a></li>
-->
</ul>
</div>
{{ end -}}
{{ if eq .Site.Params.options.docsVersioning true -}}
<hr class="text-black-50 my-4 d-lg-none">
<div class="dropdown">
<button class="btn btn-doks-light dropdown-toggle" id="doks-versions" data-bs-toggle="dropdown" aria-expanded="false" data-bs-display="static" aria-label="Toggle version menu">
<span class="d-none">Doks</span> v{{ .Site.Params.docsVersion }}
<span class="dropdown-caret"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></span>
</button>
<ul class="dropdown-menu dropdown-menu-lg-end me-lg-2 shadow rounded border-0" aria-labelledby="doks-versions">
<li><a class="dropdown-item current" aria-current="true" href="/docs/{{ .Site.Params.docsVersion }}/prologue/introduction/">Latest ({{ .Site.Params.docsVersion }}.x)</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="/docs/0.2/prologue/introduction/">v0.2.x</a></li>
<li><a class="dropdown-item" href="/docs/0.1/prologue/introduction/">v0.1.x</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="/docs/versions/">All versions</a></li>
</ul>
</div>
{{ end -}}
</div>
</div>
</nav>
</header>
{{ if eq .Site.Params.options.navbarSticky true }}
</div>
{{ end -}}
{{ if eq .Section "docs" -}}
<div class="container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }}">
<aside class="doks-sidebar">
<nav id="doks-docs-nav" class="collapse d-lg-none" aria-label="Tertiary navigation">
{{ partial "sidebar/docs-menu.html" . }}
</nav>
</aside>
</div>
{{ else if ne .CurrentSection .FirstSection -}}
<!--
<nav class="doks-subnavbar py-2 sticky-lg-top d-lg-none" aria-label="Secondary navigation">
<div class="container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }} d-flex align-items-lg-center">
<span class="navbar-text ms-0">{{ .Section | humanize }}</span>
<button class="btn doks-sidebar-toggle d-lg-none ms-auto order-3 collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#doks-docs-nav" aria-controls="doks-docs-nav" aria-expanded="false" aria-label="Toggle documentation navigation">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="doks doks-expand" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>Expand</title><polyline points="7 13 12 18 17 13"></polyline><polyline points="7 6 12 11 17 6"></polyline></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="doks doks-collapse" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>Collapse</title><polyline points="17 11 12 6 7 11"></polyline><polyline points="17 18 12 13 7 18"></polyline></svg>
</button>
</div>
</nav>
-->
<div class="container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }}">
<aside class="doks-sidebar">
<nav id="doks-docs-nav" class="collapse d-lg-none" aria-label="Tertiary navigation">
{{ partial "sidebar/docs-menu.html" . }}
</nav>
</aside>
</div>
{{ end -}}