Design comparison
SolutionDesign
Solution retrospective
- It was a little challenge to add google fonts in tailwind css
Community feedback
- @ledesmxPosted about 1 year ago
Hi Baruti Baruani ๐
Great job on your solution!
Here are some recommendations for you:
- Use Semantics for the proper design of your code. I suggest to adding a
<main></main>
tag for your main content. - There is a better approach to changing the background color in React. You can change the background color of the App component instead of the body tag inside the index.html file. In your App component's code add.
return( <main className="bg-primary-blue"> {/*Your code here*/} </main> );
- Use Flexbox to center your content. Now that all your content is surrounded by this main tag. You can easly center your content by adding
flex min-h-[100vh] items-center
Code to remove:
/*Remove the class attribute in the body tag*/ class="bg-primary-blue">
Code to add:
const App = () => { return ( <main className="flex min-h-[100vh] items-center bg-primary-blue"> {/* Here your code */} </main> ); }; export default App;
Lastly, if you want to know other ways to import Google Fonts with Tailwind CSS check out this blog: https://dev.to/thomasvanholder/add-a-custom-tailwind-css-fonts-to-your-website-1nn6
I also recommend you to check the documentation: https://tailwindcss.com/docs/font-family
I hope this helps a little.
Well done for the rest.
Marked as helpful0@Baruti-1Posted about 1 year agoThanks a lot for your useful feedback. I'm working on it.
0 - Use Semantics for the proper design of your code. I suggest to adding a
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