From 74bcc3082145545b58e40bb6189875eaafe8fa42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Sat, 29 Jun 2019 19:45:08 +0200 Subject: [PATCH] Style bookmarks page --- bookmarks/styles/base.scss | 47 ++++++++++++- bookmarks/styles/bookmarks.scss | 23 ++++++ bookmarks/styles/components.scss | 14 ++++ bookmarks/styles/index.scss | 17 +++++ bookmarks/styles/util.scss | 9 +++ bookmarks/templates/bookmarks/index.html | 85 ++++++++++++++--------- bookmarks/templates/bookmarks/layout.html | 20 ++++-- 7 files changed, 176 insertions(+), 39 deletions(-) create mode 100644 bookmarks/styles/bookmarks.scss create mode 100644 bookmarks/styles/components.scss create mode 100644 bookmarks/styles/index.scss create mode 100644 bookmarks/styles/util.scss diff --git a/bookmarks/styles/base.scss b/bookmarks/styles/base.scss index 4f21edc..a3e3ff6 100644 --- a/bookmarks/styles/base.scss +++ b/bookmarks/styles/base.scss @@ -1 +1,46 @@ -@import "../../node_modules/spectre.css/src/spectre"; +body { + margin: 20px 0; +} + +header { + margin-bottom: 40px; +} + +.navbar-brand { + + .logo { + background-color: $primary-color; + color: $light-color; + padding: 14px; + } + + h1 { + text-transform: uppercase; + display: inline-block; + } +} + +/* Overrides */ + +// Reduce heading sizes +h1 { + font-size: inherit; +} + +h2 { + font-size: .85rem; + color: $gray-color-dark; +} + +// Button color should not change for anchor elements +.btn:visited:not(.btn-primary) { + color: $primary-color; +} + +// Increase spacing between columns +.container > .columns > .column { +} + +.container > .columns > .column:not(:first-child) { + padding-left: 2rem; +} diff --git a/bookmarks/styles/bookmarks.scss b/bookmarks/styles/bookmarks.scss new file mode 100644 index 0000000..f2adf36 --- /dev/null +++ b/bookmarks/styles/bookmarks.scss @@ -0,0 +1,23 @@ +ul.bookmark-list { + + list-style: none; + margin: 0; + padding: 0; + + .description { + color: $gray-color; + } + + .actions .btn-link { + color: $gray-color-dark; + padding-left: 0; + padding-right: 0; + + &:focus, + &:hover, + &:active, + &.active { + color: darken($gray-color-dark, 10%); + } + } +} diff --git a/bookmarks/styles/components.scss b/bookmarks/styles/components.scss new file mode 100644 index 0000000..59c3349 --- /dev/null +++ b/bookmarks/styles/components.scss @@ -0,0 +1,14 @@ +section.content-area { + + .content-area-header { + border-bottom: solid 1px $border-color; + display: flex; + flex-direction: row; + align-items: baseline; + margin-bottom: 16px; + + h2 { + line-height: 1.8rem; + } + } +} diff --git a/bookmarks/styles/index.scss b/bookmarks/styles/index.scss new file mode 100644 index 0000000..e3bf278 --- /dev/null +++ b/bookmarks/styles/index.scss @@ -0,0 +1,17 @@ +// Font sizes +$html-font-size: 18px !default; + +// Import Spectre CSS lib +@import "../../node_modules/spectre.css/src/spectre"; +// Import Spectre icons +@import "../../node_modules/spectre.css/src/icons/icons-core"; +@import "../../node_modules/spectre.css/src/icons/icons-navigation"; +@import "../../node_modules/spectre.css/src/icons/icons-action"; +@import "../../node_modules/spectre.css/src/icons/icons-object"; + + +// Import style modules +@import "base"; +@import "util"; +@import "components"; +@import "bookmarks"; diff --git a/bookmarks/styles/util.scss b/bookmarks/styles/util.scss new file mode 100644 index 0000000..2e7991d --- /dev/null +++ b/bookmarks/styles/util.scss @@ -0,0 +1,9 @@ +.spacer { + flex: 1 1 0; +} + +.truncate { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/bookmarks/templates/bookmarks/index.html b/bookmarks/templates/bookmarks/index.html index 6f3d80f..3834210 100644 --- a/bookmarks/templates/bookmarks/index.html +++ b/bookmarks/templates/bookmarks/index.html @@ -2,42 +2,59 @@ {% load shared %} {% block content %} -
-

Bookmarks

- Add -
-
-
-
- - +
+ + {# Bookmark list #} +
+
+

Bookmarks

+
+
- -
-
    - {% for bookmark in bookmarks %} -
  • -

    - {{ bookmark.resolved_title }} -

    - {% if bookmark.resolved_description is not None %} -

    {{ bookmark.resolved_description }}

    +
      + {% for bookmark in bookmarks %} +
    • + + {% if bookmark.resolved_description is not None %} +
      {{ bookmark.resolved_description }}
      + {% endif %} +
      + Edit + Remove +
      +
    • + {% endfor %} +
    +
  • - {% endfor %} -
- + + + {# Tag list #} +
+
+

Tags

+
+
{% endblock %} diff --git a/bookmarks/templates/bookmarks/layout.html b/bookmarks/templates/bookmarks/layout.html index 473e46d..04c028e 100644 --- a/bookmarks/templates/bookmarks/layout.html +++ b/bookmarks/templates/bookmarks/layout.html @@ -7,13 +7,25 @@ linkdings {# Include SASS styles, files are resolved from bookmarks/styles #} - + -
-

linkdings

+ -
+
{% block content %} {% endblock %}