From c2e28cc625532f55f2ce3ac1450c8207aa5ffe21 Mon Sep 17 00:00:00 2001 From: Benjamin Takats Date: Wed, 30 Nov 2022 15:21:58 +0100 Subject: [PATCH] Inconsolata as default font --- composer.json | 1 + composer.lock | 82 ++++++++++++++++++++++++- config/google-fonts.php | 44 +++++++++++++ resources/views/layouts/app.blade.php | 2 +- resources/views/layouts/guest.blade.php | 2 +- tailwind.config.js | 6 +- 6 files changed, 133 insertions(+), 4 deletions(-) create mode 100644 config/google-fonts.php diff --git a/composer.json b/composer.json index 502efb63..54438be3 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ "laravel/tinker": "^2.7", "livewire/livewire": "^2.5", "rappasoft/laravel-livewire-tables": "^2.8", + "spatie/laravel-google-fonts": "^1.2", "spatie/laravel-sluggable": "^3.4", "wireui/wireui": "^1.17" }, diff --git a/composer.lock b/composer.lock index 05d66222..6db056dd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a242ffb9edc0da4f3a3695053759cab6", + "content-hash": "06518b5d3d774a669c86ea4b334482a0", "packages": [ { "name": "bacon/bacon-qr-code", @@ -4367,6 +4367,86 @@ ], "time": "2022-07-25T00:44:21+00:00" }, + { + "name": "spatie/laravel-google-fonts", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-google-fonts.git", + "reference": "c6d50d5b87c57468257efc136523fac7ed78c7dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-google-fonts/zipball/c6d50d5b87c57468257efc136523fac7ed78c7dc", + "reference": "c6d50d5b87c57468257efc136523fac7ed78c7dc", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^7.3", + "illuminate/contracts": "^8.37|^9.0", + "php": "^8.0", + "spatie/laravel-package-tools": "^1.7.0" + }, + "require-dev": { + "brianium/paratest": "^6.3", + "nunomaduro/collision": "^5.4|^6.0", + "orchestra/testbench": "^6.17|^7.0", + "phpunit/phpunit": "^9.5", + "spatie/laravel-ray": "^1.17", + "spatie/phpunit-snapshot-assertions": "^4.2" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\GoogleFonts\\GoogleFontsServiceProvider" + ], + "aliases": { + "GoogleFonts": "Spatie\\GoogleFonts\\GoogleFontsFacade" + } + } + }, + "autoload": { + "psr-4": { + "Spatie\\GoogleFonts\\": "src", + "Spatie\\GoogleFonts\\Database\\Factories\\": "database/factories" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sebastian De Deyne", + "email": "sebastian@spatie.be", + "role": "Developer" + }, + { + "name": "Freek Van der herten", + "email": "freek@spatie.be", + "role": "Developer" + } + ], + "description": "Manage self-hosted Google Fonts in Laravel apps", + "homepage": "https://github.com/spatie/laravel-google-fonts", + "keywords": [ + "google fonts", + "laravel", + "laravel-google-fonts", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/laravel-google-fonts/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-09-07T10:01:34+00:00" + }, { "name": "spatie/laravel-package-tools", "version": "1.13.7", diff --git a/config/google-fonts.php b/config/google-fonts.php new file mode 100644 index 00000000..25138d9a --- /dev/null +++ b/config/google-fonts.php @@ -0,0 +1,44 @@ + [ + 'default' => 'https://fonts.googleapis.com/css2?family=Inconsolata:ital,wght@0,400;0,700;1,400;1,700', + ], + + /* + * This disk will be used to store local Google Fonts. The public disk + * is the default because it can be served over HTTP with storage:link. + */ + 'disk' => 'public', + + /* + * Prepend all files that are written to the selected disk with this path. + * This allows separating the fonts from other data in the public disk. + */ + 'path' => 'fonts', + + /* + * By default, CSS will be inlined to reduce the amount of round trips + * browsers need to make in order to load the requested font files. + */ + 'inline' => true, + + /* + * When something goes wrong fonts are loaded directly from Google. + * With fallback disabled, this package will throw an exception. + */ + 'fallback' => ! env('APP_DEBUG'), + + /* + * This user agent will be used to request the stylesheet from Google Fonts. + * This is the Safari 14 user agent that only targets modern browsers. If + * you want to target older browsers, use different user agent string. + */ + 'user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15', + +]; diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 70b7ba11..77c84365 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -6,7 +6,7 @@ {{ config('app.name', 'Laravel') }} - + @googlefonts @vite(['resources/css/app.css', 'resources/js/app.js']) diff --git a/resources/views/layouts/guest.blade.php b/resources/views/layouts/guest.blade.php index 393c5f01..a52c03a3 100644 --- a/resources/views/layouts/guest.blade.php +++ b/resources/views/layouts/guest.blade.php @@ -6,7 +6,7 @@ {{ config('app.name', 'Laravel') }} - + @googlefonts @vite(['resources/css/app.css', 'resources/js/app.js']) diff --git a/tailwind.config.js b/tailwind.config.js index a39a0935..08659346 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -37,9 +37,13 @@ module.exports = { }, fontFamily: { sans: [ - 'Nunito', + 'Inconsolata', ...defaultTheme.fontFamily.sans ], + mono: [ + 'Inconsolata', + ...defaultTheme.fontFamily.mono + ], }, }, },