How to Use Custom Fonts with Tailwind CSS

  Рет қаралды 76,207

Tailwind Labs

Tailwind Labs

Күн бұрын

Пікірлер
@KingOfCorinth
@KingOfCorinth 3 жыл бұрын
For that one person who is under a time crunch Embedding Google Fonts: 0:37 Self Hosted Fonts: 7:22
@N32-e1g
@N32-e1g 2 жыл бұрын
life saver bro
@hmatpin
@hmatpin 3 жыл бұрын
Man, thanks for not monetizing this great channel
@codenameunknown3791
@codenameunknown3791 3 жыл бұрын
8:13 looool. Big shoutout to Mr. Wes Bos out there.
@simonswiss
@simonswiss 3 жыл бұрын
Haha I was waiting for those comments 😅
@kayf7073
@kayf7073 3 жыл бұрын
Great. Remember, when your website is also seen by people living in europe, including files from external sources like google is against eu gdpr law, because it transfers personal data (ip adesss) to other parties (worst of all: in the us) without prior consent. So selfhosting fonts, scripts, images etc is the only way to go
@moracabanas
@moracabanas 3 жыл бұрын
I cannot believe this thing wth is going on laws...
@JimOHalloran
@JimOHalloran 3 жыл бұрын
Woohoo! Simon is winning at CSS and Year 4 Miniball! Division 1 no less!
@mohabedr5030
@mohabedr5030 3 жыл бұрын
Tailwind is the future
@Max-xp3tf
@Max-xp3tf 3 жыл бұрын
The future is Tailwind *
@81NARY
@81NARY 3 жыл бұрын
And the future is now!
@Max-xp3tf
@Max-xp3tf 3 жыл бұрын
@@81NARY 👀
@nitro4109
@nitro4109 2 жыл бұрын
And I'm from future
@saschamajewsky7990
@saschamajewsky7990 3 жыл бұрын
When Tailwind CSS Merch?
@ruslansteiger
@ruslansteiger 3 жыл бұрын
Primus Utilitatem
@moracabanas
@moracabanas 3 жыл бұрын
If you import fonts with @import and extend your tailwind.config.js you must rebuild. HMR just won't apply that font until you Ctrl + c your Node terminal. It took me 3h to point that. At least using windicss
@melissawhite7522
@melissawhite7522 2 жыл бұрын
Learning Tailwindcss and just wanted to say thanks for the reminder. Was totally like "why ins't this working." and forgot the rebuild. :)
@shivankbatra5643
@shivankbatra5643 Жыл бұрын
thanks a lot man, 5hr for me to be precise and was about to give up before I saw this comment. Feeling really stupid but finally it works!
@yassminh
@yassminh Жыл бұрын
This comment should be pinned. You have saved me from wasting hours trying to figure out why it didn't work. Thank you!
@davidluhr
@davidluhr 3 жыл бұрын
Another great video, Simon! Bonus tip: use `font-display: swap;` in your `@font-face` declarations for a performance boost. This allows the browser to render first paint more quickly by displaying the system font as soon as possible, and then "swapping" to your custom fonts once they become available. It prevents the infamous FOUT (Flash of Unstyled Text) 😉
@simonswiss
@simonswiss 3 жыл бұрын
Totally, that would have been a great addition to this video 👍
@robyroby162
@robyroby162 3 жыл бұрын
Actually this brings FOUT back by design!
@davidluhr
@davidluhr 3 жыл бұрын
@@robyroby162 Sorry, I meant FOIT (Flash of Invisible Text). Thanks for correcting me!
@pedromartindelcampogonzale9613
@pedromartindelcampogonzale9613 3 жыл бұрын
Your vídeos are really uplifting, love your attitude.
@RobertWildling
@RobertWildling Жыл бұрын
Great and important video! - I Austria there is a weird law case going on, where a woman accuses more than 1000 website owners of not having been explicit enough about their Google Font implementation. She feels that here private data has been exposed. The case is not yet over, but it shows that it might be a good idea to self-host google fonts...
@justinoneill2837
@justinoneill2837 3 жыл бұрын
I'm trying to add a custom icon font library w/ this method (material design icons to be exact). it's acting a tad bit strange though. Would be cool to see another video on how Tailwind recommends doing this.
@ovuokeaghwotu2389
@ovuokeaghwotu2389 3 ай бұрын
How do make the imported custom font the global default font? Thank you.
@probelou
@probelou 3 жыл бұрын
If I have the one font with multiple weights and want to use the tw font-weight utility classes how do I declare that? E.g. class="font-fontName font-weight-normal" or class="font-fontName font-weight-bold". I tried this but the cascade wins so `fontName` uses 700 weight irrespective of the weight utility class. @font-face { font-family: "fontName"; font-weight: 400; src: url("../public/fonts/font-name-400.woff2") format("woff2"), url("../public/fonts/font-name-400.woff") format("woff"); } @font-face { font-family: "fontName"; font-weight: 700; src: url("../public/fonts/font-name-700.woff2") format("woff2"), url("../public/fonts/font-name-700.woff") format("woff"); }
@ICOReviewtoken
@ICOReviewtoken Жыл бұрын
Hi bro. I have a custom font that I want to import locally but it doesn't accept it. Also if I want to give users the ability to choose their own fonts when using, for example users will set the font for different title tags and font base, can I do it in nextjs 13? Please give me solution. I use nextjs 13, taiwincss. Thank you
@mattd5419
@mattd5419 3 жыл бұрын
how can we use variable fonts?
@DrHappybone
@DrHappybone 3 жыл бұрын
Can't get local fonts to load at all.. just flat out refusing to do it. Using Vite, npm run dev for the server and tried using public file in root. No matter what I do, it's not loading the fonts
@rickdev1922
@rickdev1922 3 жыл бұрын
me too😢
@arianhossain9600
@arianhossain9600 2 ай бұрын
what is the name of this font that in the VS Code????? if u know let me know
@TheKumarAshwin
@TheKumarAshwin 2 жыл бұрын
how to avoid expected behaviour issue, as my custome fonts loads after the default font?
@govindsaini8085
@govindsaini8085 3 жыл бұрын
Hi I m facing the pb of display I want to show in lg screen of image and mobile devices I want to show hidden of image "hidden md:block " I used but doesn't work show this kind of pb how to solve if possible as soon as reply for this question
@momenabdelghafar7771
@momenabdelghafar7771 3 жыл бұрын
what is font-family in the text-editor
@HosamHasanMonir
@HosamHasanMonir 3 жыл бұрын
monolisa font
@anirudh1713
@anirudh1713 3 жыл бұрын
Its DankMono, its paid.
@modz9711
@modz9711 3 жыл бұрын
@@anirudh1713 yup it's dank mono..! Check the 'f' its unique ..!
@marcorieser
@marcorieser 3 жыл бұрын
I think it's MonoLisa, they released version 1.8 yesterday which adds a script variant that gives you a similar look like Dank Mono.
@modz9711
@modz9711 3 жыл бұрын
@@marcorieser will check it
@edanbenatar
@edanbenatar 2 жыл бұрын
Would you have to define all the weight classes so that Tailwind behaves accordingly with the font weight utility classes?
@mike110111
@mike110111 3 жыл бұрын
Please can you do a video explaining css layout for beginners
@abdullahialhassan3700
@abdullahialhassan3700 3 жыл бұрын
I have a question, while you are using the jit kit fo you need a css folder too
@jobsphil9553
@jobsphil9553 3 жыл бұрын
I wish you provide html source together. I wonder how the regular / bold font applied to css.
@nbbhaskar3294
@nbbhaskar3294 3 жыл бұрын
Either font-bold tailwind class can be added to your html element. Or in @font-face declaration in your css file, you can specify font-weight: 700 and point src to the bold font file, that should it.
@muskanbhatnagar7535
@muskanbhatnagar7535 2 жыл бұрын
Hi, is there a possibility to conditionally add a font? I have a multitenant setup, and for different client UI's, we support client specific fonts. In client A's app, I only use client A's font. But embedding fonts this way downloads client B's font as well even though it is not used.
@YazinS
@YazinS 3 жыл бұрын
Great video! I was hoping it would cover how to change the default body font? I don't see a class (e.g. font-body) that can be overridden?
@irving7653
@irving7653 Жыл бұрын
What are the font and theme you use?
@oliverye55
@oliverye55 2 жыл бұрын
Amazing video! super direct and to the point!! love this.
@lawrencemotions8720
@lawrencemotions8720 3 жыл бұрын
How to add fonts in next js.
@nozimjonjuraev2666
@nozimjonjuraev2666 Жыл бұрын
can anyone tell me how to set up truetype font in project with tailwindcss?
@varun_y
@varun_y 3 жыл бұрын
when using with nextjs and self hosted fonts , i had to put link in head tag as well.
@hmatpin
@hmatpin 3 жыл бұрын
Hi. Does anybody know how to include the css of a third party library like slick slider into a tailwind project?
@joshuarileymagic
@joshuarileymagic 3 жыл бұрын
I maybe thinking too advanced or might not be performant but since the JIT compiler CDN is JS and you can use [ ] in classes, wouldn't it be easier if the CDN auto-imported the google font if you use say font-[Roboto] then it'll auto import the font as a link tag in header and dynamically create the css needed, just an idea anyway :) I'm starting to look more into customising Tailwind after using the defaults for a while along with custom css
@mychoppaeat
@mychoppaeat Жыл бұрын
1:00 eyo!
@esdev
@esdev 3 жыл бұрын
Is it possible to use without tailwind config file , more preciously in new tailwind cli jit mode which doesn't require config file??
@simonswiss
@simonswiss 3 жыл бұрын
If you want a custom "font-${fontName}" utility class, you'll need a Tailwind config file. You can still use a custom font and set it in CSS on the HTML elements you want to target.
@aaymankhalid9997
@aaymankhalid9997 Жыл бұрын
I need to know the vscode theme being used in this video🙃
@simonswiss
@simonswiss Жыл бұрын
The theme is Night Owl, and the font is Dank Mono ✨
@Keteku.
@Keteku. 2 жыл бұрын
What font is he using in his code editor ? Any help here
@janascofield
@janascofield 2 жыл бұрын
operator mono
@Keteku.
@Keteku. 2 жыл бұрын
@@janascofield Will check it out. Huge thanks
@guilhermeeduardomaffei1247
@guilhermeeduardomaffei1247 2 жыл бұрын
which font do you use in Visual Code ?
@janascofield
@janascofield 2 жыл бұрын
operator mono
@JamisIcon
@JamisIcon 3 жыл бұрын
Hi, thanks for the great tips, I'm kinda new to this, my font changed when I added it to the app.css file not the tailwind.config.js, I'm kind of wondering what happened :D
@christyjacob8551
@christyjacob8551 3 жыл бұрын
I just googled for this yesterday!!
@kelas-frontend
@kelas-frontend 3 жыл бұрын
Yeah, me too 😁
@phonghoanggia9181
@phonghoanggia9181 3 жыл бұрын
I just wanna know what font do u use in your text editor?
@alessandro2092
@alessandro2092 3 жыл бұрын
Dank Mono
@tomrowe2181
@tomrowe2181 3 жыл бұрын
Would have liked a V2.2 example of this in the video! I had to work it out myself the other day 😅 Moving off CSS files was a game changer, but the docs are missing a lot of examples on how to customise certain things
@TailwindLabs
@TailwindLabs 3 жыл бұрын
This example was made in 2.2! The exact same technique has been working since v1 by the way, there is nothing different about adding custom fonts to Tailwind since version 2.2.
@tomrowe2181
@tomrowe2181 3 жыл бұрын
@@TailwindLabs Oh I meant without CSS files! 😅 By defining font-faces in a custom plugin for the tailwind config
@sherifsaleh111
@sherifsaleh111 3 жыл бұрын
What's the text editor font are you using 🙏?
@alessandro2092
@alessandro2092 3 жыл бұрын
Dank Mono
@en3rr
@en3rr Жыл бұрын
Thanks this helps a lot!
@The_Penny_Seventeens
@The_Penny_Seventeens 10 ай бұрын
Thank you my website is one step closer!
@bogdanlupu3679
@bogdanlupu3679 3 жыл бұрын
From what Tailwindcss version does this work? Does it work in 2.0 or 2.2 onwards?
@wobsoriano
@wobsoriano 3 жыл бұрын
Since v1
@simonswiss
@simonswiss 3 жыл бұрын
It was already working in v1, we just haven't provided many examples until now 👍
@bogdanlupu3679
@bogdanlupu3679 3 жыл бұрын
@@simonswiss thanks. I am new on tailwind and i plan to use in a project that nas custom fonts. The codebase vad installed 2.0. That's why the question. Thanks again for the answer.
@OneBrokeBloke
@OneBrokeBloke Жыл бұрын
And local fonts, but as utility classes? Thats what im looking for
@Ravi0207
@Ravi0207 Жыл бұрын
Anyone struggling with using the next font optimisation with tailwind - In _app file declare the font as a jsx style css variable. And use that variable in the tailwind config file
@CARUSAR21
@CARUSAR21 3 жыл бұрын
So epic once again.
@ch3tankate469
@ch3tankate469 3 жыл бұрын
We want more such videos Plz reply this post if you want more
@cas4425
@cas4425 3 жыл бұрын
🔥🔥🔥
@oliverye55
@oliverye55 2 жыл бұрын
Subscribed and liked!!
@BneiAnusim
@BneiAnusim 2 жыл бұрын
PRICELESS! Thanks 😉
@codeative
@codeative 3 жыл бұрын
just awesome
@lautaroriveiro
@lautaroriveiro 2 жыл бұрын
Thanks again!
@adeema664
@adeema664 Жыл бұрын
very good video 🥰🥰
@waldothedev
@waldothedev 3 жыл бұрын
Haha, amazing...how do you say that again Wes? vit? veet? lol
@TheCrisisCall
@TheCrisisCall 3 жыл бұрын
Really very good video! I'll start implementing the fonts this way. On the other hand, does anyone know how to include style that should be in regardless of whether their classes are in the HTML or not? It happens that I apply style to a carousel but it only exists when the page loads, so the purged css does not contain the style
@parth.dobariya
@parth.dobariya Жыл бұрын
0:53 tujhe malum hai tu kya bolra hai😂
@esdev
@esdev 3 жыл бұрын
Sweet 😎
@mikefenn2451
@mikefenn2451 Жыл бұрын
8:15
@haridass2208
@haridass2208 3 жыл бұрын
Bye bye bootstrap 🤣
@vic_casanas
@vic_casanas 3 жыл бұрын
First
@shaungbhone8368
@shaungbhone8368 3 жыл бұрын
Beet
Theming Tailwind with CSS Variables
27:24
Tailwind Labs
Рет қаралды 129 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Building a Fancy Responsive Tile Grid with Tailwind CSS
13:28
Tailwind Labs
Рет қаралды 76 М.
Translating a Custom Design System to Tailwind CSS
10:10
Tailwind Labs
Рет қаралды 126 М.
Styling Forms with Tailwind CSS
17:25
Tailwind Labs
Рет қаралды 143 М.
Please stop using px for font-size.
15:18
Coder Coder
Рет қаралды 247 М.
I WISH I Knew These Tailwind Tips Earlier
9:15
Theo - t3․gg
Рет қаралды 199 М.
What's new in Tailwind CSS v3.0?
26:33
Tailwind Labs
Рет қаралды 183 М.
Sorting Tailwind CSS Classes Automatically with Prettier
10:00
Tailwind Labs
Рет қаралды 90 М.
You’re doing dark mode wrong!
7:54
Coding in Public
Рет қаралды 55 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН