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

All comments

  • P

    @radektomasek

    Submitted

    Hello 👋,

    I am submitting my third challenge. Still from the newbie category on the one hand (as I try to polish the core principles of TailwindCSS), but it was a lot of fun on the other one.

    Here is a bit of the breakdown. (More detailed explanation is available in the RespositoryURL).

    What did you find difficult while building the project?

    Initially, the most challenging part was managing specific position styles for the background images. It's not an issue in vanilla CSS; however, TailwindCSS applies many contains that didn't work by default for my requirements.

    I could override these default utility classes for image background positions; however, I felt it would be overkill. Fortunately, I learned about a specific construct allowing it to be more precise whilst keeping the default constraints in place. Things like:

    bg-[POSITION1_VALUE1_UNIT1_POSITION2_VALUE2_UNIT2]
    

    e.g

    bg-[right_-15rem_top_-14rem]
    

    And learning this helped me to complete this project.

    Which areas of your code are you unsure of?

    Using Tailwind allows me to make the styles more compact. However, FrontendMentor designs always have a lot of tweaks in the original template.

    It makes sense to update the configuration and override some values, but it could be counterproductive in most cases.

    Therefore in quite a few places, I am using arbitrary values, like:

    lg:w-[21rem]
    

    The problem is that it becomes pretty repetitive after a while, and I feel it could be a problem if I decide to update these values.

    Do you have any questions about best practices?

    Given the repetitive arbitrary values, I will use more CSS variables for the repeating values, combining them with Tailwind new/altered/overridden utility values in tailwind.config.js.

    I had worked with CSS variables before, but I had never done it in Tailwind. Is there any best practise related to this?

    @ryan17stehle

    Posted

    I'm certainly no expert in Tailwind CSS, but I don't think it's considered a best practice to use the @apply keyword the way you've chosen to. Even their own documentation says to use @apply sparingly. You can read about it here: https://tailwindcss.com/docs/reusing-styles#extracting-classes-with-apply

    Marked as helpful

    0
  • Sam-52 20

    @Sam-52

    Submitted

    It took my attention that there is thin border style at corners of colorful content. I don't know how it is done so I left it. Any comment is welcome guys.

    @ryan17stehle

    Posted

    You can actually specifically target certain corners for border-radius. For example: border-bottom-left-radius: 16px.

    1