Astro Tutorial: Add Google Fonts to Astro Tailwind CSS Projects (2023)

Опубликовано: 19 Сентябрь 2023
на канале: Anthony Ngo
4,646
41

Notes:
1. Make sure you have tailwind installed: npx astro add tailwind
2. Find a font via fontsource, example: https://fontsource.org/fonts/twinkle-... (You can find most, if not all Google fonts here)
3. npm install @fontsource/twinkle-star
4. import '@fontsource/twinkle-star';
5. Update tailwind config
5a. Import tailwind's default theme (this should provide fallbacks for the the Twinkle Star font if it doesn't work)
5b. Add the font family "Twinkle Star" into the correct font type (serif)
6. Use the font family on an element, ie body tag: class="font-serif"

Docs:
https://docs.astro.build/en/guides/fo...
https://fontsource.org/fonts/twinkle-...
https://docs.astro.build/en/guides/in...


На этой странице сайта вы можете посмотреть видео онлайн Astro Tutorial: Add Google Fonts to Astro Tailwind CSS Projects (2023) длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Anthony Ngo 19 Сентябрь 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 4,646 раз и оно понравилось 41 зрителям. Приятного просмотра!