Published on

Imagine You Build A TailwindCSS & VUE.js Github Profile Card With Tailwind CSS Like An Expert. Follow These 6 Steps To Get There

Tags
TailwindCSS & VUE.js Github Profile Card

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 TailwindCSS & VUE.js Github Profile Card ui component

Uses github's api so you can display exactlly what you want not just the infos i used.

Why use Tailwind CSS to create a TailwindCSS & VUE.js Github Profile Card ui component?

  • It can make the building process of TailwindCSS & VUE.js Github Profile Card ui component faster and more easily.
  • Enables building complex responsive layouts and components freely.
  • Minimum lines of CSS code in TailwindCSS & VUE.js Github Profile Card component file.

The preview of TailwindCSS & VUE.js Github Profile Card ui component

Free download of the TailwindCSS & VUE.js Github Profile Card's source code

The source code of TailwindCSS & VUE.js Github Profile Card ui component

<html class="bg-blue-100">

<head>
    <link href="https://unpkg.com/[email protected]^1.0/dist/tailwind.min.css" rel="stylesheet">
</head>

<body>

    <div id="app" class="max-w-sm bg-white shadow-lg rounded-lg overflow-hidden my-4 mx-auto">
      
        <github-user-card username="yyx990803"></github-user-card>

    </div>

  <script type="text/x-template" id="github-user-card-template">

    <div>
        <img class="w-full h-56 object-cover object-center" :src="user.avatar_url" alt="avatar">
        <div class="flex items-center px-6 py-3 bg-gray-900">
            <svg class="h-6 w-6 text-white fill-current" viewBox="0 0 20 20">
                <path d="M10,6.978c-1.666,0-3.022,1.356-3.022,3.022S8.334,13.022,10,13.022s3.022-1.356,3.022-3.022S11.666,6.978,10,6.978M10,12.267c-1.25,0-2.267-1.017-2.267-2.267c0-1.25,1.016-2.267,2.267-2.267c1.251,0,2.267,1.016,2.267,2.267C12.267,11.25,11.251,12.267,10,12.267 M18.391,9.733l-1.624-1.639C14.966,6.279,12.563,5.278,10,5.278S5.034,6.279,3.234,8.094L1.609,9.733c-0.146,0.147-0.146,0.386,0,0.533l1.625,1.639c1.8,1.815,4.203,2.816,6.766,2.816s4.966-1.001,6.767-2.816l1.624-1.639C18.536,10.119,18.536,9.881,18.391,9.733 M16.229,11.373c-1.656,1.672-3.868,2.594-6.229,2.594s-4.573-0.922-6.23-2.594L2.41,10l1.36-1.374C5.427,6.955,7.639,6.033,10,6.033s4.573,0.922,6.229,2.593L17.59,10L16.229,11.373z"></path>            </svg>
            <h1 class="mx-3 text-white font-semibold text-lg">{{user.public_repos}} Public Repos</h1>
        </div>
        <div class="py-4 px-6">
            <h1 class="text-2xl font-semibold text-gray-800">{{user.name}}</h1>
            <p class="py-2 text-lg text-gray-700">{{user.bio}}</p>
            <div class="flex items-center mt-4 text-gray-700">
                <svg class="h-6 w-6 fill-current" viewBox="0 0 20 20">
                    <path d="M15.573,11.624c0.568-0.478,0.947-1.219,0.947-2.019c0-1.37-1.108-2.569-2.371-2.569s-2.371,1.2-2.371,2.569c0,0.8,0.379,1.542,0.946,2.019c-0.253,0.089-0.496,0.2-0.728,0.332c-0.743-0.898-1.745-1.573-2.891-1.911c0.877-0.61,1.486-1.666,1.486-2.812c0-1.79-1.479-3.359-3.162-3.359S4.269,5.443,4.269,7.233c0,1.146,0.608,2.202,1.486,2.812c-2.454,0.725-4.252,2.998-4.252,5.685c0,0.218,0.178,0.396,0.395,0.396h16.203c0.218,0,0.396-0.178,0.396-0.396C18.497,13.831,17.273,12.216,15.573,11.624 M12.568,9.605c0-0.822,0.689-1.779,1.581-1.779s1.58,0.957,1.58,1.779s-0.688,1.779-1.58,1.779S12.568,10.427,12.568,9.605 M5.06,7.233c0-1.213,1.014-2.569,2.371-2.569c1.358,0,2.371,1.355,2.371,2.569S8.789,9.802,7.431,9.802C6.073,9.802,5.06,8.447,5.06,7.233 M2.309,15.335c0.202-2.649,2.423-4.742,5.122-4.742s4.921,2.093,5.122,4.742H2.309z M13.346,15.335c-0.067-0.997-0.382-1.928-0.882-2.732c0.502-0.271,1.075-0.429,1.686-0.429c1.828,0,3.338,1.385,3.535,3.161H13.346z"></path>                </svg>
                <h1 class="px-2 text-sm">{{user.followers}} Followers</h1>
            </div>
            <div class="flex items-center mt-4 text-gray-700">
                <svg class="h-6 w-6 fill-current" viewBox="0 0 20 20">
                    <path d="M10,1.375c-3.17,0-5.75,2.548-5.75,5.682c0,6.685,5.259,11.276,5.483,11.469c0.152,0.132,0.382,0.132,0.534,0c0.224-0.193,5.481-4.784,5.483-11.469C15.75,3.923,13.171,1.375,10,1.375 M10,17.653c-1.064-1.024-4.929-5.127-4.929-10.596c0-2.68,2.212-4.861,4.929-4.861s4.929,2.181,4.929,4.861C14.927,12.518,11.063,16.627,10,17.653 M10,3.839c-1.815,0-3.286,1.47-3.286,3.286s1.47,3.286,3.286,3.286s3.286-1.47,3.286-3.286S11.815,3.839,10,3.839 M10,9.589c-1.359,0-2.464-1.105-2.464-2.464S8.641,4.661,10,4.661s2.464,1.105,2.464,2.464S11.359,9.589,10,9.589"></path>                </svg>
                <h1 class="px-2 text-sm">{{user.location}}</h1>
            </div>
            <div class="flex items-center mt-4 text-gray-700">
                <svg class="h-6 w-6 fill-current" viewBox="0 0 20 20">
                    <path d="M16.469,8.924l-2.414,2.413c-0.156,0.156-0.408,0.156-0.564,0c-0.156-0.155-0.156-0.408,0-0.563l2.414-2.414c1.175-1.175,1.175-3.087,0-4.262c-0.57-0.569-1.326-0.883-2.132-0.883s-1.562,0.313-2.132,0.883L9.227,6.511c-1.175,1.175-1.175,3.087,0,4.263c0.288,0.288,0.624,0.511,0.997,0.662c0.204,0.083,0.303,0.315,0.22,0.52c-0.171,0.422-0.643,0.17-0.52,0.22c-0.473-0.191-0.898-0.474-1.262-0.838c-1.487-1.485-1.487-3.904,0-5.391l2.414-2.413c0.72-0.72,1.678-1.117,2.696-1.117s1.976,0.396,2.696,1.117C17.955,5.02,17.955,7.438,16.469,8.924 M10.076,7.825c-0.205-0.083-0.437,0.016-0.52,0.22c-0.083,0.205,0.016,0.437,0.22,0.52c0.374,0.151,0.709,0.374,0.997,0.662c1.176,1.176,1.176,3.088,0,4.263l-2.414,2.413c-0.569,0.569-1.326,0.883-2.131,0.883s-1.562-0.313-2.132-0.883c-1.175-1.175-1.175-3.087,0-4.262L6.51,9.227c0.156-0.155,0.156-0.408,0-0.564c-0.156-0.156-0.408-0.156-0.564,0l-2.414,2.414c-1.487,1.485-1.487,3.904,0,5.391c0.72,0.72,1.678,1.116,2.696,1.116s1.976-0.396,2.696-1.116l2.414-2.413c1.487-1.486,1.487-3.905,0-5.392C10.974,8.298,10.55,8.017,10.076,7.825"></path>
                </svg>
                <h1 class="px-2 text-sm">{{user.blog}}</h1>
            </div>
        </div>
    </div>
    
  </script>

  <!-- Import Vue.js and axios -->
  <script src="https://unpkg.com/vue"></script>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

  <!-- Your JavaScript Code :) -->
  <script>
      Vue.component('github-user-card', {
          template: '#github-user-card-template',
          props: {
              username: {
                  type: String,
                  required: true
              }
          },
          data () {
              return {
                  user: {}
              }
          },
          created () { 
            axios.get(`https://api.github.com/users/${this.username}`)
                .then(response => {
                    this.user = response.data
                })
          }
      })
    new Vue({
      el: '#app'
    })
  </script>
</body>

</html>

How to create a TailwindCSS & VUE.js Github Profile Card with Tailwind CSS?

Install tailwind css of verion 1.4.6

Use the link html tag to import the stylesheet of Tailwind CSS of the version 1.4.6

<link href=https://unpkg.com/[email protected]/dist/tailwind.min.css rel="stylesheet">

All the unility class needed to create a TailwindCSS & VUE.js Github Profile Card component

  • bg-blue-100
  • max-w-sm
  • bg-white
  • overflow-hidden
  • my-4
  • mx-auto
  • w-full
  • h-56
  • flex
  • px-6
  • py-3
  • bg-gray-900
  • h-6
  • w-6
  • text-white
  • mx-3
  • text-lg
  • py-4
  • text-2xl
  • text-gray-800
  • py-2
  • text-gray-700
  • mt-4
  • px-2
  • text-sm

25 steps to create a TailwindCSS & VUE.js Github Profile Card component with Tailwind CSS

  1. Control the background color of an element to blue-100 using the bg-blue-100 utilities.

  2. Set the maximum width/height of an element using the max-w-sm utilities.

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

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

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

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

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

  8. Use h-56 to set an element to a fixed height(14rem).

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

  10. Control the horizontal padding of an element to 1.5rem using the px-6 utilities.

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

  12. Control the background color of an element to gray-900 using the bg-gray-900 utilities.

  13. Use h-6 to set an element to a fixed height(1.5rem).

  14. Use w-6 to set an element to a fixed width(1.5rem).

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

  16. Control the horizontal margin of an element to 0.75rem using the mx-3 utilities.

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

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

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

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

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

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

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

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

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

Conclusion

The above is a step-by-step tutorial on how to use Tailwind CSS to create a TailwindCSS & VUE.js Github Profile Card components, learn and follow along to implement your own components.