question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove duplicate @font-face

See original GitHub issue

I have a css file that contains the critical render css from throughout a website. It therefore contains a number of duplicate styles. Clean CSS does a great job at removing these however it doesn’t remove the @font-face rules. I’ve not been able to find any settings regarding and was wondering if you could help. The duplicate rule is as follows. Thanks

@font-face { font-family: 'FontAwesome'; src: url('fonts/fontawesome-webfont.eot?v=4.6.3'); src: url('fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'),url('fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'),url('fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'),url('fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'),url('fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
jakubpawlowiczcommented, Dec 27, 2016

It’s ready in master, due in 4.0 release.

0reactions
jakubpawlowiczcommented, Jun 20, 2016

It should be rather simple addition (famous last words), similar to de-duplication of media rules. I’d start with a failing test and this piece of code: https://github.com/jakubpawlowicz/clean-css/blob/master/lib/selectors/advanced.js#L59

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove duplicate @font-face · Issue #785 - GitHub
I have a css file that contains the critical render css from throughout a website. It therefore contains a number of duplicate styles....
Read more >
Duplicate @font-face declaration in css, url fetched twice?
and i've noticed that browsers try to take both paths '/PATH2/font1.eot' and '/PATH1/font1.eot' . Is there a way to avoid one of two...
Read more >
Dealing with Duplicate Fonts - Insider / FontAgent
Resolving Font Duplicates​​ By eliminating near-duplicates and imitations, you can add tremendous value to your font collection. More importantly, you lay the ...
Read more >
Using array_unique with ACF repeater fields to remove ...
Using array_unique with ACF repeater fields to remove duplicate @font-face requests. SOLVED EDIT. I managed to solve this myself.
Read more >
Why font shows up twice in Control Panel / Fonts and how to ...
Windows rejects duplicate fonts, so something pretty weird must have been done. The font's attributes are stored inside the font file and a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found