0

I call a mixin less function twice with different parameters but the result is the same and created by first parameters. There is a example:

Input:

.font-face (@fontName, @fontFileName)
{
    @font-face {
        font-family: @fontName;
        src: url("../../fonts/@{fontFileName}.eot");
        src: url("../../fonts/@{fontFileName}.eot?#iefix") format("embedded-opentype"),
             url("../../fonts/@{fontFileName}.woff") format("woff"),
             url("../../fonts/@{fontFileName}.ttf") format("truetype");
        font-weight: normal;
        font-style: normal;
    }
}

.font-face ("BMitra", "BMitra");
.font-face ("BMitraBold", "BMitraBold");

Output:

@font-face {
  font-family: "BMitra";
  src: url("../../fonts/BMitra.eot");
  src: url("../../fonts/BMitra.eot?#iefix") format("embedded-opentype"), url("../../fonts/BMitra.woff") format("woff"), url("../../fonts/BMitra.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "BMitra";
  src: url("../../fonts/BMitra.eot");
  src: url("../../fonts/BMitra.eot?#iefix") format("embedded-opentype"), url("../../fonts/BMitra.woff") format("woff"), url("../../fonts/BMitra.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

What's the problem? I use dotless in a ASP .Net MVC 3.0 application.

madth3
  • 7,275
  • 12
  • 50
  • 74
Atta
  • 327
  • 1
  • 5
  • 16

2 Answers2

2

Both @media and @font-face are supported by both less.js and dotless in the current version.

However putting @font-face blocks in through a mixin is relatively new territory - there looks like a bug.

[edit]

There is already a bug for less.js which has a work-around.

[Edit 2]

This is now fixed in dotless main.

Luke Page
  • 8,136
  • 1
  • 20
  • 22
0

Bad news: @media and @font-face support in LessCSS. '@font-face' is not really supported yet with LESS CSS :(

Community
  • 1
  • 1
Nathan Strutz
  • 8,095
  • 1
  • 37
  • 48
  • OK :( . I created a function for each font without any parameter and the result is correct now. for example: .fontMitra { @font-face { font-family: BMitra; src: url("../../fonts/BMitra.eot"); src: url("../../fonts/BMitra.eot?#iefix") format("embedded-opentype"), url("../../fonts/BMitra.woff") format("woff"), url("../../fonts/BMitra.ttf") format("truetype"); font-weight: normal; font-style: normal; } } – Atta Apr 14 '12 at 08:09
  • That thread is pretty old.. we have done a lot to improve and @font-face should now be working properly.. – Tigraine Apr 14 '12 at 14:09
  • Dear Tigraine , I use your last version. Do You have another solution to use @font-face? – Atta Apr 15 '12 at 05:43
  • See the response from Luke Page – Chris Apr 18 '12 at 08:07