Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive Landing page for recipe webpage

YOGESH 30

@yogesh-stack-dev

Desktop design screenshot for the Recipe page coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

LEARNINGS

some of the major learnings while working through this project. Writing is a great way to reinforce our own knowledge.

code snippets, see below:

/* fonts.css */
@font-face {
  font-family:'YoungSerif' ;
  src: url('../assets/fonts/young-serif/YoungSerif-Regular.ttf') format('truetype');
}

.title { 
  font-family: 'YoungSerif';
  font-weight: 400;
  font-style: normal;
}

What challenges did you encounter, and how did you overcome them?

CHALLENGES

  1. Challenge with HSL Colour in Tailwind CSS Configuration

The colour provided is in HSL (Hue, Saturation, Lightness) format, which is not directly compatible with Tailwind CSS configuration using HEX or RGB.

Solution:

To address this challenge, convert the HSL color to HEX format using Google's default color picker.

Example:

  1. Use Google's default color picker or another tool to obtain the HEX equivalent of the HSL color.
  2. Update the Tailwind CSS configuration with the HEX color.
// tailwind.config.js

module.exports = {
  theme: {
    extend: {
      colors: {
        customColor: '#XXXXXX', // Replace with your HEX color
      },
    },
  },
};
  1. Challenge with Integrating TTF Files for Fonts

I encountered a challenge while working on the project regarding font integration. Instead of using the Google Fonts API, I opted to include TTF files directly.

Solution:

Successfully addressed the font integration challenge by utilizing the @font-face CSS rule. This solution allows for custom font definition directly in the project, providing greater control over the font rendering.

/* fonts.css */
@font-face {
  font-family:'YoungSerif' ;
  src: url('../assets/fonts/young-serif/YoungSerif-Regular.ttf') format('truetype');
}

.title { 
  font-family: 'YoungSerif';
  font-weight: 400;
  font-style: normal;
}

Community feedback

P
Abbas Sher 440

@Abbassher55

Posted

Your solution looks great but i have some suggestions according to your challenges. First: if you want to use colors in hex,hsl,rgb etc and vice versa and you dont have the given format then write it in vs code css file which have its own converter and will change it directly in ur editor for you from one format to another. Second : To use other font in tailwind u can make changes like below in tailwind.config.js file.

In tailwind.config.js

theme: {
    OtherProperties....
    fontFamily: {
      'sans': ['ui-sans-serif', 'system-ui', ...],
      'serif': ['ui-serif', 'Georgia', ...],
      'mono': ['ui-monospace', 'SFMono-Regular', ...],
      'display': ['Oswald', ...],
      'body': ['"Open Sans"', ...],
    }

Then u dont need this in ur css

.title { 
  font-family: 'YoungSerif';
  font-weight: 400;
  font-style: normal;
}

Now after this u can use font-sans, or font-mono .... classes in your project.

And also for font weight we have these tailwind classes.

font-thin => font-weight: 100;
font-extralight => font-weight: 200;
font-light => font-weight: 300;
font-normal => font-weight: 400;
font-medium => font-weight: 500;
font-semibold => font-weight: 600;
font-bold => font-weight: 700;
font-extrabold => font-weight: 800;
font-black => font-weight: 900;

Happy coding

Marked as helpful

0

YOGESH 30

@yogesh-stack-dev

Posted

thank you, @Abbassher55

0
P
Abbas Sher 440

@Abbassher55

Posted

@yogesh-stack-dev My pleasure

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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