Skip to content

Commit

Permalink
refactor: update .nav-group-toggle icon
Browse files Browse the repository at this point in the history
  • Loading branch information
mrholek committed Mar 15, 2021
1 parent 0934ada commit f5047b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
8 changes: 6 additions & 2 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1696,11 +1696,15 @@ $sidebar-nav-group-items-transition: height .15s ease !default;
$sidebar-nav-group-toggle-show-color: $sidebar-nav-link-color !default;

$sidebar-nav-group-indicator-color: $medium-emphasis-inverse !default;
$sidebar-nav-group-indicator: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 14'%3E%3Cpath fill='#{$sidebar-nav-group-indicator-color}' d='M9.148 2.352l-4.148 4.148 4.148 4.148q0.148 0.148 0.148 0.352t-0.148 0.352l-1.297 1.297q-0.148 0.148-0.352 0.148t-0.352-0.148l-5.797-5.797q-0.148-0.148-0.148-0.352t0.148-0.352l5.797-5.797q0.148-0.148 0.352-0.148t0.352 0.148l1.297 1.297q0.148 0.148 0.148 0.352t-0.148 0.352z'/%3E%3C/svg%3E"), "#", "%23") !default;
// $sidebar-nav-group-indicator: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 14'%3E%3Cpath fill='#{$sidebar-nav-group-indicator-color}' d='M9.148 2.352l-4.148 4.148 4.148 4.148q0.148 0.148 0.148 0.352t-0.148 0.352l-1.297 1.297q-0.148 0.148-0.352 0.148t-0.352-0.148l-5.797-5.797q-0.148-0.148-0.148-0.352t0.148-0.352l5.797-5.797q0.148-0.148 0.352-0.148t0.352 0.148l1.297 1.297q0.148 0.148 0.148 0.352t-0.148 0.352z'/%3E%3C/svg%3E"), "#", "%23") !default;
$sidebar-nav-group-indicator-hover-color: $sidebar-nav-link-hover-color !default;
$sidebar-nav-group-indicator-hover: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 14'%3E%3Cpath fill='#{$sidebar-nav-group-indicator-hover-color}' d='M9.148 2.352l-4.148 4.148 4.148 4.148q0.148 0.148 0.148 0.352t-0.148 0.352l-1.297 1.297q-0.148 0.148-0.352 0.148t-0.352-0.148l-5.797-5.797q-0.148-0.148-0.148-0.352t0.148-0.352l5.797-5.797q0.148-0.148 0.352-0.148t0.352 0.148l1.297 1.297q0.148 0.148 0.148 0.352t-0.148 0.352z'/%3E%3C/svg%3E"), "#", "%23") !default;
// $sidebar-nav-group-indicator-hover: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 14'%3E%3Cpath fill='#{$sidebar-nav-group-indicator-hover-color}' d='M9.148 2.352l-4.148 4.148 4.148 4.148q0.148 0.148 0.148 0.352t-0.148 0.352l-1.297 1.297q-0.148 0.148-0.352 0.148t-0.352-0.148l-5.797-5.797q-0.148-0.148-0.148-0.352t0.148-0.352l5.797-5.797q0.148-0.148 0.352-0.148t0.352 0.148l1.297 1.297q0.148 0.148 0.148 0.352t-0.148 0.352z'/%3E%3C/svg%3E"), "#", "%23") !default;
$sidebar-nav-group-indicator-transition: transform .15s !default;

$sidebar-nav-group-indicator: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='#{$sidebar-nav-group-indicator-color}'><path fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/></svg>") !default;
$sidebar-nav-group-indicator-hover: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='#{$sidebar-nav-group-indicator-hover-color}'><path fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/></svg>") !default;


$sidebar-footer-height: auto !default;
$sidebar-footer-padding-y: .75rem !default;
$sidebar-footer-padding-x: 1rem !default;
Expand Down
13 changes: 6 additions & 7 deletions scss/sidebar/_sidebar-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
}

&.nav-dropdown-toggle::after {
background-image: var(--#{$variable-prefix}sidebar-nav-group-indicator-hover, $sidebar-nav-group-indicator-hover);
background-image: var(--#{$variable-prefix}sidebar-nav-group-indicator-hover, escape-svg($sidebar-nav-group-indicator-hover));
}
}
}
Expand All @@ -75,7 +75,7 @@
}

&.nav-group-toggle::after {
background-image: var(--#{$variable-prefix}sidebar-nav-group-indicator-hover, $sidebar-nav-group-indicator-hover);
background-image: var(--#{$variable-prefix}sidebar-nav-group-indicator-hover, escape-svg($sidebar-nav-group-indicator-hover));
}
}
}
Expand Down Expand Up @@ -116,7 +116,7 @@
}

> .nav-group-toggle::after {
transform: rotate(-90deg);
transform: rotate(180deg);
}

+ .show {
Expand All @@ -130,15 +130,14 @@

&::after {
display: block;
flex: 0 8px;
height: 8px;
flex: 0 12px;
height: 12px;
@include ltr-rtl("margin-left", auto);
content: "";
background-image: var(--#{$variable-prefix}sidebar-nav-group-indicator, $sidebar-nav-group-indicator);
background-image: var(--#{$variable-prefix}sidebar-nav-group-indicator, escape-svg($sidebar-nav-group-indicator));
background-repeat: no-repeat;
background-position: center;
@include transition($sidebar-nav-group-indicator-transition);
// transition: transform $layout-transition-speed; TODO: fix
}
}

Expand Down

0 comments on commit f5047b3

Please sign in to comment.