LESS に Web フォントを含めようとしています。部分的に仕事をするパラメトリックミックスインは次のとおりです。
.fontface(@fontName, @fontFile) {
@font-face {
font-family: @fontName;
src: url("@{fontFile}.eot");
src: url("@{fontFile}.eot?#iefix") format('embedded-opentype'),
url("@{fontFile}.woff") format('woff'),
url("@{fontFile}.ttf") format('truetype'),
url("@{fontFile}.svg#DistantGalaxyRegular") format('svg');
font-weight: normal;
font-style: normal; } }
.font(@fontsize:10pt, @fontName:"Aierbazzi", @fontFile:"Aierbazzi-fontfacekit/aierbazzi-webfont") {
.fontface(@fontName, @fontFile);
font-family:@fontName;
font-size:@fontsize; }
初めて呼び出されても問題なく動作します。
.font1 { .font(24pt, "Black-Rose","Black-Rose-fontfacekit/BLACKR-webfont"); }
.font4 { .font(24pt, "bubblegum-sans","bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont"); }
結果:
.font1 {
font-family:"Black-Rose";
font-size:24pt; }
@font-face {
font-family:"Black-Rose";
src:url("Black-Rose-fontfacekit/BLACKR-webfont.eot");
src:url("Black-Rose-fontfacekit/BLACKR-webfont.eot?#iefix") format('embedded-opentype'),url("Black-Rose-fontfacekit/BLACKR-webfont.woff") format('woff'),url("Black-Rose-fontfacekit/BLACKR-webfont.ttf") format('truetype'),url("Black-Rose-fontfacekit/BLACKR-webfont.svg#DistantGalaxyRegular") format('svg');
font-weight:normal;
font-style:normal; }
.font4 {
font-family:"bubblegum-sans";
font-size:24pt; }
@font-face {
font-family:"Black-Rose";
src:url("Black-Rose-fontfacekit/BLACKR-webfont.eot");
src:url("Black-Rose-fontfacekit/BLACKR-webfont.eot?#iefix") format('embedded-opentype'),url("Black-Rose-fontfacekit/BLACKR-webfont.woff") format('woff'),url("Black-Rose-fontfacekit/BLACKR-webfont.ttf") format('truetype'),url("Black-Rose-fontfacekit/BLACKR-webfont.svg#DistantGalaxyRegular") format('svg');
font-weight:normal;
font-style:normal; }
2行を入れ替えると:
.font4 { .font(24pt, "bubblegum-sans","bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont"); }
.font1 { .font(24pt, "Black-Rose","Black-Rose-fontfacekit/BLACKR-webfont"); }
ここでも最初の Web フォントだけが CSS に登録されます。
.font4 {
font-family:"bubblegum-sans";
font-size:24pt; }
@font-face {
font-family:"bubblegum-sans";
src:url("bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont.eot");
src:url("bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont.eot?#iefix") format('embedded-opentype'),url("bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont.woff") format('woff'),url("bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont.ttf") format('truetype'),url("bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont.svg#DistantGalaxyRegular") format('svg');
font-weight:normal;
font-style:normal;}
.font1 {
font-family:"Black-Rose";
font-size:24pt; }
@font-face {
font-family:"bubblegum-sans";
src:url("bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont.eot");
src:url("bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont.eot?#iefix") format('embedded-opentype'),url("bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont.woff") format('woff'),url("bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont.ttf") format('truetype'),url("bubblegum-sans-fontfacekit/BubblegumSans-Regular-webfont.svg#DistantGalaxyRegular") format('svg');
font-weight:normal;
font-style:normal; }
その理由は何ですか?私は今のところ無知です。事前にどうもありがとうございました。