V
V
Vitalik Cherny2017-05-28 17:42:57
css
Vitalik Cherny, 2017-05-28 17:42:57

Why does scss compile like this? What is "r3waic"?

I created an icon font on Icomoon and saw the following.
variables.scss

$icomoon-font-path: "fonts" !default;
$icon-bell: "\e900";
$icon-like: "\e901";
$icon-paceholder: "\e902";
$icon-search: "\e903";
$icon-star: "\e904";
$icon-vision: "\e905";
$icon-vision-off: "\e906";
$icon-angle-left: "\e907";
$icon-angle-right: "\e908";
$icon-arrow-right: "\e909";
$icon-angle-bottom: "\e90a";
$icon-chat-angle-bottom: "\e90b";
$icon-chat-angle-top: "\e90c";

style.scss
@import "variables";

@font-face {
  font-family: 'Icomoon';
  src:  url('#{$icomoon-font-path}/Icomoon.eot?r3waic');
  src:  url('#{$icomoon-font-path}/Icomoon.eot?r3waic#iefix') format('embedded-opentype'),
    url('#{$icomoon-font-path}/Icomoon.ttf?r3waic') format('truetype'),
    url('#{$icomoon-font-path}/Icomoon.woff?r3waic') format('woff'),
    url('#{$icomoon-font-path}/Icomoon.svg?r3waic#Icomoon') format('svg');
  font-weight: normal;
  font-style: normal;
}

[class^="icon-"], [class*=" icon-"] {
  /* use !important to prevent issues with browser extensions that change fonts */
  font-family: 'Icomoon' !important;
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;

  /* Better Font Rendering =========== */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-bell {
  &:before {
    content: $icon-bell;
  }
}
.icon-like {
  &:before {
    content: $icon-like;
  }
}
.icon-paceholder {
  &:before {
    content: $icon-paceholder;
  }
}
.icon-search {
  &:before {
    content: $icon-search;
  }
}
.icon-star {
  &:before {
    content: $icon-star;
  }
}
.icon-vision {
  &:before {
    content: $icon-vision;
  }
}
.icon-vision-off {
  &:before {
    content: $icon-vision-off;
  }
}
.icon-angle-left {
  &:before {
    content: $icon-angle-left;
  }
}
.icon-angle-right {
  &:before {
    content: $icon-angle-right;
  }
}
.icon-arrow-right {
  &:before {
    content: $icon-arrow-right;
  }
}
.icon-angle-bottom {
  &:before {
    content: $icon-angle-bottom;
  }
}
.icon-chat-angle-bottom {
  &:before {
    content: $icon-chat-angle-bottom;
  }
}
.icon-chat-angle-top {
  &:before {
    content: $icon-chat-angle-top;
  }
}

When compiling to css in place of the variable is.
50fe6d41ff09467897df4ccb16b6b5b0.jpg
Despite this, css works fine, but on the condition that the path to the font will be "r3waic".
5ba5cc1bcfa04f588dc03f10edbaa72a.jpg
I use mixins to build fonts, but this "r3waic" interferes with generating the correct font.
With each new build, a new line in the path.
mixin.scss
@mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: false ) {
  @font-face {
    font-family: $font-family;
    font-weight: $weight;
    font-style: $style;

    @if $asset-pipeline == true {
      src: font-url('#{$file-path}.eot');
      src: font-url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
      font-url('#{$file-path}.woff2') format('woff2'),
      font-url('#{$file-path}.woff') format('woff'),
      font-url('#{$file-path}.ttf') format('truetype'),
      font-url('#{$file-path}.svg##{$font-family}') format('svg');
    } @else {
        src: url('#{$file-path}.eot');
        src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
        url('#{$file-path}.woff2') format('woff2'),
        url('#{$file-path}.woff') format('woff'),
        url('#{$file-path}.ttf') format('truetype'),
        url('#{$file-path}.svg##{$font-family}') format('svg');
    }
  }
}

@mixin icomoon($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: false ) {
  @font-face {
    font-family: $font-family;
    font-weight: $weight;
    font-style: $style;

    src: url('#{$file-path}.eot');
    src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
    url('#{$file-path}.woff') format('woff'),
    url('#{$file-path}.ttf') format('truetype'),
    url('#{$file-path}.svg##{$font-family}') format('svg');
  }
}

Please tell me how to generate normal fonts in css.
$icon-bell: "\e900";
$icon-like: "\e901";
$icon-paceholder: "\e902";
$icon-search: "\e903";
$icon-star: "\e904";
$icon-vision: "\e905";
$icon-vision-off: "\e906";
$icon-angle-left: "\e907";
$icon-angle-right: "\e908";
$icon-arrow-right: "\e909";
$icon-angle-bottom: "\e90a";
$icon-chat-angle-bottom: "\e90b";
$icon-chat-angle-top: "\e90c";

And how to deal with "r3waic".

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2017-05-28
@sim3x

What does this line "?2irtgd" belong to?

it's just cache flush via query string

Z
zooks, 2017-05-28
@zooks

If you need to throw a cache, instead of this heresy, it is better to indicate the date:Icomoon.eot?20170528

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question