FortAwesome / Font-Awesome

The iconic SVG, font, and CSS toolkit
https://fontawesome.com
Other
73.69k stars 12.19k forks source link

Variable fa-version (scss,less) not being used in @font-face declaration #14856

Closed aprat84 closed 5 years ago

aprat84 commented 5 years ago

Describe the problem

In _variables.[scss|less] file, there is a fa-version variable, which is not used in @font-face declaration, to force font files refresh when updating to newer versions. Happens in both SCSS and LESS, and in every style: brands/solid/regular/light.

What did you expect?

Font files URL should be suffixed with some query string variable to force browsers to fetch new files when updating, like it was in v4.7.0.

Something like this:

@font-face {
  font-family: 'Font Awesome 5 Pro';
  font-style: normal;
  font-weight: 900;
  font-display: $fa-font-display;
  src: url('#{$fa-font-path}/fa-solid-900.eot?v=#{$fa-version}');
  src: url('#{$fa-font-path}/fa-solid-900.eot?v=#{$fa-version}#iefix') format('embedded-opentype'),
  url('#{$fa-font-path}/fa-solid-900.woff2?v=#{$fa-version}') format('woff2'),
  url('#{$fa-font-path}/fa-solid-900.woff?v=#{$fa-version}') format('woff'),
  url('#{$fa-font-path}/fa-solid-900.ttf?v=#{$fa-version}') format('truetype'),
  url('#{$fa-font-path}/fa-solid-900.svg?v=#{$fa-version}#fontawesome') format('svg');
}

What version and implementation are you using?

Version: 5.8.1

tagliala commented 5 years ago

Hi!

Thanks for being part of the Font Awesome Community.

We have removed this on purpose because it was causing issues with proxy servers and it is an old approach to invalidate files

If you still need this feature, feel free to customize the less/scss files as you wish

Ref: #3286 (and others)

Hope it helps

Closing here

aprat84 commented 5 years ago

Makes sense. Thanks for quick reply!