mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-04 13:50:39 +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:
parent
9fc9c1de98
commit
62c2c17031
23 changed files with 21 additions and 954 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue