Published on

6 Ideas To Help You Create A Goals With Tailwind CSS Like A Pro

Goals

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 Goals ui component

Goals widget

Why use Tailwind CSS to make a Goals ui component?

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

The preview of Goals ui component

Free download of the Goals's source code

The source code of Goals ui component

<!DOCTYPE html>
            <html>
              <head>
                <meta charset="utf-8">
                <title>Tailwind.run Export | new / 0</title>
                <link rel="stylesheet" href="tailwind.out.css">
                <!-- <link rel="stylesheet" href="tailwind.purged.css"> -->
              </head>
              <body>
                <div class="bg-indigo-700 px-4 py-5 border-b rounded-t sm:px-6">
                  <h3 class="text-lg leading-6 font-medium text-white">
                    Your Goals
                  </h3>
                </div>
                <div class="bg-white shadow overflow-hidden sm:rounded-md">
                  <ul class="divide-y divide-gray-200">
                    <li>
                      <a class="block hover:bg-gray-50">
                        <div class="px-4 py-4 sm:px-6">
                          <div class="flex items-center justify-between">
                            <p class="text-sm font-thin text-gray-700 truncate">
                              Increase sales by 10% year over year
                            </p>
                            <div class="ml-2 flex-shrink-0 flex">
                              <p class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
                                On-Track
                              </p>
                            </div>
                          </div>
                          <div class="mt-2 sm:flex sm:justify-between">
                            <div class="sm:flex">
                              <p class="flex items-center text-sm font-light text-gray-500">
                                <time datetime="2020-01-07">January 7, 2020</time>
                              </p>
                            </div>
                          </div>
                        </div>
                      </a>
                    </li>
                
              <li>
                      <a class="block hover:bg-gray-50">
                        <div class="px-4 py-4 sm:px-6">
                          <div class="flex items-center justify-between">
                            <p class="text-sm font-thin text-gray-700 truncate">
                              Increase newsletter subscribers by 500
                            </p>
                            <div class="ml-2 flex-shrink-0 flex">
                              <p class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">
                                At-Risk
                              </p>
                            </div>
                          </div>
                          <div class="mt-2 sm:flex sm:justify-between">
                            <div class="sm:flex">
                              <p class="flex items-center text-sm font-light text-gray-500">
                                <time datetime="2020-01-07">January 7, 2020</time>
                              </p>
                            </div>
                          </div>
                        </div>
                      </a>
                    </li>
                
             <li>
                      <a class="block hover:bg-gray-50">
                        <div class="px-4 py-4 sm:px-6">
                          <div class="flex items-center justify-between">
                            <p class="text-sm font-thin text-gray-700 truncate">
                              Increase customer satisfaction rating by 10 points 
                            </p>
                            <div class="ml-2 flex-shrink-0 flex">
                              <p class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
                                On-Track
                              </p>
                            </div>
                          </div>
                          <div class="mt-2 sm:flex sm:justify-between">
                            <div class="sm:flex">
                              <p class="flex items-center text-sm font-light text-gray-500">
                                <time datetime="2020-01-07">January 7, 2020</time>
                              </p>
                            </div>
                          </div>
                        </div>
                      </a>
                    </li>
                  </ul>
            <button type="button" class="inline-flex items-center m-4 px-4 py-1.5 border border-transparent text-xs font-medium rounded shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
              View All
            </button>      
                </div>
              </body>

How to make a Goals with Tailwind CSS?

Install tailwind css of verion 2.0.1

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

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

All the unility class needed to make a Goals component

  • bg-indigo-700
  • px-4
  • py-5
  • border-b
  • sm:px-6
  • text-lg
  • text-white
  • bg-white
  • overflow-hidden
  • block
  • hover:bg-gray-50
  • py-4
  • flex
  • text-sm
  • text-gray-700
  • ml-2
  • flex-shrink-0
  • px-2
  • inline-flex
  • text-xs
  • bg-green-100
  • text-green-800
  • mt-2
  • sm:flex
  • text-gray-500
  • bg-yellow-100
  • text-yellow-800
  • m-4
  • py-1.5
  • border-transparent
  • bg-indigo-600
  • hover:bg-indigo-700

32 steps to make a Goals component with Tailwind CSS

  1. Control the background color of an element to indigo-700 using the bg-indigo-700 utilities.

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

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

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

  5. Control the horizontal padding of an element to 1.5rem at only small screen sizes using the sm:px-6 utilities.

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

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

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

  9. Use overflow-hidden to clip any content within an element that overflows the bounds of that element.

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

  11. Control the background color of an element to gray-50 using the hover:bg-gray-50 utilities on hover.

  12. Control the vertical padding of an element to 1rem using the py-4 utilities.

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

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

  15. Control the text color of an element to gray-700 using the text-gray-700 utilities.

  16. Control the margin on left side of an element to 0.5rem using the ml-2 utilities.

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

  18. Control the horizontal padding of an element to 0.5rem using the px-2 utilities.

  19. Use inline-flex to create an inline flex container that flows with text.

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

  21. Control the background color of an element to green-100 using the bg-green-100 utilities.

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

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

  24. Use flex to create a block-level flex container at only small screen sizes.

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

  26. Control the background color of an element to yellow-100 using the bg-yellow-100 utilities.

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

  28. Control the margin on all sides of an element to 1rem using the m-4 utilities.

  29. Control the vertical padding of an element to 1.5 using the py-1.5 utilities.

  30. Control the border color of an element to transparent using the border-transparent utilities.

  31. Control the background color of an element to indigo-600 using the bg-indigo-600 utilities.

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

Conclusion

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