Wildly bombed. Developing a website on yii2. There was a need to connect third-party fonts. Generated through fontsquirrel web font generator web fonts. Put it in the web/fonts folder. Created a web/css/fonts.css following content:
@font-face { font-family: 'open_sansregular'; src: url('../fonts/opensans-regular-webfont.woff2') format('woff2'), url('../fonts/opensans-regular-webfont.woff') format('woff'); font-weight: normal; font-style: normal; } AppAsset looks like this:
class AppAsset extends AssetBundle { public $basePath = '@webroot'; public $baseUrl = '@web'; public $css = [ 'css/font-awesome.min.css', 'css/fonts.css', 'css/site.css', 'css/login.css', ]; public $js = [ 'js/jquery.bootstrap-autohidingnavbar.min.js' ]; public $depends = [ 'yii\web\YiiAsset', 'yii\bootstrap\BootstrapPluginAsset', ]; } Well, in site.css looks like this:
body { background-color: #FAFAFA; font-family: 'open_sansregular', sans-serif; } The result is zero. The most interesting thing is that I can not connect the fonts.css file at all - the desktop chrome itself will somehow find them. Other browsers (including mobile chrome) do not pull up fonts. In the source code of the page everything is connected in the right order. I do not understand what's what. Cache cleaned millions of times ..
UPD: font awesom works great ..