sass - SCSS - Understanding this Calculation -


in topic ask smarter way write in scss @for function, cool function. problem didnt understand it... need last step.

$sidenavwidth: 320px;  html {   body {      .messenger {        @for $i 1 through 6 {         $z: '';         @if ($i < 10) {           $z: '0';         }         &.item-#{$z}#{$i} {           right: ($sidenavwidth * $i) + (($i * 2) * 8);         }       }      }      &.sidenav-open {       .messenger {         @for $i 1 through 6 {           $z: '';           @if ($i < 10) {             $z: '0';           }           &.item-#{$z}#{$i} {             right: ($sidenavwidth * $i) + (($i * 2) * 8);           }         }       }     }    } } 

i think people understand allready trying do. sidenav default closed. dont need 320px default in "right" property. if sidenav opend, need it.

what must change on code, work?

best regards!


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -