Sunnyside Agency - CSS Grid/Flex - Responsiveness Prioritised
Design comparison
Solution retrospective
Howdy!
Another project I plan to do a video for. I mostly wanted to do this project to understand images, how their heights work, how their 'inbuilt ratios' automatically update their heights as the viewport expands horizontally.
I also wanted to see how this plays into a grid solution and practiced a bit with grid-template-rows: min-content /// auto /// max-content
. In the end it was a worthwhile project. I'll spend a bit more time polishing my understanding of my own solution - as weird as that sounds - and will attempt to record a useful video or two to use in replies for anyone who might be struggling with the concepts I explored.
Cheerio ๐
Community feedback
- @emestabilloPosted over 3 years ago
Hey @grizhlieCodes, congrats on completing this project! I'm getting some text overlap on medium widths, starting at 420px or so, down on the services and testimonial section. Some of the text actually disappears right before the next breakpoint. A few more:
-
The CTA on your nav should be left as an anchor tag instead of a button wrapped in an
a
tag. -
For the images, I think there's no need to create several divs and hide/show depending on screen size. Look into
srcset
and maybe<picture>
tag to handle image changes. I'm actually not sure if the images in the services section are meaningful. I'd probably choose to keep them as background images. Then you wouldn't have to worry about grid and overlaps. -
The class nesting looks quite deep.
section.services article.service.graphic-design .text-container .service-heading
, for example, is very specific. Overriding it will be difficult. I suggest to nest sparingly, keeping classes at the root level and nest only pseudoclasses and pseudoelements.
Hope this helps!
Marked as helpful3@grizhlieCodesPosted over 3 years ago@emestabillo Darn, you betcha this helps. As soon as I read that
button
shouldn't be in<a>
I recalled reading this in the past lol, think it's invalid HTML according to the spec ๐ ??As regards to srcset I think I didn't like it recently since it's heavily based on
width
. And then when a desktop image was actually of lower width than the mobile version it wasn't behaving how I wanted it to.Perhaps I messed up the
sizes
media query? Perhaps you could sprinkle how you'd approach that sort of problem too ๐ฌ?Never used
<picture>
so I'll look into it, thanks. Think that's another clue of my cluelessness of images in html."I'm actually not sure if the images in the services section are meaningful." -> Super interesting point, never really went that 'deep' into HTML images. I think you're right, I'll apply this logic in the next image-containing project, thank you ๐
As for nesting - normally I'd agree but for this particular project I didn't care (๐คซ) because of its' 1 page nature. My Designo solution was as you recommended, where deep-nesting would truly mess up a lot of the component-logic that Designo offers the developer to use. This project I wanted to spend time on images, so your feedback is invaluable for me!
Super useful feedback, thanks so much Emmilie, super happy to get image-based advice as for whatever reason 12months later I haven't spent enough time on them, go figure!
1@emestabilloPosted over 3 years ago@grizhlieCodes Hahaha don't beat yourself up. I also have a hard time deciding whether to include images in html or not. In this case, I think I can place the cherries and orange as background images because they're not really connected to Graphic design or Photography, like I can understand them well without those two images.
As far as changing images with
<img>
and<picture>
(and even<figure>
), my idea is that if the images have different aspect ratios, I go for<picture>
. Otherwise, it's<img
withsrcset
. Still gray on some things, I'm still learning just like you.I'm gonna have to look at your Designo to get ideas once I'm brave enough to attempt it lol :-)
1@grizhlieCodesPosted over 3 years ago@emestabillo Oohhhh, alrighty, that makes a ton of sense to me now.
And Designo is awesome to do!! Still my favourite project, even comparing to the audiophile or invoice apps. I canโt recommend it enough for:
- Planning HTML and CSS/SCSS
- Thinking through components
- It was my first time using an API (leaf js for the maps).
- Really getting into making useful SCSS mixins. I still use many of them to this day.
- Managing layouts, especially the more โglobalโ ones across different pages. Like โbodyโ, โmainโ, etc.
Many more Iโm sure but I forgot ๐ฅฒ
I used designo to start thinking how to make components via HTML and SCSS. Reuse code etc. Also practices sass architecture which was a breath of fresh air ๐. Structure makes me happy.
Iโll definitely attempt a few demos in codepen to understand how you use โimgโ and โpictureโ, I like that you have a distinction there. I havenโt come across it before.
Thanks again for the useful info ๐๐
1 -
- @ApplePieGiraffePosted over 3 years ago
Hi there, Rafal! ๐
Slightly late to post this! ๐ But I wanted to drop in to say great job, once again! ๐
It looks like the discussion between you and Em has covered just about all I could suggest! ๐ Overall, everything looks really nice and I especially like the transition you put on the mobile menu! ๐คฉ
Wellโokay, tiny thingโbut it might be worth taking a look at your solution report and trying to clear up some of the errors that are there in order to improve the accessibility and semantics of your solution. ๐ I've actually learned a lot about HTML itself and a bit about accessibility by looking over my own solution reports. ๐
For instance, it's recommended that you use
span
s instead ofdiv
s withinbutton
elements becausespan
s are inline elements by default (but IDK why that matters enough to be an issue, TBH). And there isn't really a reason forbutton
elements to be wrapped in anchor tags, since elements of that sort should either be one or the other. Just small stuff, once again, but I find it a little interesting to learn about and know! ๐Well, glad you learned new stuff while completing this challenge and might even make some content for others to learn from (that's what it's all about)! ๐
Oh, yes, and keep coding (and happy coding, too), of course! ๐
Marked as helpful2@grizhlieCodesPosted over 3 years ago@ApplePieGiraffe I used to use spans, not sure why or when I switched to divs..... ๐ฎ you're right.
I think a part of my brain chooses to ignore this stuff (accessibility) so I'll use your advice and will generally study from these reports... I think I did that for the first 2 projects and then became consumed with other aspects of learning. I usually set a few targets for learning and tunnel vision on them, per project. Even the most simple projects end up teaching me stuff this way.
Thanks, useful stuff as always.
1@grizhlieCodesPosted over 3 years ago@ApplePieGiraffe I'll admit, the information about landmark-elements is pretty useful (and important, oops)... And the list of them is short, so it makes the rule quite easy to follow.
Thanks!
1
Please log in to post a comment
Log in with GitHubJoin 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