REST Countries API with color theme switcher, HTML, SCSS, JS

Solution retrospective
Hello friends, any feedback will help me a lot I have a question is it a good practice to use local storage for this challenge ? because I have two html pages and I did not know how to pass the country information to the other page except using the local storage. Thank you!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @denielden
Hi Abubkar, great work on this challenge! 😉
Here are a few tips for improve your code:
- add
main
tag and wrap all thesection
for improve the Accessibility img
element must have analt
attribute, it's very important!- to make all flag images the same height use the
object-fit: cover
properties to.section-2 .container img
class - use
ul
element for the details text of country instead of multiplep
- to make it look as close to the design as possible remove the dark
hover
effect to cards and button when the user is in the light mode - remove
margin-bottom
from.section-2 .container
class because with flex they are superfluous and usegap: 4rem
to.section-2
class - instead of using
px
use relative units of measurement likerem
-> read here - if I type a query that doesn't give any results, nothing happens, try adding a "no results" message
- I would also add a query reset button, I find it very convenient
- in the filters there is no way to return to all countries after choosing a region, add an entry "all region"
Overall you did well 😁 Hope this help!
Marked as helpful - add
- @lipe11
Hi,
Regarding your question, to pass data to another page, a common approach is to send it through query parameters, they are appended to the url like this
http://example.com/page.html?param=value
(I'll leave a reference here).Most likely you would only pass the id of the country as a parameter, and do a fetch for that id on page load.
Hope this is helpful
Marked as helpful
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