Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create HTML page using blocks previous created #4164

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

MatheusStefan
Copy link

I had some troubles with the previous task, so I made a new one:

  • DEMO LINK
  • TEST REPORT LINK
  • All component follow BEM and use SCSS
  • repeated sizes and special colors are put to variables
  • Grid is used for the columns
  • cards are shown in 1, 2, 3 or 4 columns based on screen resolution
  • All changes on :hover are smooth
  • Code follows all the Code Style Rules ❗️

Copy link

@jv-aquino jv-aquino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code is good overall and very organized!! You are improving a lot Matheus, and I hope you forgive me for being a little harsh sometimes but I'm only that way because you are a great student and I trust that you can make mind-blowing solutions!!

src/index.html Outdated Show resolved Hide resolved
src/index.html Show resolved Hide resolved
src/index.html Outdated Show resolved Hide resolved
</header>

<main
class="container"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general a container is not counted as a block, just some block of html code, so in this case it's fine

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just made like that because it's a requirement "- use <main> tag for cards container". Some requirements are awful..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, don't worry about the extensive feedbacks, I really want to improve my skills and every detail it's very important to me. Thank you so much!

src/index.html Outdated Show resolved Hide resolved
src/styles/card.scss Outdated Show resolved Hide resolved
src/styles/card.scss Outdated Show resolved Hide resolved
src/styles/card.scss Show resolved Hide resolved
src/styles/header.scss Outdated Show resolved Hide resolved
@MatheusStefan MatheusStefan requested a review from jv-aquino March 5, 2024 15:01
Copy link

@pedro-ruas pedro-ruas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor issues that prevent the expected behavior accordingly to figma design. I believe you can fix them all quite easily ;)

>
Apple
</a>
</li>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matheus, you could add an empty line here and between other sibling elements in this file, check Code Styles Rules

Buy
</a>
</div>
</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty line here would be good also, for the same reason of my previous comment, these 2 cards are siblings

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you finished this task before we review the others Stars and Product Card.
The approach you've used there is a better implementation for the stars styling for 2 main reasons:

  1. Here you have more code repetition, you could declare all stars with same styling using a different synthax (stars--0, stars--1...)
  2. Your declaration here is applying a fixed style for all stars reviews, you see, combining your BEM naming on the stars declaration in HTML with this styling here, all Product Cards will have 4 active stars, even if we change the class in HTML. Ideally, if we changed HTML class to, let's say stars__star--2, only 2 stars would be active, not 4, but because you are declaring only the last-child to be not-active, you always get 4 stars on the card, no matter the actual review count.

**Not sure if my explanation was clear, but you can ask me on chat if you want

@@ -0,0 +1,17 @@
@mixin two-columns {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your use of mixins, but I'd like to suggest a rename for them to allow them to be used more often, which is the purpose of a mixin (imagining this is part of a bigger project).

So, the way I see it, two-columns is used for small-screens or mobile, three-columns is used for medium-screens* or tablets and four-columns is used for large-screens or desktop.

Giving them a name as mentioned makes it possible to re-use them in the future for other purposes other than only the column count, imagine that you wanted to change the background color of your page based on screen size too, in this way, the name would remain meaningful for all usage.

justify-content: center;

@include two-columns {
grid-template-columns: repeat(auto-fit, 200px);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here we have a problem, actually 2:

  1. You are using auto-fit which auto calculates the column count based on element width. In this case, as the element is the whole page itself, and you are applying it for screens of max 488px, it ends up returning 2 columns (488 / 200 = 2,...). However, if let's say, you wanted 2 columns on a bigger screen, this would not be the case. And if a screen is 630px wide, it would result in 3 columns instead of 2, which is also not a desired behavior here.
  2. Second point is that you are using the same declaration for all mixins that represent screen size, so either there is no need to use the mixins, or the style declaration should be different for all mixins. Can you guess which option is the correct one? :)

**There is a hint in this image:
image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked. It says I'm 1 commit behind, but just commited an update and now it's working great!

Copy link

@EdPirro EdPirro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great effort, @MatheusStefan! You're almost there, just a few touch-ups and your solution should be perfect! 👏

Also, your deployment seems to be outdated, please make sure to deploy the latest version for review

Comment on lines +11 to +21
@include on-mobile {
grid-template-columns: repeat(2, 200px);
}

@include on-tablet {
grid-template-columns: repeat(3, 200px);
}

@include on-desktop {
grid-template-columns: repeat(4, 200px);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your deployment does not seem to be up to date with your code:

Deployed site:
image

image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna check this, thank's!

src/styles/card.scss Outdated Show resolved Hide resolved
src/styles/card.scss Outdated Show resolved Hide resolved
src/styles/card.scss Outdated Show resolved Hide resolved
src/styles/header.scss Outdated Show resolved Hide resolved
@MatheusStefan MatheusStefan requested a review from EdPirro March 12, 2024 00:15
Copy link

@EdPirro EdPirro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, @MatheusStefan! Sorry, I overlooked some issues in my last review, and I'll have to ask you to fix them 😬. If you have any questions, please let me know

</nav>
</header>

<aside
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why you have this aside here. Also, your deployment may be outdated again as it doesn't show in your deployed html:
image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used an aside tag to do a menu when on mobile. I know it's not a requeriment, but I wanted to be completely responsive, if that's okay(?). If not I'll remove it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I talked with Pedro about the deploy and he said it's working fine. Maybe your cache was deleted when testing it?

src/index.html Outdated Show resolved Hide resolved
src/styles/card.scss Outdated Show resolved Hide resolved
@MatheusStefan MatheusStefan requested a review from EdPirro March 13, 2024 18:33
Copy link

@pedro-ruas pedro-ruas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Great implementation and everything works as expected.
I really liked your approach for the menu, if I could, I'd give some extra-points for that.
Only comment is: your declarations from line 17~21 at stars.css could have been done using a @for. But all great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants