Undocumented default behavior: @font-face changes file paths and copies files
See original GitHub issueWhile using Elixir, paths were respected by the SASS processor.
My CSS was being output to public/assets/css/app.css
with fonts living in public/assets/fnt/font-name/filename.ext
for each file, so I could use url('../fnt/font-name/font-name.eot')
without issue. Now that I’m using Mix my paths are being changed to point to public/fonts/font-name.ext
with the files copied needlessly to that directory.
I did not ask for this. Now I’m maintaining a separate static font CSS file that I use to copy-paste over the generated font definition.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Sass files with font path variable · Issue #64 - GitHub
Fontsource's .css files assume the font files are located at ./files/, which dictates ... Other than changing up the relative file paths.
Read more >Notepad2 - Frequently Asked Questions (FAQs)
How do I set a default file extension? How do I change the default font? Why are there different text widths with monospace...
Read more >How to Use Ghostscript
ps ), font files, the Fontmap file, files named on the command line, and resource files, Ghostscript first tests whether the file name...
Read more >Ammonite
Ammonite provides a set of magic imports that let you load additional code into a REPL session: these are imports which start with...
Read more >Context | Android Developers
File creation mode : the default mode, where the created file can only be accessed by the calling application (or all applications sharing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Neither of which are potentially destructive processes as long as the syntax of the final result is valid, so this is a non-sequitur. Altering URLs is an active change in the actual value of data, and copying files that already existed increases the amount of space used on the server and clutter the directory structure.
I understand from further trials that the real power from this kind of functionality is being able to import resources from Node packages and the like, but executing these changes when they’re not necessary (i.e. the files already existing in public and the projected URLs pointing to them) just leads to confusion and frustration (and in my case, literally a whole wasted day). This should be explicitly stated in documentation as a side effect. There are already enough anti-patterns plaguing some of the Laravel components, and documentation on handling front-end resources is already missing tons of useful information.
Important to remember that Elixir and Mix are built on two completely different build tools. Webpack is much more powerful.
It’s not needless. This is a feature, not a bug. 😃 Webpack will find all references to fonts, and move them to that location.
Well you didn’t ask Mix to minify your code or apply CSS3 prefixing either, but it will.
You don’t need to do that. You can either update your font urls to be absolute (begin with a “/”, and Webpack will ignore them), or remove your public/fnt directory, and let Webpack put them where they need to go.