Igosuki / compass-mixins

A collection of compass' stylesheet for bower dependencies and libsass
Other
592 stars 198 forks source link

Helper functions font-files and font-url are missing, resulting in broken font-face mixins #36

Open hashworks opened 9 years ago

hashworks commented 9 years ago

The regarded ruby sources are font_files.rb and urls.rb.

hashworks commented 9 years ago

The url-functions issue already exists, see #20.

kidd001 commented 9 years ago

Does it explain why my font-face mixin didn't get compiled at all?

hashworks commented 9 years ago

Propably not. In my case they came out fine, but with font-url and font-files in them.

Igosuki commented 9 years ago

These haven't been implemented yet, I've added them to the migration issue

vredeling commented 7 years ago

Is this project abandoned? Seems weird to implement the font-face mixin and not implement the font-files mixin.

SergiArias commented 7 years ago

My workaround (by using compass with yeoman webapp) was to create this function: @function font-url($path) { @return url('#{$path}'); }

And this one:

@function font-files($font-name, $path, $formats...) {
  $full: ''; 
  @for $i from 1 through length($formats) {
    $full: $full + 'url("#{$path}.' + nth($formats,$i);
    @if nth($formats,$i) == 'ttf' {
      $full: $full + '") format("' + 'truetype")'
    }@else if nth($formats,$i) == 'svg' {
      $full: $full + '#' + $font-name + '") format("' + nth($formats,$i) + '")';
    }@else {
      $full: $full + '") format("' + nth($formats,$i) + '")';
    }
    @if $i!=length($formats) { $full: $full + ', ';}
  }
  @return unquote($full);
}
alphaelf commented 7 years ago

@SergiArias thanks for add helper funtions.

however font-files function must fix $font-name on: $full: $full + 'url("#{$path}.' + nth($formats,$i);

so for use compass font-face mixin: