kill the loops and branches with fire

removes the @each and @ifs and makes the tooltip code a bit more readable
pull/2795/head
Florian Kraft 10 years ago
parent 3db283ffe4
commit 0cde7656b1
  1. 83
      app/assets/stylesheets/content/_tooltips.sass

@ -107,7 +107,6 @@ $tooltip--arrow-size: 6px
opacity: 1 opacity: 1
visibility: visible visibility: visible
&.-multiline &.-multiline
&:after &:after
height: auto height: auto
@ -117,47 +116,47 @@ $tooltip--arrow-size: 6px
white-space: normal white-space: normal
text-align: left text-align: left
@each $position in left, right &.tooltip--right
&.tooltip--#{$position} @extend %tooltip--left-right
@extend %tooltip--left-right &:before, &:after
@if $position == 'right' left: 100%
&:before, &:after &:before
left: 100% margin-left: -2px
&:before &:after
margin-left: -2px margin-left: 10px
&:after
margin-left: 10px &.tooltip--left
@else @extend %tooltip--left-right
&:before, &:after &:before, &:after
right: 100% right: 100%
&:before &:before
margin-right: -2px margin-right: -2px
&:after &:after
margin-right: 10px margin-right: 10px
@each $position in top, bottom &.tooltip--top
&.tooltip--#{$position} @extend %tooltip--top-bottom
@extend %tooltip--top-bottom &:before, &:after
@if $position == 'top' bottom: 100%
&:before, &:after &:before
bottom: 100% margin-bottom: $tooltip--arrow-size * -1 + 1
&:before &:after
margin-bottom: $tooltip--arrow-size * -1 + 1 margin-bottom: 7px
&:after &:hover
margin-bottom: 7px &:before, &:after
&:hover transform: translate(-50%, 0px)
&:before, &:after
transform: translate(-50%, 0px) &.tooltip--bottom
@else @extend %tooltip--top-bottom
&:before, &:after &:before, &:after
top: 100% top: 100%
&:before &:before
margin-top: $tooltip--arrow-size * -1 + 1 margin-top: $tooltip--arrow-size * -1 + 1
&:after &:after
margin-top: 7px margin-top: 7px
&:hover &:hover
&:before, &:after &:before, &:after
transform: translate(-50%, 0) transform: translate(-50%, 0)
// tooltips for table content (TODO: legacy?) // tooltips for table content (TODO: legacy?)
table table

Loading…
Cancel
Save