]> BookStack Code Mirror - bookstack/commitdiff
Started reworking of page-show design
authorDan Brown <redacted>
Sun, 21 Oct 2018 19:05:11 +0000 (20:05 +0100)
committerDan Brown <redacted>
Sun, 21 Oct 2018 19:05:11 +0000 (20:05 +0100)
- Updated core toolbar & breadcrumb design

13 files changed:
resources/assets/icons/chevron-right.svg [new file with mode: 0644]
resources/assets/js/components/page-display.js
resources/assets/sass/_blocks.scss
resources/assets/sass/_grid.scss
resources/assets/sass/_header.scss
resources/assets/sass/_html.scss
resources/assets/sass/_pages.scss
resources/assets/sass/_variables.scss
resources/views/pages/_breadcrumbs.blade.php
resources/views/pages/show.blade.php
resources/views/partials/book-tree.blade.php
resources/views/public.blade.php
resources/views/sidebar-layout.blade.php

diff --git a/resources/assets/icons/chevron-right.svg b/resources/assets/icons/chevron-right.svg
new file mode 100644 (file)
index 0000000..96540b9
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
\ No newline at end of file
index 3fd8fb8efe7b04f96067d7058fbb7baa561afb8b..cffaf373d0ab91c91e8d2eb6e38f2b429196a92a 100644 (file)
@@ -136,7 +136,7 @@ class PageDisplay {
 
         // Fix the tree as a sidebar
         function stickTree() {
-            $sidebar.width($bookTreeParent.width() + 15);
+            $sidebar.width($bookTreeParent.width() - 32);
             $sidebar.addClass("fixed");
             isFixed = true;
         }
index a19ca0278b7823193d71f3bebe0792ede03d93cd..1e46413384276d3396c095d86fb7dc92f09fce65 100644 (file)
@@ -1,29 +1,9 @@
 
 /*
-* This file container all block styling including background shading,
-* margins, paddings & borders.
+* This file container all block styling including margins, paddings & borders.
 */
 
 
-/*
-* Background Shading
-*/
-.shaded {
-  background-color: #f1f1f1;
-  &.pos {
-    background-color: lighten($positive, 40%);
-  }
-  &.neg {
-    background-color: lighten($negative, 20%);
-  }
-  &.primary {
-    background-color: lighten($primary, 40%);
-  }
-  &.secondary {
-    background-color: lighten($secondary, 30%);
-  }
-}
-
 /*
 * Padding
 * TODO - Remove these older styles
 
 .card {
   background-color: #FFF;
-  box-shadow: 0 1px 6px -1px rgba(0, 0, 0, 0.1);
+  box-shadow: $bs-card;
   border-radius: 3px;
   padding-bottom: $-xs;
   h3 {
 }
 
 .sidebar .card {
-  h3, .body, .empty-text {
+  .body, .empty-text {
     padding: $-s $-m;
   }
+  h3 + .body {
+    padding-top: $-xs;
+  }
 }
 
 .card.drag-card {
index f4d155ddeb0ca671b855881b83110a5a18ebe0b9..aeb31460b47442e4d975e295058293be305d95d1 100644 (file)
@@ -63,7 +63,8 @@ body.flexbox {
   flex: 3;
   background-color: #FFFFFF;
   padding: 0 $-l;
-  border-left: 1px solid #DDD;
+  box-shadow: $bs-card;
+  border-radius: 4px;
   max-width: 100%;
 }
 .flex.sidebar .sidebar-toggle {
@@ -135,6 +136,7 @@ body.flexbox {
     position: fixed;
     top: 0;
     padding-right: $-m;
+    padding-top: $-m;
     width: 30%;
     left: 0;
     height: 100%;
@@ -958,6 +960,7 @@ div[class^="col-"] img {
 }
 
 @include grid-layout('thirds', 3)
+@include grid-layout('halves', 2)
 
 @each $sizeLetter, $size in $screen-sizes {
   @include smaller-than($size) {
index d42ec8064bafa5ddaeeccd8dd614c60118cc0f68..3f4841a7fbec462ffb27652abc9d37fd07ac8ede 100644 (file)
@@ -15,6 +15,8 @@ header {
   color: #fff;
   fill: #fff;
   border-bottom: 1px solid #DDD;
+  box-shadow: $bs-card;
+  padding: $-xxs 0;
   .links {
     display: inline-block;
     vertical-align: top;
@@ -74,13 +76,16 @@ header .search-box {
   margin-top: 10px;
   input {
     background-color: rgba(0, 0, 0, 0.2);
-    border: 1px solid rgba(255, 255, 255, 0.3);
+    border: 1px solid rgba(255, 255, 255, 0.2);
+    border-radius: 40px;
     color: #EEE;
     z-index: 2;
+    padding-left: 40px;
   }
   button {
     fill: #EEE;
     z-index: 1;
+    left: 16px;
     svg {
       margin-right: 0;
     }
@@ -191,10 +196,20 @@ header .search-box {
   }
 }
 
-.breadcrumbs span.sep {
-  color: #aaa;
-  padding: 0 $-xs;
+.breadcrumbs {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+
+.breadcrumbs .separator {
+  fill: #aaa;
+  font-size: 1.6em;
+  line-height: 0.8;
+  margin: 0 $-xs;
+  margin-top: -2px;
 }
+
 .faded {
   a, button, span, span > div {
     color: #666;
@@ -222,13 +237,24 @@ header .search-box {
   background-color: $primary-faded;
 }
 
-.toolbar-container {
-  background-color: #FFF;
+.toolbar {
+  position: relative;
+  > .grid > div {
+    opacity: 0.8;
+    transition: opacity ease-in-out 120ms;
+    &:hover {
+      opacity: 1;
+    }
+  }
+  .text-button {
+    color: #666;
+    fill: #666;
+  }
 }
 
-.breadcrumbs .text-button, .action-buttons .text-button {
+.action-buttons .text-button {
   display: inline-block;
-  padding: $-s;
+  padding: $-xs $-s;
   &:last-child {
     padding-right: 0;
   }
@@ -257,25 +283,12 @@ header .search-box {
 }
 
 @include smaller-than($m) {
-  .breadcrumbs .text-button, .action-buttons .text-button {
+  .action-buttons .text-button {
     padding: $-xs $-xs;
   }
   .action-buttons .dropdown-container:last-child a {
     padding-left: $-xs;
   }
-  .breadcrumbs .text-button {
-    font-size: 0;
-  }
-  .breadcrumbs .text-button svg {
-    font-size: $fs-m;
-  }
-  .breadcrumbs a i {
-    font-size: $fs-m;
-    padding-right: 0;
-  }
-  .breadcrumbs span.sep {
-    padding: 0 $-xxs;
-  }
   .toolbar .col-xs-1:first-child {
     padding-right: 0;
   }
index 65f05a71d5c69370707cca7b45b4510395ff8b05..32756a600d6a1a64fea0af29693fb18af1648484 100644 (file)
@@ -3,15 +3,12 @@
 }
 
 html {
-  background-color: #FFFFFF;
   height: 100%;
   overflow-y: scroll;
+  background-color: #F2F2F2;
   &.flexbox {
     overflow-y: hidden;
   }
-  &.shaded {
-    background-color: #F2F2F2;
-  }
 }
 
 body {
@@ -19,9 +16,7 @@ body {
   line-height: 1.6;
   color: #616161;
   -webkit-font-smoothing: antialiased;
-  &.shaded {
-    background-color: #F2F2F2;
-  }
+  background-color: #F2F2F2;
 }
 
 button {
index 2d3a5852d1e64d32748e31e2fedc7c91a4097f3c..bb604e1889f3af5c1767fa9869eaad2fdc557e42 100755 (executable)
@@ -41,7 +41,7 @@
   margin-top: $-xxl;
   overflow-wrap: break-word;
   &.flex {
-    margin-top: $-m;
+    margin-top: $-xl;
   }
   .align-left {
     text-align: left;
     width: 100%;
     height: 100%;
   }
+}
+
+.entity-chip {
+  display: inline-block;
+  align-items: center;
+  justify-content: center;
+  text-align: center;
+  font-size: 0.9em;
+  border-radius: 2em;
+  position: relative;
+  overflow: hidden;
+  padding: $-xs $-m;
+  &:after {
+    content: '';
+    position: absolute;
+    background-color: currentColor;
+    opacity: 0.2;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+  }
 }
\ No newline at end of file
index e32b2ab2c7bcc36b38c41427ffdcf4c78cf85efa..ea0fcba5be9fd05cdd08f910a8395af5fe583b5c 100644 (file)
@@ -53,7 +53,7 @@ $primary-faded: rgba(21, 101, 192, 0.15);
 // Item Colors
 $color-bookshelf: #af5a5a;
 $color-book: #009688;
-$color-chapter: #ef7c3c;
+$color-chapter: #e56236;
 $color-page: $primary;
 $color-page-draft: #9A60DA;
 
@@ -64,5 +64,5 @@ $text-light: #EEE;
 // Shadows
 $bs-light: 0 0 4px 1px #CCC;
 $bs-med: 0 1px 3px 1px rgba(76, 76, 76, 0.26);
-$bs-card: 0 1px 3px 1px rgba(76, 76, 76, 0.26), 0 1px 12px 0px rgba(76, 76, 76, 0.2);
+$bs-card: 0 1px 6px -1px rgba(0, 0, 0, 0.1);
 $bs-hover: 0 2px 2px 1px rgba(0,0,0,.13);
\ No newline at end of file
index 19bab40e0967ba68f32a40a58393a5a6dbd6940e..8bbda04115eddddf6376064cc8b38127f0392974 100644 (file)
@@ -1,14 +1,14 @@
 <div class="breadcrumbs">
     @if (userCan('view', $page->book))
-        <a href="{{ $page->book->getUrl() }}" class="text-book text-button">@icon('book'){{ $page->book->getShortName() }}</a>
-        <span class="sep">&raquo;</span>
+        <a href="{{ $page->book->getUrl() }}" class="entity-chip text-book">@icon('book'){{ $page->book->getShortName() }}</a>
+        <div class="separator">@icon('chevron-right')</div>
     @endif
     @if($page->hasChapter() && userCan('view', $page->chapter))
-        <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button">
+        <a href="{{ $page->chapter->getUrl() }}" class="entity-chip text-chapter">
             @icon('chapter')
             {{ $page->chapter->getShortName() }}
         </a>
-        <span class="sep">&raquo;</span>
+        <div class="separator">@icon('chevron-right')</div>
     @endif
-    <a href="{{ $page->getUrl() }}" class="text-page text-button">@icon('page'){{ $page->getShortName() }}</a>
+    <a href="{{ $page->getUrl() }}" class="entity-chip text-page">@icon('page'){{ $page->getShortName() }}</a>
 </div>
\ No newline at end of file
index 0b6aa7d14bbba3c4e395486d3a6ac8d2e69ace53..06c3529d5e464b7ed86e1f3ec1d9864088e2a12e 100644 (file)
@@ -1,10 +1,10 @@
 @extends('sidebar-layout')
 
 @section('toolbar')
-    <div class="col-sm-8 col-xs-5 faded">
-        @include('pages._breadcrumbs', ['page' => $page])
-    </div>
-    <div class="col-sm-4 col-xs-7 faded">
+    <div class="grid halves">
+        <div>
+            @include('pages._breadcrumbs', ['page' => $page])
+        </div>
         <div class="action-buttons">
             <span dropdown class="dropdown-container">
                 <div dropdown-toggle class="text-button text-primary">@icon('export'){{ trans('entities.export') }}</div>
@@ -49,7 +49,7 @@
     @endif
 
     @if ($page->attachments->count() > 0)
-        <div class="card">
+        <div id="page-attachments" class="card mb-m">
             <h3>@icon('attach') {{ trans('entities.pages_attachments') }}</h3>
             <div class="body">
                 @foreach($page->attachments as $attachment)
@@ -62,7 +62,7 @@
     @endif
 
     @if (isset($pageNav) && count($pageNav))
-        <div class="card">
+        <div id="page-navigation" class="card mb-m">
             <h3>@icon('open-book') {{ trans('entities.pages_navigation') }}</h3>
             <div class="body">
                 <div class="sidebar-page-nav menu">
@@ -76,7 +76,7 @@
         </div>
     @endif
 
-    <div class="card entity-details">
+    <div id="page-details" class="card entity-details mb-m">
         <h3>@icon('info') {{ trans('common.details') }}</h3>
         <div class="body text-muted text-small blended-links">
             @include('partials.entity-meta', ['entity' => $page])
         </div>
     </div>
 
-    @include('partials/book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
+    @include('partials.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
 
 @stop
 
index 0f895cf59fed2d620f79d21b9fcad47fc4ce2306..b0e5bff640e6a9f552906f5ae8e42bf85d79c160 100644 (file)
@@ -1,4 +1,4 @@
-<div class="card book-tree" v-pre>
+<div id="book-tree" class="card book-tree mb-m" v-pre>
     <h3>@icon('book') {{ trans('entities.books_navigation') }}</h3>
     <div class="body">
         <ul class="sidebar-page-list menu">
index f6135cd1bce897cff531da4ffdeb339add2e6ea6..54918b19c8ce8325fe9a4f8d96f82b622ecffcf0 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html class="shaded">
+<html>
 <head>
     <title>{{ setting('app-name') }}</title>
 
index bf853c09ef44505910bf54fdef2a4296ad9ac271..9df8ba81347ab7a9c80c5cb72fe9224dc5d34e89 100644 (file)
@@ -4,14 +4,8 @@
 
 @section('content')
 
-    <div class="toolbar-container">
-        <div class="faded-small toolbar">
-            <div class="container fluid">
-                <div class="row">
-                    @yield('toolbar')
-                </div>
-            </div>
-        </div>
+    <div class="toolbar px-l py-m">
+        @yield('toolbar')
     </div>
 
 
         <div sidebar class="sidebar flex print-hidden" id="sidebar">
             <div class="sidebar-toggle primary-background-light">@icon('caret-right-circle')
             </div>
-            <div class="scroll-body">
+            <div class="scroll-body px-m">
                 @yield('sidebar')
             </div>
         </div>
 
-        <div class="content flex @yield('body-wrap-classes')">
+        <div class="content mr-m flex @yield('body-wrap-classes')">
             @yield('body')
         </div>
     </div>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.