Skip to content
Submitted about 3 years ago

Nuxt3 + Tailwind CSS ( Qr Code )

nuxt, tailwind-css, typescript
LVL 3
@dimar-hanung
A solution to the QR code component challenge

Solution retrospective


Hello everyone,

I'd like to ask some questions related to the challenges I'm facing with complex components in my TailwindCSS and Nuxt 3 project. Your advice and insights would be greatly appreciated:

  1. How can one optimize the use of classes in TailwindCSS when dealing with Complex components?

  2. Is there a better approach to combining classes and TailwindCSS, as illustrated in the provided examples?

    • Example 1
    class="h-full xs:h-auto grid place-items-center shadow-xl hover:shadow-2xl transition-shadow w-full max-w-[320px] bg-white px-4 pt-4 pb-10 xs:rounded-[20px]"
    
    • Example 2
    .desc {
    font-family: "Outfit", sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 15px;
    line-height: 19px;
    text-align: center;
    letter-spacing: 0.1875px;
    color: #7d889e;
    }
    
    • Example 3
    .decoration-oval {
    @apply rounded-full absolute;
    
        width: 270px;
        height: 270px;
        transition: all ease 0.3s;
        background: #3685ff;
        }
    
    • Example 1: Long class (directly within the HTML element)\
    • Example 2: Defining a class (considered best but inconsistent)\
    • Example 3: Combination of class and Tailwind (also inconsistent) Are there other ways to address the shortcomings in each provided example?
  3. How can one ensure consistency when using TailwindCSS?

  4. Are there any recommendations or guidelines on best practices when using TailwindCSS, especially when it comes to more complex components?

Code
Loading...

Please log in to post a comment

Log in

Community feedback

No feedback yet. Be the first to give feedback on dimar hanung’s solution.

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