Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Conversation

@Sabella-8
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Issues
1 New issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

return fetch("https://xkcd.now.sh/?comic=latest")
.then((res) => {
if (!res.ok) {
throw new Error("error");

Choose a reason for hiding this comment

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

Make sure your errors always give some more information about what went wrong. If you just see the text "error", you might be confused about what actually happened

margin-bottom: 20px;
}

#comic-container {

Choose a reason for hiding this comment

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

This is a great opportunity to mention margin collapsing. Because your h1 and #comic-container have a bottom/top margin, and they are next to each other (or more technically they are 'adjacent siblings'), their margins 'collapse' into a single 20px margin.

This basically means that your margin-top isn't having any affect.

My personal preference here is to avoid margin-top and only apply margin-bottom to elements arranged vertically, so it's really clear which margins are being applied. In that case, the h1 would have a bottom margin, and the #comic-container wouldn't have any margin at all.

Copy link

@SpectacularLandscape SpectacularLandscape left a comment

Choose a reason for hiding this comment

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

Looking good, Sabella! 🚀

I've left some comments if you want to dive deeper into what we covered here, but well done on a great little app!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants