Piesz
KPCKevin Powell - Community
•Created by Piesz on 6/25/2024 in #front-end
Where should I use the clamp() function and what to use for responsive design overall
Just what the title says. When I've discovered the
clamp()
function, I've been using it everywhere so I can avoid media queries, should I keep doing that? I've been using that for padding, margin, position, everything overall, here is a sample of my code:
should I keep doing that? Or is there a better practice?31 replies
KPCKevin Powell - Community
•Created by Piesz on 6/23/2024 in #front-end
What is the best practice for responsive font resizing?
So, as far as i know I should use the
rem
unit for fonts to not interfere with users preferences. But what should I use for dynamic font resizing? Like there will be a difference between the size of the font on desktop and on a mobile phone. AI suggested to do something like this: font-size: calc(! * @)
Where:
!
- default size like 1.5rem
etc.
@
- scale factor determined by the vw
unit. Something like 0.5vw
etc.
Like, I tried that and it for sure works, but is it a good method ?11 replies
KPCKevin Powell - Community
•Created by Piesz on 6/22/2024 in #front-end
Can't seem to understand the CSS em unit and the why should I use it for padding and margin
Basically what the title says, yes, I've watched Kevin's video about it, yes, I've watched the
webdevsimplified
video on it; but still I can not understand this. Also why should I use it over percentages ? Please explain it to me using simple examples, do not overcomplicate things45 replies