.toggle { line-height: 0; .toggle-line { background: white; display: block; height: 2px; left: 0; position: relative; top: 0; transition: all .4s; width: 100%; &:not(:first-child) { margin-top: 3px; } } } if (hexo-config('sidebar.position') == 'right') { .toggle.toggle-arrow { .toggle-line:first-child { top: 2px; transform: rotate(-45deg); width: 50%; } .toggle-line:nth-child(2) { width: 90%; } .toggle-line:last-child { top: -2px; transform: rotate(45deg); width: 50%; } } .toggle.toggle-close { .toggle-line:first-child { top: 5px; transform: rotate(-45deg); } .toggle-line:nth-child(2) { opacity: 0; } .toggle-line:last-child { top: -5px; transform: rotate(45deg); } } } else { .toggle.toggle-arrow { .toggle-line:first-child { left: 50%; top: 2px; transform: rotate(45deg); width: 50%; } .toggle-line:nth-child(2) { left: 2px; width: 90%; } .toggle-line:last-child { left: 50%; top: -2px; transform: rotate(-45deg); width: 50%; } } .toggle.toggle-close { .toggle-line:first-child { transform: rotate(-45deg); top: 5px; } .toggle-line:nth-child(2) { opacity: 0; } .toggle-line:last-child { transform: rotate(45deg); top: -5px; } } }