Design comparison
Solution retrospective
I'm a bit dizzy because this is the first time I've tried Tailwind because I have to go back and forth to open the documentation haha, and I'm a bit confused about using arbitrary values so I created a new css file just for custom colors. does it not work in project without framework? all feedback will be very meaningful
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
BACKGROUND iMAGE 📸:
- Looks like the background svg has not been properly set yet, So let me share my css snippet which helps you to easily apply the
background color
with thebackground svg
they provided to place perfectly as same as design.
- Add the following style rule to your css, and then experience the changes
body { background: url(./images/pattern-background-desktop.svg) no-repeat, #E1E9Ff; background-size: contain; }
- Tip, Don't forget to generate a new screenshot after editing the
css
file
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful0@UnFikPosted over 1 year ago@0xAbdulKhalid ahh, I didn't realize there was an svg background, thanks!
0 - @akpekigPosted over 1 year ago
Arbitrary values and custom colours are quite different. You can set arbitrary values in the class of an element by putting the value in square brackets after the dash like so:
<div class="w-[45%]">...</div>
. Note that when using arbitrary values, you must include the unit.Custom colours are what you set in Tailwind's configuration. You can do this without any framework by including inline script in your HTML file's head. However, Tailwind literally describes itself as "utility-first" and "component-driven"; even though you can use it without a framework, it's very clearly intended to be used within one.
Marked as helpful0@UnFikPosted over 1 year ago@akpekig Regarding the arbitrary value, I have tried it according to the documentation but for some reason it doesn't work, but for the tailwind config documentation it is very useful, thank you!
0@akpekigPosted over 1 year ago@UnFik Just tested it locally. It seems that arbitrary values also require the Tailwind module itself, meaning you have to add the script tag with Tailwind's CDN link in the HTML head for it to work.
Marked as helpful0
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