Simple solutions to responsive typography

  Рет қаралды 184,265

Kevin Powell

Kevin Powell

Күн бұрын

Пікірлер: 229
@technikhil314
@technikhil314 3 жыл бұрын
That +1rem is noiceeee I love it. Pinch zoom is issue with viewport units.
@thecashewtrader3328
@thecashewtrader3328 3 жыл бұрын
this
@PaulMcCannWebBuilder
@PaulMcCannWebBuilder 3 жыл бұрын
Yup, now off to add this to every clamp() I've written.
@bulkywallnut5674
@bulkywallnut5674 3 жыл бұрын
Can someone further explain this? I don’t understand. Thanks
@technikhil314
@technikhil314 3 жыл бұрын
@@bulkywallnut5674 as you zoom in your viewport shrinks hence actual vale of vh and vw also goes down but rem stays same regardless of viewport size.
@badunius_code
@badunius_code 2 жыл бұрын
Never considered pinch zoom 🤔 Otoh, why would you want to pinch zoom if font size is appropriate?
@MilanRegec
@MilanRegec 3 жыл бұрын
So glad to see Kevin now includes accessibility concerns in every video he makes. This is so important for the community. Thank you!
@miyalys
@miyalys 3 жыл бұрын
@avfr like derek banas? anyway who hurt you?
@TuringTested01
@TuringTested01 2 жыл бұрын
@@miyalys a blind guy with hearing issues took his girlfriend and now he's sad
@throwbacksfather6625
@throwbacksfather6625 2 жыл бұрын
@avfr what the hell is a soydevs
@SolomonOni-d1y
@SolomonOni-d1y 11 күн бұрын
You have made me I love with CSS and I'm really surprised with the amazing things you can use only CSS to do
@munaq-jp
@munaq-jp 3 жыл бұрын
I've been using clamp instead of media queries for a while now. But using both with variables is brilliant. I absolutely love it.
@fahimsangharriyat495
@fahimsangharriyat495 3 жыл бұрын
clamp(3.5rem, 12vw + 1rem, 12rem) which is amazing. Now I will be use in my all projects
@cintron3d
@cintron3d 3 жыл бұрын
Thanks!
@KevinPowell
@KevinPowell 3 жыл бұрын
Thank you so much!
@sumitwadhwa8823
@sumitwadhwa8823 3 жыл бұрын
As always, great stuff. I think min, max, and clamp are pretty awesome.
@thecashewtrader3328
@thecashewtrader3328 3 жыл бұрын
this
@gregoryolenovich6440
@gregoryolenovich6440 3 жыл бұрын
Damn your responsive layout tutorials are so helpful and I'm a fairly experienced dev. I love the clamp thing. I have been using min to get something similar but I like clamp even more.
@SachinShukla
@SachinShukla 3 жыл бұрын
“frontend friends.” for months i thought he was saying “friend and friends.”
@iamkeir
@iamkeir 6 ай бұрын
Mind = blown 😮
@Atractiondj
@Atractiondj 3 жыл бұрын
it's nice to see a video with material about which you knew for 6 months already
@Cowglow
@Cowglow 3 жыл бұрын
The Clamp trick is amazing!! Thank you for the tips!
@henkmeerhof8647
@henkmeerhof8647 10 ай бұрын
Great that you explain we should not base font size on the view port size. It is not how typography works. Typography works on view distance (and you eye sight) so unless our devices get a sensor to measure how far our eyes are away from the screen we are reading, we have to work by the experience we have. Here we are in luck as we already use type for centuries, so we have some experience. An experience that is supported by some science of the last century where reading over distance became a real thing, like how large should type be on a road sign... The other great thing I would implement as soon as possible is to gather as much typographic parameters and behavior in one place, somewhere at the beginning of (css) files.
@brunovincent1969
@brunovincent1969 3 жыл бұрын
Man , that's absolute genius, been fighting with this for years! I'm saving this video with my legacy firefox youtube downloader, that vid going in my library!
@517design
@517design 3 ай бұрын
good point about VW and accessibility issues.
@petarkolev6928
@petarkolev6928 3 жыл бұрын
Kevin, you are my savior! Yet another amazing video ❤️Thank you so so much and I wish you an amazing new year!
@MeetDaveG
@MeetDaveG 11 ай бұрын
Thanks for this video Kevin. Just used (clamp) for one of my designs after this. Super helpful.
@RaveKev
@RaveKev 3 жыл бұрын
Danke!
@KevinPowell
@KevinPowell 3 жыл бұрын
Thanks so much!
@RaveKev
@RaveKev 3 жыл бұрын
@@KevinPowell We have to thank YOU! I realy love your style, the length of your videos and your content.
@vasiovasio
@vasiovasio 2 жыл бұрын
Objective and Useful video! Thank you!
@CarlosAlgms
@CarlosAlgms 3 жыл бұрын
I've never heard about clamp, I loved it, thanks for the video.
@hassanfayed1427
@hassanfayed1427 4 ай бұрын
This is so helpful. Thank you so much!
@pwos36
@pwos36 3 жыл бұрын
謝謝!
@KevinPowell
@KevinPowell 3 жыл бұрын
Thank you so much!
@gonzaotc
@gonzaotc 3 жыл бұрын
Kevin, you are the fucking best, you know, right?. This week I learned A LOT from you. Your content is incredible. Everything I have to do and find out how to on my projects, I search and you explained it better than anyone.
@gonzaotc
@gonzaotc 3 жыл бұрын
Also finishing your CRL 21 days course
@KevinPowell
@KevinPowell 3 жыл бұрын
Thanks so much! So happy that you're enjoying me content 😊
@chanel310the7
@chanel310the7 3 жыл бұрын
I am so happy I found this channel 😭
@ericnjanga3245
@ericnjanga3245 Жыл бұрын
I love your approach. Great job.
@blacknoire
@blacknoire 3 жыл бұрын
Defo my favourite KZbin coder ♥️
@fran_sar
@fran_sar 3 жыл бұрын
Wooooow, you rock!!! Your videos are awesome, clear and to the point.
@RougeEric
@RougeEric 3 жыл бұрын
Interesting! I tend to use em (not rem) in all instances while making sure to always keep things very simple: End-points (so , , tags and the like) get an EM value, all padding, margins, etc. use em values, image sizes use em values (with srcset so the image can be much larger but display properly based on the actual display needs) or vector art. Then I will have "containers" like a or , or even a which can be designed to "mod" the size (say you want "big quotes", then that tag gets a font-size of 1.4em for example). Anything drastic or that could have many exceptions will be set using a class instead of a tag so that I don't have to override these em values constantly. Then I just use my body's font-size as a responsive breaking point. That clamp trick would work wonders there, since it would affect the entire site's content within controllable bounds!
@user-yz5hj3zg2x
@user-yz5hj3zg2x 2 жыл бұрын
I don't know if you already watched this, but if not, take a look: kzbin.info/www/bejne/ppLYpaR6psZoaqs
@BasilBear
@BasilBear 2 жыл бұрын
Thank you, Kevin, that was precisely what I was looking for. I have subscribed for more. :)
@unizfrhn2803
@unizfrhn2803 3 жыл бұрын
Man, why is this guy so awesome with CSS.
@rconr007
@rconr007 3 жыл бұрын
Awesome as always. You never disappoint!!!
@anuragsuryawanshi4177
@anuragsuryawanshi4177 2 жыл бұрын
He has video for my every css doubt
@zrowork1362
@zrowork1362 3 жыл бұрын
Great, helpful staff. Love how you explain what I shouldn't use. Made my day. Thank you!!
@bobbysilver272
@bobbysilver272 3 жыл бұрын
Yet another great video Kevin! Thank you.
@ViorelMocanu
@ViorelMocanu 3 жыл бұрын
Excellent technique with the clamp + calc (implied)! :) Thanks!
@lakshyachopra_
@lakshyachopra_ 3 жыл бұрын
Amazing stuff as always, thanks a lot!
@schism1986
@schism1986 3 жыл бұрын
Neat! I've tried to do this with .less and never was able to, this is really nice!!
@AniketEdot
@AniketEdot 9 ай бұрын
Thank you for this video. Really helpful.
@AI_Bibliophile
@AI_Bibliophile 3 жыл бұрын
Wow This is Great Man ❤️
@ryandornanuk
@ryandornanuk 8 ай бұрын
Amazing video, thank you so much.
@MrSteini124
@MrSteini124 3 жыл бұрын
This is fantastic, thanks so much for these fun vids
@TomasHradckyComposer
@TomasHradckyComposer 3 жыл бұрын
Wonderful. Understandable. Incredibly useful. Thank you.
@nitram_nosnibor
@nitram_nosnibor 3 жыл бұрын
What a great solution!!! I really enjoyed this vid (whilst eating breakfast ha ha). Thanks Kevin 👍🏻
@ucielsola
@ucielsola 3 жыл бұрын
As always, outstanding. Thanks, Kev!
@crawfordpaul7890
@crawfordpaul7890 2 жыл бұрын
Really good stuff. I'm learning a ton from your videos. Thanks for putting them together.
@amankaushik5833
@amankaushik5833 3 жыл бұрын
awesome, exactly what I neeeded
@asrockriel
@asrockriel 3 жыл бұрын
Great Video, Right now, was currently using vw, vh approach never heard of that clamp function seems really interesting, the only issue i see is the support. It's actually less supported than grid-layout, but surelly when browsers keep evolving will be a must use.
@kelvindogbe635
@kelvindogbe635 3 жыл бұрын
this video is awesome thanks a lot Kevin
@zachjensz
@zachjensz 3 жыл бұрын
People really gotta clamp down on text like this :D
@wwhill8033
@wwhill8033 3 жыл бұрын
Great video, thanks Kevin
@aggelos_kilitis5405
@aggelos_kilitis5405 3 жыл бұрын
Amazing work man, you have taught me a lot of things from your videos! Keep it up!!
@chrisstucker1813
@chrisstucker1813 Жыл бұрын
Killer tutorial !
@ericdimarzio5756
@ericdimarzio5756 Жыл бұрын
Wow this is great! Thank you thank you thank you!!
@matteozhang7140
@matteozhang7140 3 жыл бұрын
Literally saved my day!!
@aleksandercross5936
@aleksandercross5936 2 жыл бұрын
Really good stuff., thank You!
@eminm6383
@eminm6383 3 жыл бұрын
awesome job dude, thanks.
@andreibade
@andreibade 11 ай бұрын
8:08 Why add 12vw + 1rem, when you zoom it won't scale right Why don't you multiple 1rem by some vw instead so it will scale better when zooming?
@norvusordoseclorum
@norvusordoseclorum 2 жыл бұрын
I think the fall in love with CSS bit has drastically changed!
@papluha32
@papluha32 2 жыл бұрын
Great! ♥♥♥ :-) Thank you Kevin. Really helpful.
@RehctubNomis
@RehctubNomis 3 жыл бұрын
LOVE that t-shirt!
@metekavruk_Alanya
@metekavruk_Alanya 3 жыл бұрын
Loved the t-shirt... and tutorial of course...
@kaanozk
@kaanozk 4 ай бұрын
the answer i was searching for.
@photoinshot1355
@photoinshot1355 Жыл бұрын
Great tutorial very helpful and demonstrates responsive text methods very well, thanks. I am not very experienced with css so this is a great introduction to responsive text. I am very interested to learn more about the overall layout design with this newspaper - magazine type layout which is great and makes the whole page more interesting to look at and more inviting to read. Do you have another video explaining the concepts behind this layout design? I can work out quite a lot from the code you kindly supplied in the codepen (thanks!) but some of the code I don’t understand. Thanks again!
@benja-min1588
@benja-min1588 3 жыл бұрын
Thank you Kevin!
@mathzygote
@mathzygote 3 жыл бұрын
Thats awesome🔥🤯
@AFE-GmdG
@AFE-GmdG 3 жыл бұрын
CSS Variables - a great invention!
@LemonBoy_483
@LemonBoy_483 Жыл бұрын
thank you for help me : )
@shapelessed
@shapelessed 3 жыл бұрын
Ok, honestly I rarely ever say that but today I actually learned something I didn't know about..,
@MuhamedAlfaifi
@MuhamedAlfaifi 3 жыл бұрын
I like your css content
@RickBeacham
@RickBeacham 3 жыл бұрын
Thanks for the pro tips.
@smartdub
@smartdub 3 жыл бұрын
Wow, that ‘clamp()’ 🤯 i didn’t know about it. Merci
@KevinPowell
@KevinPowell 3 жыл бұрын
bienvenue!
@Bluukeson
@Bluukeson 3 жыл бұрын
I have been using a root vw font-size that is based to the Adobe XD artboard size. I'm using scss functions to aid me with this but it can be done with calc. this would look something like this: html{font-size: calc(20 / 1280 * 100vw)}. This will make it so that 1rem is 20px at a viewport width of 1280px. As you resize the viewport this relation will stay the same. Then you can use a different relation for a mobile width using media queries. This allows not just my text but other elements with rem/em values to scale perfectly with the viewport width. As a nice bonus I can use the same px values used on the XD artboard. I just have to convert them to em/rem. I use scss functions for this again to keep things neat but you can use calc for this as well. With a container width of 500px it would look like this: width: calc(500 / 20 * 1em); 20 being the base font-size that is also defined in the root font-size. This certainly brings a lot of advantages. My designer has a print background so a lot of his layouts heavily rely on the right ratio between text and other elements like images. But of course there a downsites as well. Aside from running into some unexpected bugs from time to time the two major issues are: 1. zoom accessibility 2. some layouts don't work very nice on larger screen sizes because you end up with very litte content being visible at a time. this might all be a bit much for a youtub comment but oh well xD
@DarkAsylumVideos
@DarkAsylumVideos 3 жыл бұрын
This is something I've been trying to figure out how to do via SCSS. Any chance you make a follow up with how to do this? Keep up the great work.
@anatanhofer3191
@anatanhofer3191 3 жыл бұрын
Great content as always! :) I really appreciate that you talk about pros and cons for every decision. I have only one question, if I read correctly clamps() is not supported by Internet Explorer... so how the page behaves when you open it in IE? I am not sure how many people still uses the IE but I think it is still in use in business segment.
@ooogabooga5111
@ooogabooga5111 3 жыл бұрын
IE what , IE who
@illyaassowunmi6183
@illyaassowunmi6183 2 жыл бұрын
@@ooogabooga5111 Internet explorer bruh
@bobrobertsNotUrBob
@bobrobertsNotUrBob 3 жыл бұрын
damn that is smart, never thought about root on media queries
@SivakD
@SivakD 3 жыл бұрын
Clamp is a good one. Thanks. I kinda wish they had something where you could set a size based on the parent container's width instead of the whole viewport.
@roberotful
@roberotful 3 жыл бұрын
percent!
@Danko_HS
@Danko_HS 3 жыл бұрын
@@roberotful I 100% agree with what Rob said 😉 Or is it 80%? I don't know anymore.
@ormuriauga
@ormuriauga Жыл бұрын
Doesn't work for font-sizes though :(@@roberotful
@roberotful
@roberotful Жыл бұрын
@@ormuriauga I think setting font-size as percentage goes by percentage of the element-level font size, similar to em (I could be totally wrong, just my present understanding). I think percentage is a bit unintuitive for font sizes though, I usually use rem!
@FawadJaved
@FawadJaved 3 жыл бұрын
whats with 499 and 599 and 699. almost every time you have you remove 99 to replace it with 00?
@copyninja_03
@copyninja_03 3 жыл бұрын
Thank you very much.
@UndefinedComment
@UndefinedComment 3 жыл бұрын
Something that I don't really understand is: Do I have to adjust the font-size for every element? Because if I change the font-size of , every rem unit will adjust as well, which I don't want. It seems, as if I should define all font-sizes via classes, which I think is unnecessary for all regular text. I just want to overwrite the font-sizes at each breakpoint, like I do with h1-h6 and so on.
@MackaBaer
@MackaBaer 3 жыл бұрын
pure gold
@cortarelva
@cortarelva 3 жыл бұрын
Pure gold right here.
@ooogabooga5111
@ooogabooga5111 3 жыл бұрын
waoo this just blew my mind
@philwatts
@philwatts 3 жыл бұрын
What's a "headach"?
@roberotful
@roberotful 3 жыл бұрын
I've been sacrificing accessibility a bit on some of my projects by using viewport measurements, love the clamp idea. To solve the problem of vw getting super big/super small I had swapped to vh which I actually find to be a pretty good scalable solution - works well on both desktop and mobile once you find the sweet spot - if you don't mind it always being the same size regardless of zoom (which I think you obviously should mind now that I know clamp exists!)
@huseynaliyev3457
@huseynaliyev3457 3 жыл бұрын
Great solution. And by the way you have exactly 350.000 followers by now.
@KevinPowell
@KevinPowell 3 жыл бұрын
🥳🥳
@mikejackson7230
@mikejackson7230 3 жыл бұрын
Woah, clamp() is native CSS? Awesome!
@RickBeacham
@RickBeacham 3 жыл бұрын
I think scss is moving to native css.
@КостянтинПетля
@КостянтинПетля 3 жыл бұрын
I have watched a few of your videos. Good work! But I have a question about your approach to the rem. For example, we can see 14px as a base font size in our mockups. There are several approaches: 1) to use 62.5% for HTML font size and 1.4rem for body, etc. 2) to use 100% for HTML and 0.875rem for body, etc. 3) to use 87.5% for HTML and 1rem for body, etc. 4) others? Wiche one do you prefer and why? The Bootstrap 4 sets $font-size-base: 1rem to the body and nothing to HTML. The Foundation sets $global-font-size: 100% to HTML and nothing to the body. Both of them think in the base font size categories (1rem). I had experience with fluid typography by changing the HTML font size with a formula with vw (14px on mobile to 18px on desktop). It works well until we don't have mockups for several screen sizes. You can't use fluid rem in Foundation if the gutter is the same on mobile/tablet/desktop mockups. Long story short: I'm looking for the best approach with rem/rem-calc()/sizes/typography.
@pahtashow
@pahtashow 2 жыл бұрын
ответ нашли на свой вопрос ?
@permanar_
@permanar_ 2 жыл бұрын
Never change your fontsize to 62.5%. That's not a very wise choice.
@theeemed
@theeemed 2 жыл бұрын
@@permanar_ why shouldn’t you do that?,
@kevinfredericks2335
@kevinfredericks2335 3 жыл бұрын
Clamp creates an s-curve for mapping font size to screen size. You can also achieve this with calc(#vw -#vw) but setting bounds with clamp() is much more Design Driven. Anything that helps detangle the mental exhaustion of mapping design goals to math is a big win
@alexandermushibwe4745
@alexandermushibwe4745 2 жыл бұрын
Another sub for you ❤✌
@НикитаС-ь3ь
@НикитаС-ь3ь Жыл бұрын
What about line-heigth? Can we use clamp() with it?
@DaveEricsson
@DaveEricsson 2 жыл бұрын
I built a logo name slogan hero in svg and to approve the relations always stay the same gave the svg a relative unit. Works fine for all screen sizes and is super fluid, but is definately no work case for paragraphs 😄
@carolmckay5152
@carolmckay5152 3 жыл бұрын
This is a great approach thanks Kevin, the vars, I have been struggling to get my clamps just so with this last project I am working on and am thinking I will drop it for the custom variables approach for future projects and give the IE browser a fallback. One thing I'd like to add, the mobile body text needs to be 1.3 times bigger than desktop because people tend to hold the mobile screen further from their face.
@monarchgam3r
@monarchgam3r 3 жыл бұрын
Please make a video about Z-index and how it works especially when working with ::before & ::after and how parent’s position might change things I’m currently working on some things and it involves a lot of layering of stuff, and trying to use pseudo elements things don’t seem to work the way I thought they did
@KevinPowell
@KevinPowell 3 жыл бұрын
This might be what you're after: kzbin.info/www/bejne/q4SbnWePh72Vl9k
@monarchgam3r
@monarchgam3r 3 жыл бұрын
@@KevinPowell thanks a lot 🙏🏽
@arjunsharma1300
@arjunsharma1300 3 жыл бұрын
KEVIN SIR LOVE FROM INDIA ♥️🤘 KEEP UP THE GUD WORK 🙏🙇
@MikeNugget
@MikeNugget 3 жыл бұрын
How to place different length text into the div with fixed width and height?
@marwanak10
@marwanak10 Жыл бұрын
I use clamps but let's say the max size is 32px, then when viewing on a 4k large monitor the font is small again and we go back to the media query solution...
@msk7148
@msk7148 3 жыл бұрын
All fonts - make in Rem < and @media maybe change just a ----- Rem?
@kelvindogbe635
@kelvindogbe635 3 жыл бұрын
Kev. can you please do a tutorial on css design system/layout/structure. I will really be looking forward to that. thanks
@cate01a
@cate01a 2 жыл бұрын
dude the vw is a miracle
@floraposteschild4184
@floraposteschild4184 3 жыл бұрын
Those two :roots...yet another "oh, that's smart" moment in your videos. Thanks! If I understand correctly, that 1rem of the 12vw + 1rem is just a token amount, so you can pinch the screen -- is that right? If so, is there any reason NOT to put similar measurements throughout your CSS? e.g. for the --fs-400, could you put .5vw + .5rem, or whatever the size equivalent would be?
@name_code5092
@name_code5092 2 жыл бұрын
Can you explain the before and after and declaring box sizing to border box
@name_code5092
@name_code5092 2 жыл бұрын
Im just a beginner
Position absolute and responsive layouts
27:38
Kevin Powell
Рет қаралды 97 М.
min(), max(), and clamp() are CSS magic!
18:12
Kevin Powell
Рет қаралды 302 М.
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН
요즘유행 찍는법
0:34
오마이비키 OMV
Рет қаралды 12 МЛН
The problems with viewport units
13:23
Kevin Powell
Рет қаралды 369 М.
7 Practical CSS Typography Tips & Tricks
20:17
CSS Weekly
Рет қаралды 4,1 М.
CSS Clamp Simplified, with Fluid Responsive Typography Examples
9:19
Deeecode The Web
Рет қаралды 8 М.
Flexbox design patterns you can use in your projects
15:33
Kevin Powell
Рет қаралды 446 М.
Avoid These 5 Awful CSS Mistakes
20:42
Kevin Powell
Рет қаралды 199 М.
Responsive Typography Scale in Figma (The Best Method)
6:05
Dennis Leoca
Рет қаралды 34 М.
Responsive Typography with CSS Clamp
8:37
Tom Is Loading
Рет қаралды 60 М.
Using CSS custom properties like this is a waste
16:12
Kevin Powell
Рет қаралды 184 М.
Please stop using px for font-size.
15:18
Coder Coder
Рет қаралды 248 М.
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН