From ebcc3ff9af096ab95e473328159d6c6dc2843d67 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 16 Jul 2019 16:00:46 -0700 Subject: [PATCH] Move sidebar icon to CSS --- site/layouts/partials/docs-sidebar.html | 5 ++-- site/layouts/partials/icons/arrow.svg | 1 - .../static/docs/4.3/assets/scss/_sidebar.scss | 25 +++++++++++++------ 3 files changed, 21 insertions(+), 10 deletions(-) delete mode 100644 site/layouts/partials/icons/arrow.svg diff --git a/site/layouts/partials/docs-sidebar.html b/site/layouts/partials/docs-sidebar.html index 200f8cd417..7f6f1eb205 100644 --- a/site/layouts/partials/docs-sidebar.html +++ b/site/layouts/partials/docs-sidebar.html @@ -17,7 +17,6 @@
  • - {{- partial "icons/arrow.svg" (dict "class" "bd-sidenav-group-link-icon" "width" "16" "height" "16") -}}
    {{- $group.title -}}
    @@ -38,7 +37,9 @@
  • - Migration + +
    Migration
    +
  • diff --git a/site/layouts/partials/icons/arrow.svg b/site/layouts/partials/icons/arrow.svg deleted file mode 100644 index 097c1a2d54..0000000000 --- a/site/layouts/partials/icons/arrow.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/site/static/docs/4.3/assets/scss/_sidebar.scss b/site/static/docs/4.3/assets/scss/_sidebar.scss index c18a42053b..834300057f 100644 --- a/site/static/docs/4.3/assets/scss/_sidebar.scss +++ b/site/static/docs/4.3/assets/scss/_sidebar.scss @@ -43,6 +43,18 @@ 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,'); + background-repeat: no-repeat; + background-position: center center; + opacity: .5; + } + > * { pointer-events: none; } &:hover { @@ -52,15 +64,9 @@ } } -.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); } @@ -74,6 +80,11 @@ } } +// 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;