jessicamarcus
6/6/2017 - 9:14 PM

preserve unicode escapes when processing SCSS => CSS

preserve unicode escapes when processing SCSS => CSS

$icons-map: (
  // leave the starting backslash out of the unicode escape string
  clock-o: 'f017',
  file-text-o: 'f0f6',
  list-ul: 'f0ca',
  thumbs-up: 'f164',
  user: 'f007'
);

@mixin create-icon($fontawesome-icon-name) {
  font-family: 'FontAwesome';

  &:after {
    // node-sass will interpret unicode escapes as unicode characters otherwise
    content: unquote('\'\\') + map-get($icons-map, $fontawesome-icon-name) + unquote('\'');
  }
}