in jade, cannot get style @font

from a working css file (generated by font-squirrel):

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

trying to declare in style section in jade document:

...
style
  @font-face
    font-family
      | SnowTopCaps
    src
      | url('/fonts/snowtopcaps-webfont.woff') format('woff')
    font-weight
      | normal
    font-style
      | normal
    ...

but none of the style declaration is written to the generated html ?

any anybody see what's missing here?


This syntax is for HTML, not for css. Use

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

Or use the :stylis filter

链接地址: http://www.djcxy.com/p/60798.html

上一篇: 从Symfony2 Bundle中的公共文件夹面对?

下一篇: 在玉石中,无法得到@font风格