You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2019/09/19 21:26:58 UTC

[royale-docs] branch master updated: improve TOC visuals

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-docs.git


The following commit(s) were added to refs/heads/master by this push:
     new 477ebdd  improve TOC visuals
477ebdd is described below

commit 477ebdd552288aefad8b5a9caa4b29a8c6e3eb85
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Thu Sep 19 23:26:51 2019 +0200

    improve TOC visuals
---
 _includes/toc.html      |  71 +++++-----
 _layouts/docpage.html   |   8 +-
 _sass/docsearch.sass    |   5 +-
 _sass/highlight.sass    |   3 +
 _sass/royale-theme.sass |  77 -----------
 _sass/sidebar.sass      | 340 ++++++++++++++++++++++++++++++++++++------------
 assets/css/styles.sass  |   2 +-
 7 files changed, 302 insertions(+), 204 deletions(-)

diff --git a/_includes/toc.html b/_includes/toc.html
index bad75c3..d33dd53 100644
--- a/_includes/toc.html
+++ b/_includes/toc.html
@@ -15,29 +15,30 @@
     {% for p in site.pages %}
       {% if p.path == entry.path %}
         
-          <div class="toc_title_wrapper">
+          <div class="toc-title-wrapper">
           {% if p.path == page.path %}
-            
-            <h3 class="toc_current">{{ p.title }}</h3>
-            <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="8" height="8" class="toc_arrow_rot">
-              <g transform="translate(904.92214,-879.1482)"><path d="
-              m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
-              -55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
-              0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,
-              -174.6858 c 96.079,-96.07721 175.253196,-174.68583 175.942696,
-              -174.68583 0.6895,0 26.281,25.03215 56.8701,
-              55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864
-              -231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688,
-              -104.0616 -231.873,-231.248 z
-            " fill="currentColor"></path></g></svg>
-            <div class="accordion_content">
+            <!-- <div class="toc-title-arrow"> -->
+              <h3 class="toc-current">{{ p.title }}</h3>
+              <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="8" height="8" class="toc-arrow-rot">
+                <g transform="translate(904.92214,-879.1482)"><path d="
+                m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
+                -55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
+                0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,
+                -174.6858 c 96.079,-96.07721 175.253196,-174.68583 175.942696,
+                -174.68583 0.6895,0 26.281,25.03215 56.8701,
+                55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864
+                -231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688,
+                -104.0616 -231.873,-231.248 z
+              " fill="currentColor"></path></g></svg>
+            <!-- </div> -->
+            <div class="accordion-content">
             {% for p2 in entry.children %}
               {% for q in site.pages %}
                 {% if p2.path == q.path %}
                   <div class="toc_entry">
                   {% if q.path == page.path %}
-                    <h4 class="toc_current">{{ q.title }}</h4>
-                    <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc_arrow_rot">
+                    <h4 class="toc-current">{{ q.title }}</h4>
+                    <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc-arrow-rot">
                         <g transform="translate(904.92214,-879.1482)"><path d="
                         m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
                         -55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
@@ -49,8 +50,8 @@
                         -104.0616 -231.873,-231.248 z
                       " fill="currentColor"></path></g></svg>
                   {% else %}
-                    <h4 class="toc_link"><a href="{{ q.url | remove_first: '/'}}">{{ q.title }}</a></h4>
-                    <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc_arrow">
+                    <h4 class="toc-link"><a href="{{ q.url | remove_first: '/'}}">{{ q.title }}</a></h4>
+                    <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc-arrow">
                         <g transform="translate(904.92214,-879.1482)"><path d="
                         m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
                         -55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
@@ -74,8 +75,8 @@
                       {% if p3.path == r.path %}
                         <div class="toc_entry">
                         {% if r.path == page.path %}
-                          <h5 class="toc_current">{{ r.title }}</h5>
-                          <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc_arrow_rot">
+                          <h5 class="toc-current">{{ r.title }}</h5>
+                          <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc-arrow-rot">
                               <g transform="translate(904.92214,-879.1482)"><path d="
                               m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
                               -55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
@@ -87,8 +88,8 @@
                               -104.0616 -231.873,-231.248 z
                             " fill="currentColor"></path></g></svg>
                         {% else %}
-                          <h5 class="toc_link"><a href="{{ r.url | remove_first: '/'}}">{{ r.title }}</a></h5>
-                          <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc_arrow">
+                          <h5 class="toc-link"><a href="{{ r.url | remove_first: '/'}}">{{ r.title }}</a></h5>
+                          <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc-arrow">
                               <g transform="translate(904.92214,-879.1482)"><path d="
                               m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
                               -55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
@@ -110,8 +111,8 @@
             {% endfor %}
             </div>         
           {% else %}
-            <h3 class="toc_link"><a href="{{ p.url | remove_first: '/'}}">{{ p.title }}</a></h3>
-            <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="8" height="8" class="toc_arrow">
+            <h3 class="toc-link"><a href="{{ p.url | remove_first: '/'}}">{{ p.title }}</a></h3>
+            <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="8" height="8" class="toc-arrow">
                 <g transform="translate(904.92214,-879.1482)"><path d="
                 m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
                 -55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
@@ -128,16 +129,16 @@
       {% if entry.children %}
         {% assign entrypathparts = entry.children[0].path | split: "/" %}
         {% if folder1 == entrypathparts[0] %}
-          <div class="toc_title_wrapper">
-            <div class="accordion_content">
+          <div class="toc-title-wrapper">
+            <div class="accordion-content">
             
             {% for p2 in entry.children %}
               {% for q in site.pages %}
                 {% if p2.path == q.path %}
                   <div class="toc_entry">
                   {% if q.path == page.path %}
-                    <h4 class="toc_current">{{ q.title }}</h4>
-                    <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc_arrow_rot">
+                    <h4 class="toc-current">{{ q.title }}</h4>
+                    <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc-arrow-rot">
                         <g transform="translate(904.92214,-879.1482)"><path d="
                         m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
                         -55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
@@ -154,9 +155,9 @@
                           {% if p3.path == r.path %}
                             <div class="toc_entry">
                             {% if r.path == page.path %}
-                              <h5 class="toc_current">{{ r.title }}</h5>
+                              <h5 class="toc-current">{{ r.title }}</h5>
                             {% else %}
-                              <h5 class="toc_link"><a href="{{ r.url | remove_first: '/'}}">{{ r.title }}</a></h5>
+                              <h5 class="toc-link"><a href="{{ r.url | remove_first: '/'}}">{{ r.title }}</a></h5>
                             {% endif %}
                             </div>
                           {% endif %}
@@ -165,8 +166,8 @@
                     </div>
                     
                   {% else %}
-                    <h4 class="toc_link"><a href="{{ q.url | remove_first: '/'}}">{{ q.title }}</a></h4>
-                    <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc_arrow">
+                    <h4 class="toc-link"><a href="{{ q.url | remove_first: '/'}}">{{ q.title }}</a></h4>
+                    <svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="7" height="7" class="toc-arrow">
                         <g transform="translate(904.92214,-879.1482)"><path d="
                         m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
                         -55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
@@ -190,9 +191,9 @@
                       {% if p3.path == r.path %}
                         <div class="toc_entry">
                         {% if r.path == page.path %}
-                          <h5 class="toc_current">{{ r.title }}</h4>
+                          <h5 class="toc-current">{{ r.title }}</h4>
                         {% else %}
-                          <h5 class="toc_link"><a href="{{ r.url | remove_first: '/'}}">{{ r.title }}</a></h5>
+                          <h5 class="toc-link"><a href="{{ r.url | remove_first: '/'}}">{{ r.title }}</a></h5>
                         {% endif %}
                         </div>
                       {% endif %}
diff --git a/_layouts/docpage.html b/_layouts/docpage.html
index 4015314..040e7ab 100644
--- a/_layouts/docpage.html
+++ b/_layouts/docpage.html
@@ -50,10 +50,10 @@ limitations under the License.
         </div>
       </article>
       <div class="toc">
-          <div align="center">
-            <input class="docsearch-input" type="search" placeholder="Search docs..." autocomplete="off" spellcheck="false"/>
-          </div>
-          {% include toc.html %}
+        <div align="center">
+          <input class="docsearch-input" type="search" placeholder="Search docs..." autocomplete="off" spellcheck="false"/>
+        </div>
+        {% include toc.html %}
       </div>
     </div>
   </div>
diff --git a/_sass/docsearch.sass b/_sass/docsearch.sass
index 3e8b5d2..21f4946 100644
--- a/_sass/docsearch.sass
+++ b/_sass/docsearch.sass
@@ -21,7 +21,7 @@
     display: inline-block
     width: 100%
     appearance: none
-    background-color: rgb(245, 245, 250)
+    background-color: white
     border-radius: 6px
     border-style: solid
     border-width: 0px
@@ -31,9 +31,10 @@
     background-size: 16px 16px
     background-repeat: no-repeat
     background-position-y: center
-    background-position-x: 10px
+    background-position-x: 12px
     -webkit-appearance: none
     -moz-appearance: none
+    box-shadow: #e6e6e6 0px 0px 0px 1px inset
 
 .searchbox 
     display: inline-block
diff --git a/_sass/highlight.sass b/_sass/highlight.sass
index 613c0cd..e67ecd3 100644
--- a/_sass/highlight.sass
+++ b/_sass/highlight.sass
@@ -30,6 +30,9 @@ code, pre
 	padding: .2em .4em
 	color: rgb(16, 16, 16)
 	box-shadow: rgb(230, 230, 230) 0px 0px 0px 1px inset
+	white-space: pre-wrap
+	word-break: break-word
+	height: auto !important
 
 .highlight
 	line-height: 20px
diff --git a/_sass/royale-theme.sass b/_sass/royale-theme.sass
index 5df3dd9..8d4b202 100644
--- a/_sass/royale-theme.sass
+++ b/_sass/royale-theme.sass
@@ -215,27 +215,6 @@
 	.toc_and_doc
 		width: 90%
 
-.toc 
-	display: inline-block
-	margin-top: 80px
-	margin-left: 15px
-	margin-left: 15px
-	margin-bottom: 20px
-	flex-shrink: 0
-	width: 350px
-
-.toc_arrow
-	margin-left: 7px
-	width: 26px
-	opacity: .4
-	margin-bottom: 2px
-
-.toc_arrow_rot
-	width: 26px
-	margin-left: 7px
-	transform: rotateX(180deg)
-	margin-bottom: 2px
-
 .page-content
 	display: flex
 	min-height: calc(100vh - 60px)
@@ -260,59 +239,3 @@
 @media (max-width: 599px)
 	.page-content
 		flex-direction: column
-
-.menu_div2 
-	margin-left: 15px
-
-.accordion_content 
-	margin-left: 15px
-	font-family: Signika
-	font-weight: 600
-	font-style: normal
-	text-transform: none
-
-.toc_title_wrapper 
-	padding: 0px 20px
-	line-height: 1em
-	position: relative
-	cursor: pointer
-	display: block
-	font-family: Signika
-	font-weight: 600
-	font-style: normal
-	text-transform: none
-
-
-.toc_title_wrapper h3 
-	font-size: 20px
-	line-height: 28px
-	letter-spacing: 0px
-
-.accordion_content h4 
-	font-size: 18px
-	line-height: 24px
-	letter-spacing: 0px
-
-.accordion_content h5 	
-	font-size: 17px
-	line-height: 20px
-	letter-spacing: 0px
-
-.toc_link 
-	text-decoration: none
-	color: rgb(67, 147, 195)
-	position: relative
-	margin-bottom: 0
-	line-height: 1.4em
-	display: inline-block
-	user-select: none
-
-.toc_current 
-	color: rgb(0, 0, 0)
-	font-weight: 600
-	position: relative
-	margin-bottom: 0
-	line-height: 1.4em
-	display: inline-block
-	user-select: none
-	
\ No newline at end of file
diff --git a/_sass/sidebar.sass b/_sass/sidebar.sass
index 831f5a9..59f380c 100644
--- a/_sass/sidebar.sass
+++ b/_sass/sidebar.sass
@@ -12,92 +12,262 @@
  * limitations under the License.
  */
 
-.navbar
-    position: absolute
-    right: 0px
-    width: 300px
-    height: 100%
-    background-color: black
-    // text-align: center
-    transition: .3s ease
-
-    > .side-nav
-        list-style-type: none
-        padding: 0px
-        margin: 0px
-
-.nav-item
+.toc
     display: flex
+    flex-direction: column
+    flex: 0 0 300px
+    margin-top: 80px
+    background-color: #f7f7f7
+    padding: 20px 20px
+    border-radius: 10px
 
-    > .nav-link
-        text-decoration: none
-        color: white
-        font:
-            size: 1.1em
-        padding: 1em
-        flex: 1
-
-        &:hover
-            background-color: white
-            color: black
-
-.toggle-collapse
-    float: left
-    margin-left: -3.3em
-    margin-top: .5em
-    content: ""
-    outline: inherit
-    border: 0px
-    background: transparent
-
-/* Toggle Icon */
-.toggle-icon,
-.toggle-icon::before,
-.toggle-icon::after
-    content: ""
-    width: 30px
-    height: 3px
-    position: fixed
-    background-color: black
-    border-radius: 2em
-    border: 1px solid black
+@media (min-width: 600px)
+    .toc
+        // border-left: 1px solid #ececec
+        margin-left: 80px
+
+@media (max-width: 979px) and (min-width: 600px)
+    .toc
+        margin-left: 40px
+
+// media (min-width: 1100px)
+// 	.toc
+// 		flex: 0 0 300px
+
+// media (max-width: 1339px) and (min-width: 600px)
+// 	.toc
+// 		flex: 0 0 200px
+// 		margin-left: 80px
+
+// media (min-width: 2000px)
+// 	.toc
+// 		position: fixed
+// 		right: 0
+// 		width: 300px
+// 		z-index: 2
+
+// .toc 
+// 	display: inline-block
+// 	margin-top: 80px
+// 	margin-left: 15px
+// 	margin-left: 15px
+// 	margin-bottom: 20px
+// 	flex-shrink: 0
+// 	width: 350px
+
+// .sidebar
+//     display: flex
+//     flex-direction: column
+//     flex-grow: 0
+//     flex-shrink: 1
+//     flex-basis: auto
+//     justify-content: flex-start
+//     align-items: stretch
+
+//     width: 100%
+//     padding-left: 20px
+//     position: relative
+
+// media (min-width: 1100px)
+//     .sidebar
+//         padding-left: 40px
+
+// media (max-width: 599px)
+//     .sidebar
+//         padding-bottom: 100px
+
+.menu_div2 
+    margin-left: 15px
+
+.toc-title-arrow
+    display: inline-flex
+    align-items: center
+
+.toc-title-wrapper 
+    padding: 0px 0px
+    line-height: 1em
+    position: relative
     cursor: pointer
-    transition: .3s ease
-    margin-top: .8em   
-
-.toggle-icon::before
-    position: absolute
-    left: -1px
-    margin-top: -0.8em
-
-.toggle-icon::after
-    position: absolute
-    left: -1px
-    margin-top: -.6em
-    width: 20px
-
-.toggle-icon
-    width: 15px
-
-.show
-    .toggle-icon::after
-        width: 30px
-.show
-    .toggle-icon
-        width: 30px
+    display: block
+    font-family: Signika
+    font-weight: 600
+    font-style: normal
+    text-transform: none
+
+.toc-title-wrapper a
+    padding: 0px
+    background-color: transparent
+    border-bottom: none
+
+.toc-title-wrapper h3 
+    font-size: 16px
+    line-height: 28px
+    letter-spacing: 0px
+
+.accordion-content 
+    margin-left: 15px
+    font-family: Signika
+    font-weight: 600
+    font-style: normal
+    text-transform: none
+
+.accordion-content h4 
+    font-size: 14px
+    line-height: 24px
+    letter-spacing: 0px
+
+.accordion-content h5 	
+    font-size: 13px
+    line-height: 20px
+    letter-spacing: 0px
+
+.toc-link 
+    text-decoration: none
+    color: rgb(67, 147, 195)
+    position: relative
+    margin-bottom: 0
+    line-height: 1.4em
+    display: inline-block
+    user-select: none
+
+.toc-current 
+    text-decoration: none
+    color: black
+    position: relative
+    margin-bottom: 0
+    line-height: 1.4em
+    display: inline-block
+    user-select: none
+    // color: rgb(0, 0, 0)
+    // font-weight: 600
+    // position: relative
+    // margin-bottom: 0
+    // line-height: 1.4em
+    // display: inline-block
+    // user-select: none
+    // white-space: nowrap
+    // text-transform: uppercase
+
+.toc-arrow
+    // margin-left: 7px
+    width: 26px
+    opacity: .4
+    // margin-bottom: 2px
+
+.toc-arrow-rot
+    width: 26px
+    // margin-left: 7px
+    transform: rotateX(180deg)
+    // margin-bottom: 2px
+    
+// .toc-button
+//     cursor: pointer
+//     background-color: transparent
+//     border: 0
+//     margin-top: 10px
+
+// .ttoc-title-current
+//     color: #6d6d6d
+//     font-size: 14px
+//     font-weight: 700
+//     line-height: 3
+//     text-transform: uppercase
+//     letter-spacing: 0.08em
+
+// .toc-arrow
+//     margin-left: 7px
+//     transform: rotateX(180deg)
+//     transition: -webkit-transform 0.2s ease,transform 0.2s ease
+//     -webkit-transform: rotateX(180deg)
+//     -webkit-transition: -webkit-transform 0.2s ease,transform 0.2s ease
+//     -moz-transition: transform 0.2s ease
+
+// .navbar
+//     position: absolute
+//     right: 0px
+//     width: 300px
+//     height: 100%
+//     background-color: black
+//     // text-align: center
+//     transition: .3s ease
+
+//     > .side-nav
+//         list-style-type: none
+//         padding: 0px
+//         margin: 0px
+
+// .nav-item
+//     display: flex
+
+//     > .nav-link
+//         text-decoration: none
+//         color: white
+//         font:
+//             size: 1.1em
+//         padding: 1em
+//         flex: 1
+
+//         &:hover
+//             background-color: white
+//             color: black
+
+// .toggle-collapse
+//     float: left
+//     margin-left: -3.3em
+//     margin-top: .5em
+//     content: ""
+//     outline: inherit
+//     border: 0px
+//     background: transparent
+
+// /* Toggle Icon */
+// .toggle-icon,
+// .toggle-icon::before,
+// .toggle-icon::after
+//     content: ""
+//     width: 30px
+//     height: 3px
+//     position: fixed
+//     background-color: black
+//     border-radius: 2em
+//     border: 1px solid black
+//     cursor: pointer
+//     transition: .3s ease
+//     margin-top: .8em   
+
+// .toggle-icon::before
+//     position: absolute
+//     left: -1px
+//     margin-top: -0.8em
+
+// .toggle-icon::after
+//     position: absolute
+//     left: -1px
+//     margin-top: -.6em
+//     width: 20px
+
+// .toggle-icon
+//     width: 15px
+
+// .show
+//     .toggle-icon::after
+//         width: 30px
+// .show
+//     .toggle-icon
+//         width: 30px
     
-.nav-item 
-    > .site-name
-        text-decoration: none
-        padding: 1.3em
-        font:
-            size: 2em
-        color: white
-    &:last-child
-        > .nav-link
-            i
-                padding: .5em
-    &:hover:last-child
-        > .nav-link
-            background-color: black
-            color: white
+// .nav-item 
+//     > .site-name
+//         text-decoration: none
+//         padding: 1.3em
+//         font:
+//             size: 2em
+//         color: white
+//     &:last-child
+//         > .nav-link
+//             i
+//                 padding: .5em
+//     &:hover:last-child
+//         > .nav-link
+//             background-color: black
+//             color: white
diff --git a/assets/css/styles.sass b/assets/css/styles.sass
index e05df94..a8ab926 100644
--- a/assets/css/styles.sass
+++ b/assets/css/styles.sass
@@ -22,6 +22,6 @@
 @import "markdown"
 @import "highlight"
 @import "royale-theme"
-// import "sidebar"
+@import "sidebar"
 @import "docsearch"