Published on

Here Are 6 Ways To Make A Medium - Home Timeline With Tailwind CSS

Tags
Medium - Home Timeline

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 Medium - Home Timeline ui component

Medium home timeline

Why use Tailwind CSS to build a Medium - Home Timeline ui component?

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

The preview of Medium - Home Timeline ui component

Free download of the Medium - Home Timeline's source code

The source code of Medium - Home Timeline ui component

<div class="h-screen flex flex-col items-center justify-center">
    
    <card class="w-1/2 flex flex-col mt-5">
      
      <header class="flex flex-row gap-3 items-center">
        <img src="https://picsum.photos/30/30" class="rounded-full" />
          <div> Stephan Tromer </div>
          <div class="text-sm text-gray-500"> Jan 13 </div>
      </header>
      
      <content class="grid grid-cols-4 gap-3">

        <div class="col-span-3 flex flex-col">
          <subject class="font-bold text-lg pt-3">
            Go (Golang) with Structs and Interfaces
          </subject>

          <description class="font-light text-sm pt-2">
            Although it would be possible for us to write programs only using Go’s built-in data types, at some point, it would become quite tedious. Consider a program that....
          </description>
        </div>
        
        <div class="flex items-center">
          <img src="https://picsum.photos/100/100" />
        </div>
        
      </content>
      
      <footer class="flex flex-row pt-7 gap-3 items-center">
        
        <button class="hover:bg-gray-300 delay-100 duration-100 bg-gray-200 rounded-full py-1 px-2 text-xs">
          Tutorial
        </button>
        
        <div class="text-gray-500 text-xs">
          7 min read
        </div>
        
        <div class="text-gray-500 text-xs">
          Based on your reading history
        </div>
        
      </footer>
     
      <hr class="mt-5">
      
    </card>
  
    <card class="w-1/2 flex flex-col mt-5">
      
      <header class="flex flex-row gap-3 items-center">
        <img src="https://picsum.photos/30/30" class="rounded-full" />
          <div> Stephan Tromer </div>
          <div class="text-sm text-gray-500"> Jan 13 </div>
      </header>
      
      <content class="grid grid-cols-4 gap-3">

        <div class="col-span-3 flex flex-col">
          <subject class="font-bold text-lg pt-3">
            Go (Golang) with Structs and Interfaces
          </subject>

          <description class="font-light text-sm pt-2">
            Although it would be possible for us to write programs only using Go’s built-in data types, at some point, it would become quite tedious. Consider a program that....
          </description>
        </div>
        
        <div class="flex items-center">
          <img src="https://picsum.photos/100/100" />
        </div>
        
      </content>
      
      <footer class="flex flex-row pt-7 gap-3 items-center">
        
        <button class="hover:bg-gray-300 delay-100 duration-100 bg-gray-200 rounded-full py-1 px-2 text-xs">
          Tutorial
        </button>
        
        <div class="text-gray-500 text-xs">
          7 min read
        </div>
        
        <div class="text-gray-500 text-xs">
          Based on your reading history
        </div>
        
      </footer>
     
      <hr class="mt-5">
      
    </card>
  
    <card class="w-1/2 flex flex-col mt-5">
      
      <header class="flex flex-row gap-3 items-center">
        <img src="https://picsum.photos/30/30" class="rounded-full" />
          <div> Stephan Tromer </div>
          <div class="text-sm text-gray-500"> Jan 13 </div>
      </header>
      
      <content class="grid grid-cols-4 gap-3">

        <div class="col-span-3 flex flex-col">
          <subject class="font-bold text-lg pt-3">
            Go (Golang) with Structs and Interfaces
          </subject>

          <description class="font-light text-sm pt-2">
            Although it would be possible for us to write programs only using Go’s built-in data types, at some point, it would become quite tedious. Consider a program that....
          </description>
        </div>
        
        <div class="flex items-center">
          <img src="https://picsum.photos/100/100" />
        </div>
        
      </content>
      
      <footer class="flex flex-row pt-7 gap-3 items-center">
        
        <button class="hover:bg-gray-300 delay-100 duration-100 bg-gray-200 rounded-full py-1 px-2 text-xs">
          Tutorial
        </button>
        
        <div class="text-gray-500 text-xs">
          7 min read
        </div>
        
        <div class="text-gray-500 text-xs">
          Based on your reading history
        </div>
        
      </footer>
     
      <hr class="mt-5">
      
    </card>
  
</div>

How to build a Medium - Home Timeline with Tailwind CSS?

Install tailwind css of verion 3.0.18

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

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

All the unility class needed to build a Medium - Home Timeline component

  • h-screen
  • flex
  • flex-col
  • w-1/2
  • mt-5
  • flex-row
  • gap-3
  • text-sm
  • text-gray-500
  • grid
  • grid-cols-4
  • text-lg
  • pt-3
  • pt-2
  • pt-7
  • hover:bg-gray-300
  • bg-gray-200
  • py-1
  • px-2
  • text-xs

20 steps to build a Medium - Home Timeline component with Tailwind CSS

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

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

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

  4. Use w-1/2 to set an element to a fixed width(1/2).

  5. Control the margin on top side of an element to 1.25rem using the mt-5 utilities.

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

  7. To specify the width between columns, you can use the gap-3 utilities.

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

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

  10. Use grid to create a grid container.

  11. Use grid to create a grid container.

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

  13. Control the padding on top side of an element to 0.75rem using the pt-3 utilities.

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

  15. Control the padding on top side of an element to 1.75rem using the pt-7 utilities.

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

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

  18. Control the vertical padding of an element to 0.25rem using the py-1 utilities.

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

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

Conclusion

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