mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 15:07:20 +00:00
Fonts rework (#12114)
- Use system fonts only for text to avoid FOUT - Move font-awesome to npm/webpack - Move NotoColorEmoji to web_src - Remove presumably unneccesary 'PT Sans Narrow' - Simplify webpack import exclusions Fixes: https://github.com/go-gitea/gitea/issues/11818 Fixes: https://github.com/go-gitea/gitea/pull/11814 Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
@ -25,15 +25,17 @@ const isProduction = process.env.NODE_ENV !== 'development';
|
||||
const filterCssImport = (parsedImport, cssFile) => {
|
||||
const url = parsedImport && parsedImport.url ? parsedImport.url : parsedImport;
|
||||
const importedFile = url.replace(/[?#].+/, '').toLowerCase();
|
||||
if (/vendor\/assets/.test(url)) return false; // font imports
|
||||
if (/web_src[/\\]less/.test(cssFile)) return true; // relative imports
|
||||
if (cssFile.includes('monaco')) return true;
|
||||
|
||||
if (cssFile.includes('fomantic')) {
|
||||
if (/brand-icons/.test(importedFile)) return false;
|
||||
if (/(eot|ttf|woff)$/.test(importedFile)) return false;
|
||||
return true;
|
||||
if (/(eot|ttf|otf|woff)$/.test(importedFile)) return false;
|
||||
}
|
||||
return cssFile.includes('node_modules');
|
||||
|
||||
if (cssFile.includes('font-awesome')) {
|
||||
if (/(eot|ttf|otf|woff|svg)$/.test(importedFile)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
Reference in New Issue
Block a user