]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Move sidebar icon to CSS
authorMark Otto <markdotto@gmail.com>
Tue, 16 Jul 2019 23:00:46 +0000 (16:00 -0700)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 17 Jul 2019 13:21:47 +0000 (16:21 +0300)
site/layouts/partials/docs-sidebar.html
site/layouts/partials/icons/arrow.svg [deleted file]
site/static/docs/4.3/assets/scss/_sidebar.scss

index 200f8cd4171669714c2af8ca5e2f8e6d114d0f55..7f6f1eb2053583458ce329e0b58dc1f27a56af4b 100644 (file)
@@ -17,7 +17,6 @@
 
       <li class="bd-sidenav-group my-1{{ if $active_group }} active{{ end }} js-sidenav-group">
         <a class="d-inline-flex align-items-center bd-sidenav-group-link" href="/docs/{{ $.Site.Params.docs_version }}/{{ $group_slug }}/{{ if $group.pages }}{{ $link_slug }}/{{ end }}">
-          {{- partial "icons/arrow.svg" (dict "class" "bd-sidenav-group-link-icon" "width" "16" "height" "16") -}}
           <div>{{- $group.title -}}</div>
         </a>
 
@@ -38,7 +37,9 @@
 
     <li class="my-3 mx-4 border-top"></li>
     <li class="bd-sidenav-group pl-3">
-      <a class="d-inline-flex bd-sidenav-group-link" href="/docs/{{ $.Site.Params.docs_version }}/migration/">Migration</a>
+      <a class="d-inline-flex align-items-center bd-sidenav-group-link" href="/docs/{{ $.Site.Params.docs_version }}/migration/">
+        <div>Migration</div>
+      </a>
     </li>
   </ul>
 </nav>
diff --git a/site/layouts/partials/icons/arrow.svg b/site/layouts/partials/icons/arrow.svg
deleted file mode 100644 (file)
index 097c1a2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg"{{ with .width }} width="{{ . }}"{{ end }}{{ with .height }} height="{{ . }}"{{ end }}{{ with .class }} class="{{ . }}"{{ end }} viewBox="0 0 16 16"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 14l6-6-6-6"/></svg>
index c18a42053b6413b3796e7b1f5d8777f0c61f9b1b..834300057fdaf4f1d9b7157fa83142dd7612ac93 100644 (file)
   color: rgba(0, 0, 0, .65);
   @include border-radius(.25rem);
 
+  &::before {
+    display: inline-block;
+    width: .875rem;
+    height: .875rem;
+    margin-right: .25rem;
+    content: "";
+    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" role="img"><path stroke="currentColor" stroke-width="2" d="M5 14l6-6-6-6" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"/></svg>');
+    background-repeat: no-repeat;
+    background-position: center center;
+    opacity: .5;
+  }
+
   > * { pointer-events: none; }
 
   &:hover {
   }
 }
 
-.bd-sidenav-group-link-icon {
-  width: .875rem;
-  margin-right: .25rem;
-  opacity: .5;
-}
-
 .bd-sidenav-group {
   &.active {
-    .bd-sidenav-group-link-icon {
+    .bd-sidenav-group-link::before {
       transform: rotate(90deg);
     }
 
   }
 }
 
+// Hide icon on last item
+.bd-sidenav-group:last-child .bd-sidenav-group-link::before {
+  display: none;
+}
+
 // All levels of nav
 .bd-sidebar .nav {
   padding-left: 1.25rem;