Please stop using px for font-size.

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ย. 2024

ความคิดเห็น • 452

  • @TheCoderCoder
    @TheCoderCoder  4 หลายเดือนก่อน +159

    It is totally fine to use pixels for things like spacing: margin, padding, gap; as well as border and border-radius. In those cases it actually might be slightly better to use pixels, because having your spacing *not* scale up will leave more real estate on the page for the text, which can help with readability. But I think you can use either px or rems/ems for these cases and they are both fine solutions.

    • @thestranger8528
      @thestranger8528 3 หลายเดือนก่อน +13

      I'm that UI UX designer you won't want to work with if you don't embrace the beauty of PX. Even my shoe size is 80px

    • @yannickmichel2566
      @yannickmichel2566 3 หลายเดือนก่อน

      I would say just don't mix... like as ur sidebar example... if u do pixels do them everywhere :D

    • @john_elstar
      @john_elstar 3 หลายเดือนก่อน +2

      Happy 500k subscribers, Coder Coder!

    • @mina86
      @mina86 3 หลายเดือนก่อน +6

      I’d argue padding and margin should use rems as well since they are often meant to be proportional to text. Someone who needs to set their default font to 32px probably also want spacing between paragraphs to be increased.
      Also, the way to deal with conversion between pixels and rems is to stop thinking in pixels and use rems. If you’re worried about rounding to full pixels, use one eight granularity for the dimension (i.e. only .0, .125, .25, .375, .5, .625, .75 and .875 fractions; you can use one 16th but it’s harder to remember all the fractions).

    • @CreateRealWorld
      @CreateRealWorld 3 หลายเดือนก่อน

      Also, feel free to use px for little experiments. :)

  • @jordankendall86
    @jordankendall86 3 หลายเดือนก่อน +58

    I wish when I started learning CSS that they would just start with teaching rem instead of px. It would have saved me a lot of time and brain power.

    • @quinten01
      @quinten01 หลายเดือนก่อน +7

      Agreed. Pixels has become somewhat of a bad habit for me and we all know those are hard to unlearn.

  • @jackdavenport5011
    @jackdavenport5011 3 หลายเดือนก่อน +108

    The main reason I started using em/rem is because it just looks more consistent since all of the font sizes are multiples of the base font size which makes the design of your site look more consistent. I had no idea about the accessibility benefits but I'm glad I do now! Great video :)

  • @TheCoderCoder
    @TheCoderCoder  4 หลายเดือนก่อน +82

    🚨 I misspoke at 14:15 - 14:33 -- if you're using the 62.5% hack, I said that "everything on your website will be smaller," but what I meant was the 3rd party packages will be smaller on your website. And you may have to make their sizes LARGER (not smaller) to work on your website.

  • @najmantube
    @najmantube 3 หลายเดือนก่อน +39

    I've been setting html {font-size: 10px} then body {font-size: 1.6rem} etc for a long time. After watching this, I set the browser font size to 'very large' and the font-size on my web page stayed the same! (as I'd predicted after watching your video). But, following up on an earlier comment on this thread, I went looking for a vscode extension and found one that works: "Convert px to rem" v0.0.10 - by gwanduke. So you could write your entire CSS file in px, then select all/some, then Ctrl+Shift+P, then type: convert px to rem of selections. PS. Excellent video, very informative!

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน +4

      Thanks for watching! That sounds like a great extension too!

  • @dasten123
    @dasten123 4 หลายเดือนก่อน +67

    For some reason, I have never even thought about using rem on media queries. But it makes total sense!

    • @peterpancik
      @peterpancik 3 หลายเดือนก่อน +2

      me too, i always use rem when possible but maintain media querries in pixels :D but why frameworks like bootstrap uses pixels ? or newer bootstrap does not ? or bootstrap is a dinosaur ?

    • @RickGladwin
      @RickGladwin 3 หลายเดือนก่อน

      Same here. This really gave me something to think about.

    • @Action2me
      @Action2me 3 หลายเดือนก่อน

      @@peterpancikbootstrap is a dinosaur. It used to be essential, but I haven’t heard of anyone using it these days now that we have flexbox and grid in our toolbox.

    • @GabrielObioraanderson
      @GabrielObioraanderson 3 หลายเดือนก่อน +1

      ​@@peterpancik😂😂😂😂just learn type script instead of bootstrap

    • @peterpancik
      @peterpancik 3 หลายเดือนก่อน

      @@GabrielObioraanderson i think ts is something way different than bs :D but i feel you

  • @76248
    @76248 4 หลายเดือนก่อน +17

    This is the best argument I have seen for useing rem over px. Great video

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน +3

      Thanks for watching!

  • @Crowmeir
    @Crowmeir 4 หลายเดือนก่อน +82

    Oh my god, I was searching for how to use Rems and ems a few minutes ago and your video was on the suggested panel! I'm so happy I'm subscribed to this channel!

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน +9

      Thanks for watching! I hope it's helpful for you!

    • @sanD-xq8nb
      @sanD-xq8nb 3 หลายเดือนก่อน +1

      Hahaha te están monitoreando.

  • @dandelionwitch
    @dandelionwitch 3 หลายเดือนก่อน +7

    Thank you for considering accessibility in this video! I AM someone who uses the built-in font size setting in my browser for accessibility reasons and always wondered why it didn't always affect things in the way I expect. I see many comments from viewers who don't understand why someone would use the font size setting rather than just zooming. For my own needs, the answer is that the the font size setting's intended behaviour specifically involves increasing the font size across all websites.
    Zooming w/ ctrl+ or a page's menu increases the size of everything, which is not always what I want. It also functions on a per-website basis unless you use a global zoom setting, which is right next to the increase font size setting in the browser I use anyways. It's not any more work to set a global font size vs a global zoom setting on my end as a user, and font size is more likely than per-page OR global zoom to give me the behaviour I want.
    If you just need to zoom in to get a better view of one particular thing every so often, per-page zooming works just fine. For someone who needs or prefers ALL fonts to be a certain minimum size across all websites, without significantly impacting the viewing experience of other elements of the page, setting the font size setting in browser is a much better choice. If you read the Josh Comeau article Coder Coder linked, his article explains much the same thing as I've found through my own personal experience.

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน +3

      Thank you for sharing your experience! I hope that even though a lot of people are resistant to using rem, that my video can at least help educate those who are willing to change the way they set font-size.

    • @dandelionwitch
      @dandelionwitch 3 หลายเดือนก่อน +2

      @@TheCoderCoder I really appreciate it! I am new to web development and in addition to my *own* accessibility needs, I think it's fascinating to learn all the ways I could be able to make things that are accessible to as many people as possible!
      There's so many reasons standard practices shift over time to accommodate different usage needs anyways, imo accessibility is something people should strive to see as simply another creative challenge to learn about

  • @affiliatemonster9136
    @affiliatemonster9136 4 หลายเดือนก่อน +23

    Love the way you explained every case with examples. Great work. Thank you!

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน

      You're welcome, thanks for watching!

  • @msegmx
    @msegmx หลายเดือนก่อน +4

    The "rem" function is a great idea. One improvement though, instead of concatenating with "rem", better multiply by 1 rem, so that the result is treated as a unit "rem" rather than a string "rem". Instead of "math.div($pixel, 16) + rem;" use "math.div($pixel, 16) * 1rem;". That way, you can reuse the function in other Scss calculations.

    • @TheCoderCoder
      @TheCoderCoder  หลายเดือนก่อน +2

      that's a great suggestion, thank you!

  • @jordallef2586
    @jordallef2586 3 หลายเดือนก่อน +3

    Hello! I'm new to English so I'll try my best to show my gratitude, I must have to get advanced in english and consume much about programming, because here in Brazil the resources are rare. I think I understand what you propose to show in this video, I like the level of English it's easy to know what you are talking about. So starting today I will just use Rem/Em, thanks too much for this video! Peace ✌️

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน

      Thanks for watching!!

  • @BhanuYadav-s2v
    @BhanuYadav-s2v 2 วันที่ผ่านมา

    Atlast I found someone who talks on the issues I am facing in the design

  • @E6hosting
    @E6hosting 3 หลายเดือนก่อน +4

    It took me 10 minutes until I noticed you weren't Kevin Powell, excellent video. Thank you for explaining the maths I always thought rems and ems were just voodoo magic numbers.

  • @TomGDrAccessibility
    @TomGDrAccessibility 23 วันที่ผ่านมา +1

    Thank you for speaking out on this. Being a legally blind developer, I can validate what you’re saying 100%. There is absolutely no reason nowadays to constrain layouts and font sizes to pixels. Somehow devs think that their job is to copy a Figma template. No. Our job as devs is to care for the user and recognize the designer was just using a tool the way they knew how. Maybe the devs who can’t even think outside the pixel-size box (pun intended) will be the first to be replaced by AI!

    • @TheCoderCoder
      @TheCoderCoder  22 วันที่ผ่านมา +1

      Thank you for sharing, and I wholeheartedly agree!

  • @zshn
    @zshn 4 หลายเดือนก่อน +5

    I really liked how you explained the merits. Very well done. On the topic of using var vs SCSS functions; I think the issue root vars solve is of distributed values being harder to modify / maintain / update. root variables help centralize the different values used across the system and SCSS functions are not a replacement to it. Even if you use a SCSS function to convert pixels to rem; you now have hundreds of places where magic numbers are used - 16, 32, 24, 1000, etc. As leads / reviewers; I'd like a more consistent model of defining & standardizing those values. So both root vars and SCSS functions can and should be used together. One (root vars) helps in make change configurable and centralized, the other (functions) makes it consistent and reliable.

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน +1

      Great points! I mentioned the CSS custom properties because not everyone likes Sass or may be and to use it at their job. But I agree with you 👍🏼

  • @christiaanterveen4633
    @christiaanterveen4633 3 หลายเดือนก่อน +1

    I started building a new Drupal theme for the first time in 10 years and came accross rems in the coding standard. Your video really helped me understand how to use them and why this is important. Thank you.

  • @chrisbergr
    @chrisbergr หลายเดือนก่อน

    Oh thank you! I finally got the point why we should use rem/em in media queries. And it’s so obvious!

  • @alexandersanchez9138
    @alexandersanchez9138 หลายเดือนก่อน +6

    2:47 Pixel: **ABSOLUTE UNIT**

  • @webdevsingh
    @webdevsingh 4 หลายเดือนก่อน +5

    It's great to see videos on a tip like this! Thank you 😀

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน

      Thanks for watching! Glad it was helpful!

  • @skiesaboveunlimitedstargaz7316
    @skiesaboveunlimitedstargaz7316 3 หลายเดือนก่อน +1

    I agree. Back in 2015 I would use px.. But now, I am using "rem for Font Sizes" since we are relying in mobile responsive in many different devices... I don't need to explain here, you can do some research and investigation. Everything she says, it is true. 👍

  • @john_elstar
    @john_elstar 3 หลายเดือนก่อน +2

    Happy 500k subscribers Coder Coder!

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน +1

      Thanks so much!

  • @Necropheliac
    @Necropheliac หลายเดือนก่อน +1

    Okay, you convinced me. I’ll start using rems instead of px. 😅

  • @archer201977
    @archer201977 8 วันที่ผ่านมา

    i moved on to rems, em for long time, i can say you are correct in many ways.

  • @abolajinofiu7956
    @abolajinofiu7956 4 หลายเดือนก่อน +4

    This really explained rem usage clearly and well... Thanks a lot 👍🏿😊

  • @cswalker21
    @cswalker21 3 หลายเดือนก่อน

    Thank you Coder Coder. CSS is my kryptonite so it's great to see videos with detailed explanations and examples. I'd had this vague understanding that I was supposed to be using ems instead of pixels but it's nice to have all the ins and outs. Outstanding video as usual.

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน +1

      Thanks for watching! I'm glad that this video could help explain px / em / rem for you

  • @Lllll-03
    @Lllll-03 16 วันที่ผ่านมา

    You’re a wonderful tutor. I really appreciate all your efforts.

  • @SkyrimBeast
    @SkyrimBeast หลายเดือนก่อน

    Thanks for the video Coder Coder. I'll admit that I've had trouble absorbing the use of em's and rem's. However, I have been using such unit of measurements more and more. I never thought to use em's and rem's in media queries. You've given me something to think about.

  • @ichigo6386
    @ichigo6386 3 หลายเดือนก่อน +4

    My mother knows how to zoom in but prefers a larger font size. Some people said users can just zoom in but I find it a bit annoying when having to swipe left and right continuously just to read text on a website. That's why browsers support changing font size.

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน +2

      Totally agree

    • @tldw8354
      @tldw8354 24 วันที่ผ่านมา +1

      Wow. I allways have this problem on my phone.. I feel so stupid right now 😅

  • @NishimweRukundoProsper
    @NishimweRukundoProsper 4 หลายเดือนก่อน +7

    Great video! Your tips on responsive design and using rem units really helped me fix scaling issues. Thanks for the clear and practical advice!

  • @SothearithKONGMrMuyKhmer
    @SothearithKONGMrMuyKhmer 29 วันที่ผ่านมา

    That’s really helpful. Thanks for sharing!

  • @test-rj2vl
    @test-rj2vl หลายเดือนก่อน

    That was interesting video. As a backend developer who only knows basics about frontend stuff I have been always wondering why some websites that render correctly on desktop mix way too large font with way too small font. Seems like the answer is that they mix px and rem. If you make more design videos you could even enter smartphone's DPI and font size settings to your dev tools for even more dramatic effect.

  • @johncondino3601
    @johncondino3601 24 วันที่ผ่านมา

    Wow! This is helpful. Thank you!

  • @fiskebent
    @fiskebent หลายเดือนก่อน

    Nice video. I feel that the tricks to keep using pixel values will be counter-productive in the long run though. Take the plunge and stop thinking in pixels.

  • @kj_sh604
    @kj_sh604 3 หลายเดือนก่อน +1

    dang… looks like I'm rewriting my personal websites, this weekend 😆. Great vid!

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน

      haha! Thanks for watching!

  • @j-lewis
    @j-lewis 2 หลายเดือนก่อน

    Girl, you're the eyes-opener, you know that? I'll subscribe, good stuff!

  • @stevejohns3410
    @stevejohns3410 3 หลายเดือนก่อน

    Thanks.
    I am working on my website and this is most helpful.
    Now I am looking for video for backend that explain how newsletter subscription function.

  • @Kipex
    @Kipex 4 หลายเดือนก่อน +22

    I've gone back and forth with this topic in the past, but I'm sticking to pixels these days. I do appreciate that your video covered the often forgotten media query aspect, which I think is important if you do end up using relative units.
    I disagree with calling font size based scaling a "modern approach", considering that's basically the original approach from before responsive design and variety of devices was even a concern. Zooming in its current implementation is a more recent addition and answer to user needs. It's more accessible to the user, has a default setting and easy on-the-fly adjustment. Zoom is consistent as everything scales equally.
    The WCAG criteria "1.4.4 Resize" that you referenced in the video, also supports zooming as a sufficient technique. In fact, if you were to take the rem approach and only apply it to font-sizes, you could easily end up failing that criteria due to clipped text in smaller areas. In this regard I think pixels are far simpler to work with, not to mention the work between designers and coders.
    I recognize that the font size setting still exists and that a select few may use it, but whichever your approach is, you have provided an accessible way to resize. Chances are many such users are already using the Scale setting in Windows for example as well. They have plenty of good options available :)

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน +6

      Pixels are easier for web developers to work with, for sure, but we always need to keep the end user in mind. Both zooming and changing the browser font size are tools that are available to users, and so as developers we need to make sure that both those settings work the way users are expecting.
      Using px will make the browser font size scaling impossible-- so imo as long as it exists in a setting in the browser, I think it should actually function for users. For the clipped text in smaller areas, that is not a failing due to the font-size but would be more of a design problem or using px to set the width of the element that contains the text instead of rems.

    • @n_mckean
      @n_mckean 3 หลายเดือนก่อน

      This is an ironically long response to what is effectively a lazy development approach.

    • @codex4048
      @codex4048 3 หลายเดือนก่อน +1

      How to out yourself as a person who willingly discriminates? Write a comment like you did here.
      Although at first glance your reply is a lot better worded than the ableist comment on top, your comment also shows ableism and zero thought about the preferences of the end user.

    • @n_mckean
      @n_mckean 3 หลายเดือนก่อน

      @@notramiras I’m not sure you understand irony.

    • @LocherYT
      @LocherYT 2 หลายเดือนก่อน

      This reminds me of an essay a student wrote that was 6pages long about how he did not want to type out alt titles for every image that he used because "his website isnt frequented by those people anyways".
      People dont know that nobody dictates who should be able to navigate through your web page. Is it a granny with big magnifying glasses, is it someone without arms who uses voice commands, is it a deranged person with an anime profile picture, is it a complete color blind person? Nobody knows and they dont need to know if their approach to web design is universally user-friendly

  • @montyksycki4092
    @montyksycki4092 หลายเดือนก่อน

    Thank You for SHARING!!! 🙏🏼🙏🏼🙏🏼🙏🏼🙏🏼 🙂

  • @lowlay964
    @lowlay964 3 หลายเดือนก่อน

    Thank you! This is really informative!

  • @jrom_ai
    @jrom_ai 4 หลายเดือนก่อน +2

    Love this content 😍 Well done!

  • @realderek
    @realderek หลายเดือนก่อน

    Nice video. You would think browsers would have an option to automatically upscale fonts specified in pixels for users who require larger fonts. There are so many accessibility gotchas that I wonder why more of the responsibility doesn't lie on the browser rather than the developers.

  • @MrSuprashadow
    @MrSuprashadow 2 หลายเดือนก่อน

    Very cool CSS variable idea! It's easy for me to use rem now.

  • @tldw8354
    @tldw8354 24 วันที่ผ่านมา

    If this hack doesn't break things too deep (where you can't adjust) then I could concider this extra work as a small tradeoff to the benefit of using the whole rem based system instead of px based. I will try this on some of my next projects.
    And by the way, thank you for this great advice/tutorial!

  • @gennagraphics
    @gennagraphics 4 หลายเดือนก่อน +1

    Its good to see you back. So. rem usage is the best

  • @VJK102
    @VJK102 หลายเดือนก่อน

    This is a nice video;
    Don't think I'm gonna use it at my job any soon, tough
    We work with a mobile app, so vh/vw and hard on px gonna still be my main units

  • @devkasunlakshitha
    @devkasunlakshitha 4 หลายเดือนก่อน +1

    Really helpful video. I like that scss solution to use REM. Still love scss same as you

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน

      SCSS is awesome. Thanks for watching!

  • @itsthemangler
    @itsthemangler หลายเดือนก่อน

    I remember when I was an intermediate level coder and I agreed with this. Don't worry, you'll grow out of it when you learn more.

    • @tldw8354
      @tldw8354 24 วันที่ผ่านมา

      What is your argument?

  • @ezmess2530
    @ezmess2530 หลายเดือนก่อน

    Thank you for your hard work! Please tell me what to do with the pictures in this case? Should their sizes also be set in rem?

  • @mverma7845
    @mverma7845 4 หลายเดือนก่อน +1

    Thank you CoderCoder, really great video.

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน +1

      Thanks for watching!

    • @mverma7845
      @mverma7845 4 หลายเดือนก่อน

      @@TheCoderCoder whats the difference between em and rem, I don't see much difference between them?

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน +1

      ​@@mverma7845rems are only dependent on the root font size, but em's are dependent on the parent and any ancestor element. So if you have multiple nested elements that have em's, you will have a compounding effect which can make the element's size much larger or smaller than you would expect. Rems were created specifically to not have the same quirk. Hope this helps!

    • @mverma7845
      @mverma7845 4 หลายเดือนก่อน

      @@TheCoderCoder in the root if use font-size: 1rem; then through out my code I use font-size: 2rem etc, it will go off of the root font-size correct.

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน +1

      @@mverma7845 I'm not sure if this is what you're doing, but you don't need to set the root's font-size in your CSS (like html { font-size: 1rem; } ) -- it will automatically take it from the browser settings. But yes, setting a font-size of any element to be 2rem will be 2 * the browser font size.

  • @gabrielrochasantana
    @gabrielrochasantana 2 หลายเดือนก่อน

    Great explanation,thanks.

  • @dr3amerz3ro
    @dr3amerz3ro 3 หลายเดือนก่อน +1

    amazing video, you are one of the gratest teachers i ever seen i suscribe rigth now.

  • @Pareshbpatel
    @Pareshbpatel 3 หลายเดือนก่อน +1

    Great tutorial on why we sould not use pixels for font-size and size. Thanks.
    {2024-08-06} - Subscribed!

  • @chanki-y9q
    @chanki-y9q 29 วันที่ผ่านมา

    13:19 It seems like there is a mistake in the explanation of the ‘62.5% hack’. In @media (width < some relative size) {}, the rem and em units inside the condition are calculated based on the browser’s default font size (16px). Even if you set the HTML font size to 62.5%, the values inside the parentheses will still work according to the browser’s default font size. Therefore, even when using the 62.5% hack, you still need to use 62.5em or 62.5rem in media query conditions. Your media query operates at 1600px.

  • @stevejohns3410
    @stevejohns3410 3 หลายเดือนก่อน +1

    I like your explanation. New subscriber here.

  • @nomadshiba
    @nomadshiba 2 หลายเดือนก่อน

    also changing font-family effects font-size too, so using em/rem will be more consistent when you change font-family as well

  • @wamique
    @wamique 2 หลายเดือนก่อน +2

    So the main thing isn't just not using Pixels, the main thing is not to set default font size for the website? So that the fonts can be changed from the browser

  • @hcmac100
    @hcmac100 4 หลายเดือนก่อน +3

    Thanks so much for your time and knowledge - total respect !

  • @nogonojoe7966
    @nogonojoe7966 7 วันที่ผ่านมา

    Realy nice, thank you!

  • @ianschneider970
    @ianschneider970 หลายเดือนก่อน +1

    Hello. New to the channel, thanks for this informative and educating video. May I ask what kind of keyboard you're using? (that's broken to 3 parts).

    • @TheCoderCoder
      @TheCoderCoder  หลายเดือนก่อน +2

      Thanks for watching! The left and right parts are the Glove80, and the middle numpad is a separate board I got off of amazon

  • @Novacification
    @Novacification หลายเดือนก่อน

    The only real use case I can think of for using REM, is to scale everything responsively by lowering the base font-size in your media queries on lower resolutions. Padding, margins, text and everything else will take up less space. You can clamp your actual text size tokens/CSS variables to avoid them going below 14px - and of course other minimums for e.g. medium and large sizes, so you don't go below accessibility requirements where you might have low contrast.

  • @johnmaleek6879
    @johnmaleek6879 4 หลายเดือนก่อน +1

    Thanks a lot for this information. Great content 👏

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน

      Thanks for watching!

  • @Fede_uyz
    @Fede_uyz หลายเดือนก่อน

    Also on mobile most phones have a designated base font size, and many people increase it for accessibility, comfort or personal preference.
    Ive seen 20smth year olds have it super small to fit more text, or bigger than normal to aid in study effectiveness

  • @陈大锤-q1s
    @陈大锤-q1s 3 หลายเดือนก่อน

    Good video, great help!

  • @kenanbrunner9199
    @kenanbrunner9199 3 หลายเดือนก่อน

    Great Video!
    Still I have a question left: Would you not use pixel on media queries if you create a image layout? Since i wouldn't want the images to break into multi-column layout earlier/later than intended if the user changed the base font-size.

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน

      Thanks! It's hard to say, but I'd check how it looks when you change the browser font size, and if you like how it looks and you and see all the images fine, you can choose what unit you wanna use for that

  • @lann1sterroy
    @lann1sterroy หลายเดือนก่อน

    thank you so much for great content Jess, I truly appreciate your work.
    Could you please explain why you use em instead of rem in media queries, sorry if i missed that part.
    Thanks.

    • @TheCoderCoder
      @TheCoderCoder  หลายเดือนก่อน

      Em and Rem are pretty much identical when using media queries-- I just use em's out of habit. There used to be a bug in Safari when using rems in mq's, but that's been fixed now, so either is good!

    • @lann1sterroy
      @lann1sterroy หลายเดือนก่อน

      @@TheCoderCoder got it, thank you so much for clarification and your time.

  • @krank23
    @krank23 หลายเดือนก่อน

    In general, I feel like using px as a measurement is a bad holdover from the dark past of designers trying to make website designs that loom exactly how they want them, pixe-perfect, on every user's screen. I mean I'd LIKE that sort of mindset to be in the past, but I guess there's still way too much of that going on today too… Despite responsive design having been a thing for many a year now. Sure, designing a responsive page (with semantic html and a good structure etc) is a challenge, a bit like trying to solve a puzzle that constantly moves around, but the result is so much nicer… And getting it right is VERY satisfying. =)

  • @MsPBJTime
    @MsPBJTime หลายเดือนก่อน

    After moving to tailwindcss, it's made it simple to use rems and sectioned layouts. Yeah, it's a dependency, but I get so much more than just a style library.

  • @aldo6532
    @aldo6532 3 หลายเดือนก่อน +1

    Very good video, this. I cannot help but wonder though how many people actually change the base font size (or even know it can be changed) vs changing the base Zoom level instead (which is always one of the easiest settings to find usually right in the toolbar)

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน

      Zooming is used more, I'm sure, but there are still users who use the browser font size. Personally, I think that as long as the setting is in the browser we need to allow it to have an effect on the website.

  • @Bond-zj2ku
    @Bond-zj2ku หลายเดือนก่อน

    Could you please make a website coding tutorial for this topic only as new commers still might not get it completely.

  • @emerelle3535
    @emerelle3535 3 หลายเดือนก่อน

    rem - rapid eye movement - the movements of your eyes when you try to captures the letters all over the screen. :)
    Feels a litte bit like imperial units (or what I think imperial units would feel If I had to convert them in my head) but it makes sense and I had no idea it existed. (rem, not imperial units xD)

  • @paulroos8517
    @paulroos8517 3 หลายเดือนก่อน

    Excellent video!

  • @sivanyamurayama5523
    @sivanyamurayama5523 4 หลายเดือนก่อน +2

    Lesson Learnt, I will now start practicing with rem instead of px, thank you for the info 👍

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน

      Awesome, glad it could help!

  • @jeffmccloud905
    @jeffmccloud905 3 หลายเดือนก่อน +1

    One case where you might not what to do this is with border-width. Or maybe with box-shadow sizes and blur values.

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน +1

      Totally agree!

  • @birgitleitner1453
    @birgitleitner1453 3 หลายเดือนก่อน

    As a user I‘d zoom in, as a front-end developer I appreciate this input and will try it. It’s awesome I finally found a female content creator in Front-end yey!

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน

      Thanks for watching!

  • @souvikmukherjee2349
    @souvikmukherjee2349 3 หลายเดือนก่อน

    Thank you so much ma'am, got to learn a lot

  • @AdeyCoder
    @AdeyCoder 4 หลายเดือนก่อน +1

    I like the content learned new. thank you & keep it up.

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน

      Thanks for watching!

  • @JustinDomanais
    @JustinDomanais 4 หลายเดือนก่อน

    Thanks! that's awesome features using CSS!

  • @dei8bit
    @dei8bit 3 หลายเดือนก่อน

    omg this video change my life from here 2:38 , thanks ♥

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน

      So glad to hear that this helped you!

  • @paulambrose5442
    @paulambrose5442 3 หลายเดือนก่อน

    Cool stuff. Might build a vsCode extension that automatically converts to rem onsave

    • @najmantube
      @najmantube 3 หลายเดือนก่อน +1

      This one works pretty well (select line, block all then convert): Convert px to rem. v0.0.10. gwanduke

  • @s1art7
    @s1art7 3 หลายเดือนก่อน

    That sass function to convert px to rems is very useful, I had never thought about it

  • @TheMetalMag
    @TheMetalMag หลายเดือนก่อน

    thx for the explanation

  • @PabloSanDev
    @PabloSanDev 3 หลายเดือนก่อน

    Great video thank you for sharing your great knowledge

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน

      Thanks for watching!

  • @dzigayu4944
    @dzigayu4944 หลายเดือนก่อน

    Using rem just makes my styles look so much consistent and coherent.

  • @BhanuYadav-s2v
    @BhanuYadav-s2v 2 วันที่ผ่านมา

    Which theme you use in your vscode

  • @pitogrillo
    @pitogrillo 3 หลายเดือนก่อน +1

    This also applies to e-books. Some of them are designed in pixels and when opened on an e-reader everything looks a bit disproportionate.

  • @alvaroprietovideos
    @alvaroprietovideos 4 หลายเดือนก่อน +1

    this video was good, thanks for sharing

  • @chrisicotec7652
    @chrisicotec7652 3 หลายเดือนก่อน +1

    i cant remember the last time i used pixels for anything other than as a 0px minimum size or a 1px border or outline... i do everything like margins padding or gap with em or rem, ocassionally for vertical padding i will use vh instead.... with fonts its always em or rem, sometimes i will use % of the parent element.... when im defining a universal base size for different repeating text tags i always use a font size with a min size clamp so i dont need to redo anything with media queries for them....
    yeah the 62.5% trick does have compatability issues when it comes to third party packages, simple solution there is i dont use any third party packages, theres nothing that bootstrap, tailwind or any other package can do that I cant if i take the time to sit down and do it

  • @asc9360
    @asc9360 3 หลายเดือนก่อน

    Hey how did you achieve the font color effect like that in the heading?

  • @0xBerto
    @0xBerto หลายเดือนก่อน

    Wow. Thank you

  • @letmewatch.
    @letmewatch. 4 หลายเดือนก่อน +1

    I always knew I should be using rems and ems for (for responsiveness, but I didn't know what I was making responsive, I initially thought the font just scales down on smaller devices) sizing but always sticked to using pixels since its just a lot easier working with them (as a junior developer focused on making things look good on 3 breakpoints and standard base font size). I didn't know I needed this video, it was very useful, I finally understood the concept behind ems and rems. What do you think is the difference between ems and rems though? Why do we typically use rems for all things fonts and ems for all thing elements?
    Would really appreciate your response to this

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน +2

      I personally use rems for everything, because em's have this quirk where there's a multiplier effect if you're nesting multiple elements that all use em units. I do think one useful application for em is to use it when you're setting margin-bottom of text elements, bc it will be dependent on the -size of the element itself and so will scale with the font-size which I think is nice! Thanks for watching!

    • @letmewatch.
      @letmewatch. 4 หลายเดือนก่อน

      @@TheCoderCoder stellar! I can't thank you enough for replying!

  • @ramzyabdul185
    @ramzyabdul185 4 หลายเดือนก่อน +2

    So for text should we use rem's or em's. I always don't know the difference between the two. Or its fine to use both. Because I am a beginner and want to get the best practice

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน +1

      You can use either, but I usually use rems. Em's have a quirk where if you have nested elements that are using em's they have this multiplier effect that can make the text have an unexpected size

    • @ramzyabdul185
      @ramzyabdul185 4 หลายเดือนก่อน

      @@TheCoderCoder ok now I c. Thanks for taking your time to respond to me 🤗🤗
      I really appreciate it and I will definitely take this to consideration

  • @DjCtavia
    @DjCtavia 3 หลายเดือนก่อน

    I don't do front-end that much, but everytime I went on videos about EM / REM, I had the same issue.
    It was half clear, but with this video every little spot missing elsewhere disappeared.
    This is high quality content, examples clear and well worked.
    Probably how you are everyday, but love the pace you have for speaking!

    • @TheCoderCoder
      @TheCoderCoder  3 หลายเดือนก่อน +1

      Really glad that this video helped! Thanks so much for watching

  • @ichiroutakashima4503
    @ichiroutakashima4503 4 หลายเดือนก่อน +1

    This thing dropped when I needed to. Thank you so much!

    • @TheCoderCoder
      @TheCoderCoder  4 หลายเดือนก่อน +1

      Glad it was helpful for you!

  • @beefier
    @beefier 7 วันที่ผ่านมา

    As a visually impaired person, thank you for this

  • @speedhunter7303
    @speedhunter7303 หลายเดือนก่อน

    Depends from person using it..but dont say 'stop' using..some people use rem just to look fancy..Pixel is there for a reason..

  • @edipedipbulmaz
    @edipedipbulmaz หลายเดือนก่อน

    so shall i use rem, % or vw/vh for width and height??

  • @Valentim_Gab
    @Valentim_Gab 3 หลายเดือนก่อน

    TailwindCSS helps a lot to avoid this kind of problem.

  • @joschemd
    @joschemd หลายเดือนก่อน

    Pt is as much as a problem... REMS (Not EMS) is both easier to work with, more consistent and you can create a predictable translations with

  • @nomadshiba
    @nomadshiba 2 หลายเดือนก่อน

    thank you!