cloudhead/less.js — Issue #582: @font-face mixin
Author: greed83
Created: 2012-01-19 07:14:05+00:00
State: open

Hey,

This is more a suggestion/inquiry and not so much a issue.

I would liek to be able to create a @font-face mixin and its not working. I'm pretty sure this is because what I want to do is outside of the current scope of LESS.

Heres my proposed mixin:
// Fontface

.font-face (@fontname, @fontfile) {
@font-face {
font-family: @fontname;
src: url('../fonts/' + @fontfile '-webfont.eot');
src: url('../fonts/' + @fontfile '-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/' + @fontfile '-webfont.woff') format('woff'),
url('../fonts/' + @fontfile '-webfont.ttf') format('truetype'),
url('../fonts/' + @fontfile '-webfont.svg#' + @fontname) format('svg');
font-weight: normal;
font-style: normal;
}
}

If there is an existing way of achieving this awesome, i'd love to learn, but if not i think this would be a pretty powerful addition and also have other applications for other mixins!

Loving Less!!!

Cheers!