Published on

What You Need To Make A WeTransfer style layout With Tailwind CSS

WeTransfer style layout

What is Tailwind CSS?

Tailwind CSS is a utility-first CSS framework that focuses on creating personalized user interfaces quickly. It can gives you all the building blocks you are able to create personalized designs without having to fight to override irritating opinionated styles. Also, Tailwind CSS is a highly configurable, low-level CSS framework.

The description of WeTransfer style layout ui component

Download modal with a random background from unsplash

Why use Tailwind CSS to create a WeTransfer style layout ui component?

  • It can make the building process of WeTransfer style layout ui component faster and more easily.
  • Enables building complex responsive layouts and components freely.
  • Minimum lines of CSS code in WeTransfer style layout component file.

The preview of WeTransfer style layout ui component

Free download of the WeTransfer style layout's source code

The source code of WeTransfer style layout ui component

<style>
@import url(https://cdnjs.cloudflare.com/ajax/libs/MaterialDesign-Webfont/5.3.45/css/materialdesignicons.min.css);
.bg-random {
    /* @apply bg-cover bg-center */
    background-image: url(https://source.unsplash.com/random);
    background-size: cover;
    background-position: center;
}
</style>

<div class="min-w-screen min-h-screen bg-random flex items-center justify-center px-5 py-5">
    <div class="w-full mx-auto rounded-3xl shadow-xl bg-white" style="max-width: 300px">
        <div class="w-full px-5 pt-8 pb-3">
            <div class="rounded-full w-44 h-44 mx-auto border-8 border-gray-300 flex items-center justify-center">
                <i class="mdi mdi-arrow-down text-8xl text-gray-300 leading-none"></i>
            </div>
        </div>
        <div class="w-full px-5 text-center pb-8 border-b border-gray-300">
            <h1 class="text-2xl font-light text-gray-800 leading-tight">Ready when you are</h1>
            <p class="text-xs text-gray-500">Transfer expires in 7 days</p>
        </div>
        <ul>
            <li class="w-full px-5 py-2 border-b border-gray-300">
                <div class="w-full flex">
                    <div class="flex-grow">
                        <h3 class="text-sm text-gray-800 leading-tight">LoremIpsum_sitamore.zip</h3>
                        <p class="text-xs text-gray-500">138 MB - zip</p>
                    </div>
                    <div class="w-12 text-right">
                        <i class="mdi mdi-download-circle-outline text-blue-500 text-2xl"></i>
                    </div>
                </div>
            </li>
        </ul>
        <div class="w-full px-5 py-5 text-center">
            <button class="bg-blue-500 hover:bg-blue-600 text-white rounded-full px-10 py-2 transition-colors">Download</button>
        </div>
    </div>
</div>

<!-- BUY ME A BEER AND HELP SUPPORT OPEN-SOURCE RESOURCES -->
<div class="flex items-end justify-end fixed bottom-0 right-0 mb-4 mr-4 z-10">
    <div>
        <a title="Buy me a beer" href="https://www.buymeacoffee.com/scottwindon" target="_blank" class="block w-16 h-16 rounded-full transition-all shadow hover:shadow-lg transform hover:scale-110 hover:rotate-12">
            <img class="object-cover object-center w-full h-full rounded-full" src="https://i.pinimg.com/originals/60/fd/e8/60fde811b6be57094e0abc69d9c2622a.jpg"/>
        </a>
    </div>
</div>

How to create a WeTransfer style layout with Tailwind CSS?

Install tailwind css of verion 2.0.2

Use the script html tag to import the script of Tailwind CSS of the version 2.0.2

<script src="https://cdn.tailwindcss.com"></script>

All the unility class needed to create a WeTransfer style layout component

  • min-w-screen
  • min-h-screen
  • bg-random
  • flex
  • px-5
  • py-5
  • w-full
  • mx-auto
  • bg-white
  • pt-8
  • pb-3
  • w-44
  • h-44
  • border-8
  • border-gray-300
  • text-8xl
  • text-gray-300
  • text-center
  • pb-8
  • border-b
  • text-2xl
  • text-gray-800
  • text-xs
  • text-gray-500
  • py-2
  • flex-grow
  • text-sm
  • w-12
  • text-right
  • text-blue-500
  • bg-blue-500
  • hover:bg-blue-600
  • text-white
  • px-10
  • fixed
  • bottom-0
  • right-0
  • mb-4
  • mr-4
  • z-10
  • block
  • w-16
  • h-16
  • h-full

44 steps to create a WeTransfer style layout component with Tailwind CSS

  1. Set the minimum width/height of an element using the min-w-screen utilities.

  2. Set the minimum width/height of an element using the min-h-screen utilities.

  3. Control the background color of an element to random using the bg-random utilities.

  4. Use flex to create a block-level flex container.

  5. Control the horizontal padding of an element to 1.25rem using the px-5 utilities.

  6. Control the vertical padding of an element to 1.25rem using the py-5 utilities.

  7. Use w-full to set an element to a 100% based width.

  8. Control the horizontal margin of an element to auto using the mx-auto utilities.

  9. Control the background color of an element to white using the bg-white utilities.

  10. Control the padding on top side of an element to 2rem using the pt-8 utilities.

  11. Control the padding on bottom side of an element to 0.75rem using the pb-3 utilities.

  12. Use w-44 to set an element to a fixed width(11rem).

  13. Use h-44 to set an element to a fixed height(11rem).

  14. Control the border color of an element to 2rem using the border-8 utilities.

  15. Control the border color of an element to gray-300 using the border-gray-300 utilities.

  16. Control the text color of an element to 8xl using the text-8xl utilities.

  17. Control the text color of an element to gray-300 using the text-gray-300 utilities.

  18. Control the text color of an element to center using the text-center utilities.

  19. Control the padding on bottom side of an element to 2rem using the pb-8 utilities.

  20. Control the border color of an element to b using the border-b utilities.

  21. Control the text color of an element to 2xl using the text-2xl utilities.

  22. Control the text color of an element to gray-800 using the text-gray-800 utilities.

  23. Control the text color of an element to xs using the text-xs utilities.

  24. Control the text color of an element to gray-500 using the text-gray-500 utilities.

  25. Control the vertical padding of an element to 0.5rem using the py-2 utilities.

  26. Use flex to create a block-level flex container.

  27. Control the text color of an element to sm using the text-sm utilities.

  28. Use w-12 to set an element to a fixed width(3rem).

  29. Control the text color of an element to right using the text-right utilities.

  30. Control the text color of an element to blue-500 using the text-blue-500 utilities.

  31. Control the background color of an element to blue-500 using the bg-blue-500 utilities.

  32. Control the background color of an element to blue-600 using the hover:bg-blue-600 utilities on hover.

  33. Control the text color of an element to white using the text-white utilities.

  34. Control the horizontal padding of an element to 2.5rem using the px-10 utilities.

  35. Use fixed to position an element relative to the browser window.

  36. Use the bottom-0 utilities to set the bottom position of a positioned element to 0rem.

  37. Use the right-0 utilities to set the right position of a positioned element to 0rem.

  38. Control the margin on bottom side of an element to 1rem using the mb-4 utilities.

  39. Control the margin on right side of an element to 1rem using the mr-4 utilities.

  40. Control the stack order (or three-dimensional positioning) of an element to 10 in Tailwind, regardless of order it has been displayed, using the z-10 utilities.

  41. Use inline utilities to put the element on its own line and fill its parent.

  42. Use w-16 to set an element to a fixed width(4rem).

  43. Use h-16 to set an element to a fixed height(4rem).

  44. Use h-full to set an element’s height to 100% of its parent, as long as the parent has a defined height.

Conclusion

The above is a step-by-step tutorial on how to use Tailwind CSS to create a WeTransfer style layout components, learn and follow along to implement your own components.