Published on

3 Things You Must Know To Create A Facebook Login Page With Tailwind CSS

Facebook Login Page

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 Facebook Login Page ui component

Facebook login component

Why use Tailwind CSS to make a Facebook Login Page ui component?

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

The preview of Facebook Login Page ui component

Free download of the Facebook Login Page's source code

The source code of Facebook Login Page ui component

<div class="p-20 h-screen w-screen flex flex-col-reverse md:flex-row items-center justify-center bg-gray-200">
  <div class="content text-3xl text-center md:text-left">
    <h1 class="text-5xl text-blue-500 font-bold">Facebook</h1>
    <p>Connect with friends and the world around you on Facebook.</p>
  </div>
  <div class="container mx-auto flex flex-col items-center">
    <form class="shadow-lg w-80 p-4 flex flex-col bg-white rounded-lg">
      <input type="text" placeholder="Email or Phone Number" class="mb-3 py-3 px-4 border border-gray-400 focus:outline-none rounded-md focus:ring-1 ring-cyan-500" />
      <input type="text" placeholder="Pasword" class="mb-3 py-3 px-4 border border-gray-400 focus:outline-none rounded-md focus:ring-1 ring-cyan-500" />
      <button class="w-full bg-blue-500 text-white p-3 rounded-lg font-semibold text-lg">Login</button>
      <a class="text-blue-400 text-center my-2">Forgot Pasword?</a>
      <hr />
      <button class="w-full bg-green-400 mt-8 mb-4 text-white p-3 rounded-lg font-semibold text-lg">Create New Account</button>
    </form>
    <p class="text-center text-sm my-4">
      <span class="font-semibold text-center w-full">Create a Page</span> for a celebrity, band or business
    </p>
  </div>
</div>

How to make a Facebook Login Page 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 make a Facebook Login Page component

  • p-20
  • h-screen
  • w-screen
  • flex
  • flex-col-reverse
  • md:flex-row
  • bg-gray-200
  • text-3xl
  • text-center
  • md:text-left
  • text-5xl
  • text-blue-500
  • mx-auto
  • flex-col
  • w-80
  • p-4
  • bg-white
  • mb-3
  • py-3
  • px-4
  • border-gray-400
  • w-full
  • bg-blue-500
  • text-white
  • p-3
  • text-lg
  • text-blue-400
  • my-2
  • bg-green-400
  • mt-8
  • mb-4
  • text-sm
  • my-4

33 steps to make a Facebook Login Page component with Tailwind CSS

  1. Control the padding on all sides of an element to 5rem using the p-20 utilities.

  2. Use h-screen to make an element span the entire height of the viewport.

  3. Use w-screen to make an element span the entire width of the viewport.

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

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

  6. Use flex to create a block-level flex container at only medium screen sizes.

  7. Control the background color of an element to gray-200 using the bg-gray-200 utilities.

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

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

  10. Control the text color of an element to left at only medium screen sizes using the md:text-left utilities.

  11. Control the text color of an element to 5xl using the text-5xl utilities.

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

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

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

  15. Use w-80 to set an element to a fixed width(20rem).

  16. Control the padding on all sides of an element to 1rem using the p-4 utilities.

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

  18. Control the margin on bottom side of an element to 0.75rem using the mb-3 utilities.

  19. Control the vertical padding of an element to 0.75rem using the py-3 utilities.

  20. Control the horizontal padding of an element to 1rem using the px-4 utilities.

  21. Control the border color of an element to gray-400 using the border-gray-400 utilities.

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

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

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

  25. Control the padding on all sides of an element to 0.75rem using the p-3 utilities.

  26. Control the text color of an element to lg using the text-lg utilities.

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

  28. Control the vertical margin of an element to 0.5rem using the my-2 utilities.

  29. Control the background color of an element to green-400 using the bg-green-400 utilities.

  30. Control the margin on top side of an element to 2rem using the mt-8 utilities.

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

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

  33. Control the vertical margin of an element to 1rem using the my-4 utilities.

Conclusion

The above is a step-by-step tutorial on how to use Tailwind CSS to make a Facebook Login Page components, learn and follow along to implement your own components.