github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/website/source/assets/stylesheets/hashicorp-shared/_hashicorp-sidebar.scss (about) 1 // 2 // Hashicorp Sidebar 3 // - Shared throughout projects 4 // - Edits should not be made here 5 // -------------------------------------------------- 6 7 // Base variables 8 // -------------------------------------------------- 9 $screen-tablet: 768px; 10 11 $gray-darker: #212121; // #212121 - text 12 $gray-secondary: #757575; // #757575 - secondary text, icons 13 $gray: #bdbdbd; // #bdbdbd - hint text 14 $gray-light: #e0e0e0; // #e0e0e0 - divider 15 $gray-lighter: #f5f5f5; // #f5f5f5 - background 16 $link-color: $gray-darker; 17 $link-bg: transparent; 18 $link-hover-color: $gray-lighter; 19 $link-hover-bg: $gray-lighter; 20 $link-active-color: $gray-darker; 21 $link-active-bg: $gray-light; 22 $link-disabled-color: $gray-light; 23 $link-disabled-bg: transparent; 24 25 /* -- Sidebar style ------------------------------- */ 26 27 // Sidebar variables 28 // -------------------------------------------------- 29 $zindex-sidebar-fixed: 1035; 30 31 $sidebar-desktop-width: 280px; 32 $sidebar-width: 240px; 33 34 $sidebar-padding: 16px; 35 $sidebar-divider: $sidebar-padding/2; 36 37 $sidebar-icon-width: 40px; 38 $sidebar-icon-height: 20px; 39 40 @mixin sidebar-nav-base { 41 text-align: center; 42 43 &:last-child{ 44 border-bottom: none; 45 } 46 47 li > a { 48 background-color: $link-bg; 49 } 50 li:hover > a { 51 background-color: $link-hover-bg; 52 } 53 li:focus > a, li > a:focus { 54 background-color: $link-bg; 55 } 56 57 > .open > a { 58 &, 59 &:hover, 60 &:focus { 61 background-color: $link-hover-bg; 62 } 63 } 64 65 > .active > a { 66 &, 67 &:hover, 68 &:focus { 69 background-color: $link-active-bg; 70 } 71 } 72 > .disabled > a { 73 &, 74 &:hover, 75 &:focus { 76 background-color: $link-disabled-bg; 77 } 78 } 79 80 // Dropdown menu items 81 > .dropdown { 82 // Remove background color from open dropdown 83 > .dropdown-menu { 84 background-color: $link-hover-bg; 85 86 > li > a { 87 &:focus { 88 background-color: $link-hover-bg; 89 } 90 &:hover { 91 background-color: $link-hover-bg; 92 } 93 } 94 95 > .active > a { 96 &, 97 &:hover, 98 &:focus { 99 color: $link-active-color; 100 background-color: $link-active-bg; 101 } 102 } 103 } 104 } 105 } 106 107 // 108 // Sidebar 109 // -------------------------------------------------- 110 111 // Sidebar Elements 112 // 113 // Basic style of sidebar elements 114 .sidebar { 115 position: relative; 116 display: block; 117 min-height: 100%; 118 overflow-y: auto; 119 overflow-x: hidden; 120 border: none; 121 @include transition(all 0.5s cubic-bezier(0.55, 0, 0.1, 1)); 122 @include clearfix(); 123 background-color: $white; 124 125 ul{ 126 padding-left: 0; 127 list-style-type: none; 128 } 129 130 .sidebar-divider, .divider { 131 width: 80%; 132 height: 1px; 133 margin: 8px auto; 134 background-color: lighten($gray, 20%); 135 } 136 137 // Sidebar heading 138 //---------------- 139 .sidebar-header { 140 position: relative; 141 margin-bottom: $sidebar-padding; 142 @include transition(all .2s ease-in-out); 143 } 144 145 .sidebar-image { 146 padding-top: 24px; 147 img { 148 display: block; 149 margin: 0 auto; 150 } 151 } 152 153 154 // Sidebar icons 155 //---------------- 156 .sidebar-icon { 157 display: inline-block; 158 height: $sidebar-icon-height; 159 margin-right: $sidebar-divider; 160 text-align: left; 161 font-size: $sidebar-icon-height; 162 vertical-align: middle; 163 164 &:before, &:after { 165 vertical-align: middle; 166 } 167 } 168 169 .sidebar-nav { 170 margin: 0; 171 padding: 0; 172 173 @include sidebar-nav-base(); 174 175 // Links 176 //---------------- 177 li { 178 position: relative; 179 list-style-type: none; 180 text-align: center; 181 182 a { 183 position: relative; 184 cursor: pointer; 185 user-select: none; 186 @include hashi-a-style-core(); 187 188 svg{ 189 top: 2px; 190 width: 14px; 191 height: 14px; 192 margin-bottom: -2px; 193 margin-right: 4px; 194 } 195 } 196 } 197 } 198 } 199 200 // Sidebar toggling 201 // 202 // Hide sidebar 203 .sidebar { 204 width: 0; 205 @include translate3d(-$sidebar-desktop-width, 0, 0); 206 207 &.open { 208 min-width: $sidebar-desktop-width; 209 width: $sidebar-desktop-width; 210 @include translate3d(0, 0, 0); 211 } 212 } 213 214 // Sidebar positions: fix the left/right sidebars 215 .sidebar-fixed-left, 216 .sidebar-fixed-right, 217 .sidebar-stacked { 218 position: fixed; 219 top: 0; 220 bottom: 0; 221 z-index: $zindex-sidebar-fixed; 222 } 223 .sidebar-stacked { 224 left: 0; 225 } 226 .sidebar-fixed-left { 227 left: 0; 228 box-shadow: 2px 0px 25px rgba(0,0,0,0.15); 229 -webkit-box-shadow: 2px 0px 25px rgba(0,0,0,0.15); 230 } 231 .sidebar-fixed-right { 232 right: 0; 233 box-shadow: 0px 2px 25px rgba(0,0,0,0.15); 234 -webkit-box-shadow: 0px 2px 25px rgba(0,0,0,0.15); 235 236 @include translate3d($sidebar-desktop-width, 0, 0); 237 &.open { 238 @include translate3d(0, 0, 0); 239 } 240 .icon-material-sidebar-arrow:before { 241 content: "\e614"; // icon-material-arrow-forward 242 } 243 } 244 245 // Sidebar size 246 // 247 // Change size of sidebar and sidebar elements on small screens 248 @media (max-width: $screen-tablet) { 249 .sidebar.open { 250 min-width: $sidebar-width; 251 width: $sidebar-width; 252 } 253 254 .sidebar .sidebar-header { 255 //height: $sidebar-width * 9/16; // 16:9 header dimension 256 } 257 258 .sidebar .sidebar-image { 259 /* img { 260 width: $sidebar-width/4 - $sidebar-padding; 261 height: $sidebar-width/4 - $sidebar-padding; 262 } */ 263 } 264 } 265 266 .sidebar-overlay { 267 visibility: hidden; 268 position: fixed; 269 top: 0; 270 left: 0; 271 right: 0; 272 bottom: 0; 273 opacity: 0; 274 background: $white; 275 z-index: $zindex-sidebar-fixed - 1; 276 277 -webkit-transition: visibility 0 linear .4s,opacity .4s cubic-bezier(.4,0,.2,1); 278 -moz-transition: visibility 0 linear .4s,opacity .4s cubic-bezier(.4,0,.2,1); 279 transition: visibility 0 linear .4s,opacity .4s cubic-bezier(.4,0,.2,1); 280 -webkit-transform: translateZ(0); 281 -moz-transform: translateZ(0); 282 -ms-transform: translateZ(0); 283 -o-transform: translateZ(0); 284 transform: translateZ(0); 285 } 286 287 .sidebar-overlay.active { 288 opacity: 0.3; 289 visibility: visible; 290 -webkit-transition-delay: 0; 291 -moz-transition-delay: 0; 292 transition-delay: 0; 293 }