E
E
Egor Trubnikov-Panov2014-03-19 11:08:14
css
Egor Trubnikov-Panov, 2014-03-19 11:08:14

Less incomprehensible space. How to remove it?

.rotate(@degrees,@size) {
  -moz-transform: rotate(@degrees+deg) translate(@size, 0px);
  -o-transform: rotate(@degrees+deg) translate(@size, 0px);
  -webkit-transform: rotate(@degrees+deg) translate(@size, 0px);
  transform: rotate(@degrees+deg) translate(@size, 0px);
}

@arm_count: 12;
@size: 5px;
  
.ray
  {
    .while (@index) when (@index > 0) {
        @ratio: @index/@arm_count;
        @angle: @ratio*360;
      @t: ~":nth-child(@{index})";
      &@{t} {
        .rotate(~"@{angle}", @size)
      }
      .while(@index - 1);
    }
    .while (0) {}
    .while (@arm_count);
  }

it turns out
.ray:nth-child(12) {
  -moz-transform: rotate(360 deg) translate(5px, 0px);
  -o-transform: rotate(360 deg) translate(5px, 0px);
  -webkit-transform: rotate(360 deg) translate(5px, 0px);
  transform: rotate(360 deg) translate(5px, 0px);
}

(360_пробел_deg)
how to get rid of spaces?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor Trubnikov-Panov, 2014-03-19
@EAT

decided like this:

.rotate(@degrees,@size) {
  @deg:~"@{degrees}deg";
  -moz-transform: rotate(@deg) translate(@size, 0px);
  -o-transform: rotate(@deg) translate(@size, 0px);
  -webkit-transform: rotate(@deg) translate(@size, 0px);
  transform: rotate(@deg) translate(@size, 0px);
}

T
trueClearThinker, 2014-03-19
@trueClearThinker

So have you tried it?

.rotate(@degrees,@size) {
  -moz-transform: rotate(~"@{degrees}deg") translate(@size, 0px);
  -o-transform: rotate(~"@{degrees}deg") translate(@size, 0px);
  -webkit-transform: rotate(~"@{degrees}deg") translate(@size, 0px);
  transform: rotate(~"@{degrees}deg") translate(@size, 0px);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question