
Responsive landing page with my own implementation of fluid typography
Design comparison
Solution retrospective
I implemented fluid typography in Sass using mixins and functions. It enables responsive font sizing that adjusts based on the viewport width while maintaining a smooth transition between different breakpoints.
@import 'fluid-typography';
$font-family: 'Red Hat Display', sans-serif;
$text-preset-1: (
font-size: (
font-size-1: (fs: 2.5rem, vw: $viewport-mobile),
font-size-2: (fs: 3rem, vw: $viewport-tablet),
font-size-3: (fs: 4rem, vw: $viewport-desktop),
),
styles: (
font-family: $font-family,
font-weight: 900,
line-height: 110%,
letter-spacing: 0,
text-align: center,
)
);
.header__title {
@include fluid-typography($text-preset-1);
color: $slate-900;
}
What specific areas of your project would you like help with?
Any suggestions are welcome! 😊
Community feedback
- P@rf1303Posted 4 days ago
I liked it, it seems to be very good, only the spaces, compared to the design, otherwise excellent.
Marked as helpful1P@KonradJamPosted 4 days ago@rf1303 Thank you for reviewing my code!
Yes, I agree with you! But in my defense, I'll say that design has too much spacing variables. I create variables from figma, for example, I have:
$spacing-800: 64px; $spacing-900: 72px;
But in design, you have set
padding
to68px
. So in this situation I use$spacing-800
or$spacing-900
, I don't create extra variable or set padding without variable. 🙂1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord