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

Product Preview Card using SCSS and Flex

@ldonnianni

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I found it difficult to deploy from github-pages with the folder structure using scss (deploying from the dist folder). I did it, but I don't know if it is best practices to put the IMG folder inside the dist folder. It was the only way I could see the images in the live url.

Is my first time using scss, so probably needs a lot of work.

I tried to do the media queries for the responsive version in a separate partial scss to import later in the main. But it didn't work because it kept putting it in the begining instead of the end of the code.

Community feedback

@0xabdulkhaliq

Posted

Hello there 👋. Congratulations on successfully completing the challenge! 🎉

  • I have other recommendations regarding your code that I believe will be of great interest to you.

POINTING CURSOR ↗️:

  • Looks like the component's button element has not a pointer, this property plays a major-role in terms of both UI & UX
  • The cursor: pointer CSS property is important for button-like elements because it changes the cursor from the default arrow to a pointer when hovering over the element. This provides a visual cue to the user that the element is clickable and encourages interaction.
  • In terms of UI/UX, using cursor: pointer helps to improve the usability of the interface by making it easier for users to identify interactive elements. It also helps to provide feedback to the user by indicating which elements are clickable and which are not.
  • So we want to add this property to the following button element
.product-card__info-btn {
   cursor: pointer;
}
  • Now your component's button has got the pointer & you learned about this property as well

.

I hope you find this helpful 😄 Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

0

@ldonnianni

Posted

Thanks @0xAbdulKhalid I completly forgot about it!

0
adonisloyd 510

@adonisloyd

Posted

perfect! Your design looks exactly like the example.

0

@kabir-afk

Posted

The reason you had to put your images in dist folder is because your index.html is inside that folder.

Look , whenever you deploy a webpage through gh-pages , it first scans your repo for an index.html file , but since your index.html was in dist folder you had to change the abs paths for other urls as well like for images . . .try to keep your index.html seperately , that way all the files will be globally available, and your repo would be easy to deploy

<picture class="product-card__image">
              <source media="(min-width: 600px)" srcset="
            images/image-product-desktop.jpg">

            <source srcset="
            images/image-product-mobile.jpg">

            <img src="images/image-product-desktop.jpg" alt="perfume-Gabrielle">
        </picture>

your index was inside dist and images were outside , due to which the images weren't accessible , since urls work in heirarchial order. . . if both of them were independent file/folders , you would have constructed url in the same way you did here

0

@ldonnianni

Posted

Hi @kabir-afk , I understand that putting the index.html in the dist folder and deploying from there is changing my abs paths. What I don't know how to do is working with scss (which create the dist/css folder). If I put my index outside the dist folder it won't recognize my css. thanks.

0

@kabir-afk

Posted

@ldonnianni well then you can change the abs path of the css file in your index.html, with something like

<link rel = "stylesheet" href="dist/styles.css"> 

since your scss file and generated output css file are in dist folder , by changing their abs paths like mentioned above will make them accessible .

Marked as helpful

0

@ldonnianni

Posted

Thanks @kabir-afk I'll try that.

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