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

3-Column Responsive Layout

P
Stefan 90

@Saitenhexer

Desktop design screenshot for the 3-column preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I tried to use the DRY Principle with the Buttons but the text color was different.

Would there be a way to inherit the background color as the font color?

Community feedback

Jaz 190

@arfernn

Posted

I see what you mean with your question. However I think sometimes it's better to not to take things to the limit. It is good that you try to not to repeat the same color multiple times, but this is precisely why you made it a variable, to be able to reuse the actual value in multiple places. And if you change the value, you have to change it only in one place.

background-color can be inherited if you add in the children background-color: inherit. But you can't use the inherited value to assign it to a color property, as far as I can tell.

Marked as helpful

1

P
Stefan 90

@Saitenhexer

Posted

@arfernn

Yes, that's a good point with the variable.

It just stood out to me like "why write something 3x".. but you're correct with not always taking things to the limit.

Thank you :)

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