From 54d6143190bd5ba1113b914b963e029c83acc5ab Mon Sep 17 00:00:00 2001 From: codecalm Date: Sun, 15 Dec 2019 17:34:57 +0100 Subject: [PATCH] error pages, border utilities --- pages/_data/menu.yml | 26 ++++++++++++++++++++++ pages/_includes/ui/button.html | 2 +- pages/_includes/ui/empty.html | 2 +- pages/_layouts/base.html | 19 +++++++--------- pages/_layouts/error.html | 2 +- pages/_layouts/single.html | 2 +- scss/_utilities.scss | 40 ++++++++++++++++++++++++++++++++++ scss/_variables.scss | 4 +++- scss/utils/_border.scss | 37 ------------------------------- 9 files changed, 81 insertions(+), 53 deletions(-) diff --git a/pages/_data/menu.yml b/pages/_data/menu.yml index b7be0e58..253c8971 100644 --- a/pages/_data/menu.yml +++ b/pages/_data/menu.yml @@ -12,6 +12,32 @@ forms: badge: New badge-color: red +error: + title: Error pages + icon: file-minus + children: + 400: + url: 400.html + title: 400 page + 401: + url: 401.html + title: 401 page + 403: + url: 403.html + title: 403 page + 404: + url: 404.html + title: 404 page + 500: + url: 500.html + title: 500 page + 503: + url: 503.html + title: 503 page + maintenance: + url: maintenance.html + title: Maintenance page + base: title: Base icon: package diff --git a/pages/_includes/ui/button.html b/pages/_includes/ui/button.html index 5170bde1..683b47cf 100644 --- a/pages/_includes/ui/button.html +++ b/pages/_includes/ui/button.html @@ -3,7 +3,7 @@ {% assign provider = include.provider | default: 'fe' %} {% if include.text %}{% assign spinner-class="mr-2" %}{% endif %} {% assign e = include.element | default: 'a' %} -<{{ e }}{% if e == 'a' %} href="{{ include.href | default: '#' }}"{% endif %}{% if include.type %} type="{{ include.type }}"{% endif %} class="btn{% if include.height %} btn-{{ include.height }}{% endif %}{% if include.color %} btn-{% if include.outline %}outline-{% endif %}{{ include.color }}{% endif %}{% if include.disabled %} disabled{% endif %}{% if include.square %} btn-square{% endif %}{% if include.pill %} btn-pill{% endif %}{% if include['size'] %} btn-{{ include['size'] }}{% endif %}{% if include.class %} {{ include.class }}{% endif %}{% if include.block %} btn-block{% endif %}{% if include.link %} btn-link{% endif %}{% if include.label %} btn-label{% endif %}{% if include.icon-only %} btn-icon{% endif %}"> +<{{ e }}{% if e == 'a' %} href="{% if include.href %}{{ site.base }}/{{ include.href }}{% else %}#{% endif %}"{% endif %}{% if include.type %} type="{{ include.type }}"{% endif %} class="btn{% if include.height %} btn-{{ include.height }}{% endif %}{% if include.color %} btn-{% if include.outline %}outline-{% endif %}{{ include.color }}{% endif %}{% if include.disabled %} disabled{% endif %}{% if include.square %} btn-square{% endif %}{% if include.pill %} btn-pill{% endif %}{% if include['size'] %} btn-{{ include['size'] }}{% endif %}{% if include.class %} {{ include.class }}{% endif %}{% if include.block %} btn-block{% endif %}{% if include.link %} btn-link{% endif %}{% if include.label %} btn-label{% endif %}{% if include.icon-only %} btn-icon{% endif %}"> {% if include.spinner %} {% include ui/spinner.html color=false size="sm" class=spinner-class element="span" %}{% endif %} {% if include.icon %}{% include_cached ui/icon.html icon=include.icon use-svg=true %}{% endif %} diff --git a/pages/_includes/ui/empty.html b/pages/_includes/ui/empty.html index 018af0bf..183100a7 100644 --- a/pages/_includes/ui/empty.html +++ b/pages/_includes/ui/empty.html @@ -18,6 +18,6 @@
{% assign button-text = include.button-text | default: "Search again" %} {% assign button-icon = include.button-icon | default: "search" %} - {% include_cached ui/button.html text=button-text color="primary" icon=button-icon %} + {% include_cached ui/button.html text=button-text color="primary" icon=button-icon href="index.html" %}
diff --git a/pages/_layouts/base.html b/pages/_layouts/base.html index 482f8974..687d129d 100644 --- a/pages/_layouts/base.html +++ b/pages/_layouts/base.html @@ -23,27 +23,24 @@ {% if page.title %}{{ page.title }} - {% endif %}{% if layout.title %}{{ layout.title }} - {% endif %}{% if site.title %}{{ site.title }} - {% endif %}{{ site.description }} {% if page.description %} - + {% endif %} {% include_cached layout/og.html show=layout.og-component %} - {% include_cached layout/css.html %} - + -{{ content}} + {{ content }} -{% include_cached layout/js.html %} -{% include layout/js-capture.html %} + {% include_cached layout/js.html %} + {% include layout/js-capture.html %} -{% if site.debug %} -{% if jekyll.environment == 'development' %} -{% include_cached layout/debug.html %} -{% endif %} -{% endif %} + {% if site.debug and jekyll.environment == 'development' %} + {% include_cached layout/debug.html %} + {% endif %} diff --git a/pages/_layouts/error.html b/pages/_layouts/error.html index caa2ad8f..213d37a6 100644 --- a/pages/_layouts/error.html +++ b/pages/_layouts/error.html @@ -1,6 +1,6 @@ --- layout: base -body-class: border-top-2 border-primary +body-class: border-top-wide border-primary ---
diff --git a/pages/_layouts/single.html b/pages/_layouts/single.html index 9b59ece8..7fed08e7 100644 --- a/pages/_layouts/single.html +++ b/pages/_layouts/single.html @@ -1,6 +1,6 @@ --- layout: base -body-class: border-top-2 border-primary +body-class: border-top-wide border-primary ---
diff --git a/scss/_utilities.scss b/scss/_utilities.scss index 76691514..daa0c7e2 100644 --- a/scss/_utilities.scss +++ b/scss/_utilities.scss @@ -66,4 +66,44 @@ $utilities: ( black: 900, ) ), + "border": ( + property: border, + values: ( + null: $border-width solid $border-color, + wide: $border-width-wide solid $border-color, + 0: 0, + ) + ), + "border-top": ( + property: border-top, + values: ( + null: $border-width solid $border-color, + wide: $border-width-wide solid $border-color, + 0: 0, + ) + ), + "border-right": ( + property: border-right, + values: ( + null: $border-width solid $border-color, + wide: $border-width-wide solid $border-color, + 0: 0, + ) + ), + "border-bottom": ( + property: border-bottom, + values: ( + null: $border-width solid $border-color, + wide: $border-width-wide solid $border-color, + 0: 0, + ) + ), + "border-left": ( + property: border-left, + values: ( + null: $border-width solid $border-color, + wide: $border-width-wide solid $border-color, + 0: 0, + ) + ), ) !default; diff --git a/scss/_variables.scss b/scss/_variables.scss index 37166090..b50354b0 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -107,6 +107,8 @@ $font-size-base: 1rem !default; $line-height-base: 1.5 !default; $body-letter-spacing: null !default; +$border-width: 1px !default; +$border-width-wide: 2px !default; $border-radius: 3px !default; //Typography @@ -221,7 +223,7 @@ $card-border-radius: $border-radius !default; $card-cap-bg: $min-black !default; $card-active-border-color: $primary !default; -$card-status-size: 2px !default; +$card-status-size: $border-width-wide !default; $card-group-margin: 1.5rem !default; $card-shadow: rgba($dark, .04) 0 2px 4px 0 !default; diff --git a/scss/utils/_border.scss b/scss/utils/_border.scss index 7690ec9a..b785a8cc 100644 --- a/scss/utils/_border.scss +++ b/scss/utils/_border.scss @@ -1,40 +1,3 @@ -// stylelint-disable declaration-no-important -$border-sizing: () !default; -$border-sizing: map-merge( - ( - 2: 2, - 4: 4 - ), - $border-sizing -) !default; - -@each $size, $value in $border-sizing { - - .border-#{$size} { - border-width: $border-width * $value !important; - } - - .border-top-#{$size} { - border-top-style: solid; - border-top-width: $border-width * $value !important; - } - - .border-right-#{$size} { - border-right-style: solid; - border-right-width: $border-width * $value !important; - } - - .border-bottom-#{$size} { - border-bottom-style: solid; - border-bottom-width: $border-width * $value !important; - } - - .border-left-#{$size} { - border-left-style: solid; - border-left-width: $border-width * $value !important; - } -} - .border-dashed { border-style: dashed !important; } -- GitLab