- Published on
Build A Dark Mode Vs Light Mode Navigation With Tailwind CSS Like A Pro With The Help Of These 6 Tips

- What is Tailwind CSS?
- The description of Dark Mode vs Light Mode Navigation ui component
- Why use Tailwind CSS to make a Dark Mode vs Light Mode Navigation ui component?
- The preview of Dark Mode vs Light Mode Navigation ui component
- The source code of Dark Mode vs Light Mode Navigation ui component
- How to make a Dark Mode vs Light Mode Navigation with Tailwind CSS?
- Install tailwind css of verion 1.0.4
- All the unility class needed to make a Dark Mode vs Light Mode Navigation component
- 69 steps to make a Dark Mode vs Light Mode Navigation component with Tailwind CSS
- Conclusion
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 Dark Mode vs Light Mode Navigation ui component
A dark mode vs light mode navigation for tailwind ccss
Why use Tailwind CSS to make a Dark Mode vs Light Mode Navigation ui component?
- It can make the building process of Dark Mode vs Light Mode Navigation ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Dark Mode vs Light Mode Navigation component file.
The preview of Dark Mode vs Light Mode Navigation ui component
Free download of the Dark Mode vs Light Mode Navigation's source code
The source code of Dark Mode vs Light Mode Navigation ui component
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" rel="stylesheet">
<!-- This is an example component -->
<div class="bg-gray-200 p-10 flex flex-wrap sys-app-notCollapsed ">
<!--this contains my photo, email and some information.-->
<div class="p-4 w-full ">
<div class="w-1/3 py-4 px-6 flex mx-auto ">
<span class="px-2 mx-2 inline-block capitalize font-medium ">
<span class="block text-xl mt-3">Built by</span>
</span>
<img
src="https://lh3.googleusercontent.com/-U0lTbxzh0bE/AAAAAAAAAAI/AAAAAAAAAAA/ACHi3rdJubMZweMDYD49ddsxq1wXai_9Cg/s48-c/photo.jpg"
alt="alt placeholder" class="w-12 h-12 mt-1 rounded-full inline-block">
<span class="px-2 mx-2 inline-block capitalize font-medium">
<span class="block text-xl">Hamza Nouali</span>
<span class="block font-normal text-gray-700">Web Developer</span>
</span>
</div>
<div class="p-4 text-center">
<a href="https://twitter.com/AppClsname" target="_tab" class="p-2 mx-2 ">
<i class="fab fa-twitter inline-block w-5">
</i>
<span class="mx-2 ">@ClsnameApp</span>
</a>
<a href="https://twitter.com/HamzaNouali3" target="_tab" class="p-2 mx-2 ">
<i class="fab fa-twitter inline-block w-5">
</i>
<span class="mx-2 ">@hamzanouali</span>
</a>
<span class="p-2 mx-2 ">
<i class="fas fa-envelope inline-block w-5">
</i>
<span class="mx-2 ">[email protected]</span>
</span>
<a href="https://www.linkedin.com/in/hamza-nouali-8786ab19a/" target="_tab" class="p-2 mx-2 ">
<i class="fab fa-linkedin inline-block w-5">
</i>
<span class="mx-2 ">hamza nouali</span>
</a>
</div>
<p class="p-4 text-center w-3/5 mx-auto">These are HTML & CSS components built using Tailwind CSS framework, you can
download it (100% Free and well documented)
to learn from it or even re-use it.</p>
</div>
<!--horizontal navigations-->
<div class="p-4 pb-0 mx-auto flex flex-wrap ">
<div class="p-4 w-full lg:w-1/2 bg-gray-800">
<!--dark mode - without text - icons only-->
<div class="p-2 text-gray-700 bg-gray-900 rounded-lg shadow-lg ">
<span class="px-2 mr-2 border-r border-gray-800">
<img src="https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png"
alt="alt placeholder" class="w-8 h-8 -mt-1 inline mx-auto">
</span>
<span class="px-1 hover:text-white cursor-pointer">
<i class="fas fa-stream p-2 bg-gray-800 rounded-full">
</i>
</span>
<span class="px-1 hover:text-white cursor-pointer">
<i class="fas fa-search p-2 bg-gray-800 rounded-full">
</i>
</span>
<span class="px-1 hover:text-white cursor-pointer">
<i class="fas fa-th p-2 bg-gray-800 rounded-full">
</i>
</span>
<span class="px-1 hover:text-white cursor-pointer">
<i class="w-8 fas fa-calendar-alt p-2 bg-gray-800 rounded-full">
</i>
</span>
<span class="px-1 hover:text-white cursor-pointer w-8 relative">
<i class="fas fa-bell p-2 bg-gray-800 rounded-full">
</i>
<span
class="absolute right-0 top-0 -mt-2 -mr-1 text-xs bg-red-500 text-white font-medium px-2 shadow-lg rounded-full">3</span>
</span>
<span class="hover:text-white cursor-pointer w-10 relative float-right mr-3">
<i class="fas fa-user p-2 bg-gray-800 rounded-full">
</i>
<span
class="absolute right-0 top-0 -mt-1 -mr-1 text-xs bg-yellow-500 text-black font-medium px-2 rounded-full">3</span>
</span>
</div>
</div>
<div class="p-4 w-full lg:w-1/2">
<!--dark mode - without text - icons only-->
<div class="p-2 text-gray-900 bg-white rounded-lg shadow-lg ">
<span class="px-2 mr-2 border-r border-gray-800">
<img src="https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png"
alt="alt placeholder" class="w-8 h-8 -mt-1 inline mx-auto">
</span>
<span class="px-1 cursor-pointer hover:text-gray-700">
<i class="fas fa-stream p-2 bg-gray-200 rounded-full">
</i>
</span>
<span class="px-1 cursor-pointer hover:text-gray-700">
<i class="fas fa-search p-2 bg-gray-200 rounded-full">
</i>
</span>
<span class="px-1 cursor-pointer hover:text-gray-700">
<i class="fas fa-th p-2 bg-gray-200 rounded-full">
</i>
</span>
<span class="px-1 cursor-pointer hover:text-gray-700">
<i class="w-8 fas fa-calendar-alt p-2 bg-gray-200 rounded-full">
</i>
</span>
<span class="px-1 w-8 relative cursor-pointer hover:text-gray-700">
<i class="fas fa-bell p-2 bg-gray-200 rounded-full">
</i>
<span
class="absolute right-0 top-0 -mt-2 -mr-1 text-xs bg-red-500 text-white font-medium px-2 shadow-lg rounded-full">3</span>
</span>
<span class="w-10 relative float-right mr-3 cursor-pointer hover:text-gray-700">
<i class="fas fa-user p-2 bg-gray-200 rounded-full">
</i>
<span
class="absolute right-0 top-0 -mt-1 -mr-1 text-xs bg-yellow-500 text-black font-medium px-2 rounded-full">3</span>
</span>
</div>
</div>
<div class="p-4 w-full lg:w-1/2 bg-gray-800">
<!--dark mode - text and icons-->
<div class="p-2 text-gray-700 bg-gray-900 rounded-lg shadow-lg font-medium capitalize">
<span class="px-2 mr-2 border-r border-gray-800">
<img src="https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png"
alt="alt placeholder" class="w-8 h-8 -mt-1 inline mx-auto">
</span>
<span class="px-2 py-1 cursor-pointer hover:bg-gray-800 hover:text-gray-300 text-sm rounded mb-5">
<i class="w-8 fas fa-stream p-2 bg-gray-800 rounded-full">
</i>
<span class="mx-1">categories</span>
</span>
<span class="px-2 py-1 cursor-pointer hover:bg-gray-800 hover:text-gray-300 text-sm rounded mb-5">
<i class="w-8 fas fa-th p-2 bg-gray-800 rounded-full">
</i>
<span class="mx-1">menu</span>
</span>
<span class="px-1 hover:text-white cursor-pointer">
<i class="fas fa-search p-2 bg-gray-800 rounded-full">
</i>
</span>
<span class="px-1 hover:text-white cursor-pointer">
<i class="w-8 fas fa-calendar-alt p-2 bg-gray-800 rounded-full">
</i>
</span>
<span class="px-1 hover:text-white cursor-pointer w-8 relative">
<i class="w-8 fas fa-bell p-2 bg-gray-800 rounded-full">
</i>
<span
class="absolute right-0 top-0 -mt-2 -mr-1 text-xs bg-red-500 text-white font-medium px-2 shadow-lg rounded-full">3</span>
</span>
<span class="hover:text-white cursor-pointer w-10 relative float-right mr-3">
<i class="fas fa-user p-2 bg-gray-800 rounded-full">
</i>
<span
class="absolute right-0 top-0 -mt-1 -mr-1 text-xs bg-yellow-500 text-black font-medium px-2 rounded-full">3</span>
</span>
</div>
</div>
<div class="p-4 w-full lg:w-1/2">
<!--light mode - text and icons-->
<div class="p-2 text-gray-900 bg-white rounded-lg shadow-lg font-medium capitalize">
<span class="px-2 mr-2 border-r border-gray-800">
<img src="https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png"
alt="alt placeholder" class="w-8 h-8 -mt-1 inline mx-auto">
</span>
<span class="px-2 py-1 cursor-pointer hover:bg-gray-200 hover:text-gray-700 text-sm rounded mb-5">
<i class="w-8 fas fa-stream p-2 bg-gray-200 rounded-full">
</i>
<span class="mx-1">categories</span>
</span>
<span class="px-2 py-1 cursor-pointer hover:bg-gray-200 hover:text-gray-700 text-sm rounded mb-5">
<i class="w-8 fas fa-th p-2 bg-gray-200 rounded-full">
</i>
<span class="mx-1">menu</span>
</span>
<span class="px-1 cursor-pointer hover:text-gray-700">
<i class="fas fa-search p-2 bg-gray-200 rounded-full">
</i>
</span>
<span class="px-1 cursor-pointer hover:text-gray-700">
<i class="w-8 fas fa-calendar-alt p-2 bg-gray-200 rounded-full">
</i>
</span>
<span class="px-1 w-8 relative cursor-pointer hover:text-gray-700">
<i class="w-8 fas fa-bell p-2 bg-gray-200 rounded-full">
</i>
<span
class="absolute right-0 top-0 -mt-2 -mr-1 text-xs bg-red-500 text-white font-medium px-2 shadow-lg rounded-full">3</span>
</span>
<span class="w-10 relative float-right mr-3 cursor-pointer hover:text-gray-700">
<i class="w-8 fas fa-user p-2 bg-gray-200 rounded-full">
</i>
<span
class="absolute right-0 top-0 -mt-1 -mr-1 text-xs bg-yellow-500 text-black font-medium px-2 rounded-full">3</span>
</span>
</div>
</div>
</div>
<!--vertical navigations-->
<div class="p-4 pt-0 mx-auto flex flex-wrap ">
<!--dark mode - tight side navigation with yellow notification-->
<div class="p-4 w-24 bg-gray-800">
<div class="py-4 px-2 text-gray-700 bg-gray-900 rounded-lg text-center shadow-lg">
<img src="https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png"
alt="alt placeholder" class="w-8 h-8 mx-auto mb-5">
<span class="cursor-pointer hover:text-white px-2 block mb-5">
<i class="fas fa-stream">
</i>
</span>
<span class="cursor-pointer hover:text-white px-2 block mb-5">
<i class="fas fa-search p-2 bg-gray-800 rounded-full">
</i>
</span>
<span class="cursor-pointer hover:text-white px-2 block mb-5 relative">
<i class="fas fa-users">
</i>
<span
class="absolute right-0 top-0 -mt-2 text-xs bg-yellow-500 text-black font-medium px-2 shadow-lg rounded-full border-2 border-gray-900">3</span>
</span>
<span class="cursor-pointer hover:text-white px-2 block mb-5">
<i class="fas fa-calendar-alt">
</i>
</span>
</div>
</div>
<div class="p-4 w-24 bg-gray-800">
<!--dark mode - tight side navigation with red notification-->
<div class="py-4 px-2 text-gray-700 bg-gray-900 rounded text-center shadow-lg">
<img src="https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png"
alt="alt placeholder" class="w-8 h-8 mx-auto mb-5">
<span class="cursor-pointer hover:text-white px-2 block mb-5">
<i class="fas fa-stream">
</i>
</span>
<span class="cursor-pointer hover:text-white px-2 block mb-5">
<i class="fas fa-search p-2 bg-gray-800 rounded-full">
</i>
</span>
<span class="cursor-pointer hover:text-white px-2 block mb-5 relative">
<i class="fas fa-bell">
</i>
<span
class="absolute right-0 top-0 -mt-2 text-xs bg-red-500 text-white font-medium px-2 shadow-lg rounded-full border-2 border-gray-900">3</span>
</span>
<span class="cursor-pointer px-2 block mb-5 relative">
<span
class="absolute right-0 top-0 -mt-2 text-xs bg-red-500 text-white font-medium px-2 shadow-lg rounded-full border-2 border-gray-900">3</span>
<img
src="https://lh3.googleusercontent.com/-U0lTbxzh0bE/AAAAAAAAAAI/AAAAAAAAAAA/ACHi3rdJubMZweMDYD49ddsxq1wXai_9Cg/s48-c/photo.jpg"
alt="alt placeholder" class="w-8 h-8 mx-auto mb-5 rounded-full">
</span>
</div>
</div>
<div class="p-4 w-64 bg-gray-800">
<!--dark mode - wide side navigation-->
<div class="w-full py-4 px-2 text-gray-700 bg-gray-900 rounded-lg text-left capitalize font-medium shadow-lg">
<img src="https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png"
alt="alt placeholder" class="w-8 h-8 mx-auto mb-5 ">
<span class="cursor-pointer px-2 py-1 hover:bg-gray-800 hover:text-gray-300 rounded block mb-5">
<i class="w-8 fas fa-stream p-2 bg-gray-800 rounded-full">
</i>
<span class="mx-2">categories</span>
</span>
<span class="cursor-pointer px-2 py-1 hover:bg-gray-800 hover:text-gray-300 rounded block mb-5">
<i class="w-8 fas fa-search p-2 bg-gray-800 rounded-full">
</i>
<span class="mx-2">search</span>
</span>
<span class="cursor-pointer px-2 py-1 hover:bg-gray-800 hover:text-gray-300 rounded block mb-5">
<span class="w-8 mb-5 relative">
<i class="w-8 fas fa-user p-2 bg-gray-800 rounded-full">
</i>
<span
class="absolute right-0 top-0 -mt-2 -mr-1 text-xs bg-yellow-500 text-black font-medium px-2 rounded-full">3</span>
</span>
<span class="mx-2">sign ups</span>
</span>
<span class="cursor-pointer px-2 py-1 hover:bg-gray-800 hover:text-gray-300 rounded block mb-5">
<i class="w-8 fas fa-th p-2 bg-gray-800 rounded-full">
</i>
<span class="mx-2">menu</span>
</span>
<span class="cursor-pointer px-2 py-1 hover:bg-gray-800 hover:text-gray-300 rounded block mb-5">
<i class="w-8 fas fa-calendar-alt p-2 bg-gray-800 rounded-full">
</i>
<span class="mx-2">calendar</span>
</span>
</div>
</div>
<div class="p-4 w-64 ">
<!--light mode - wide side navigation-->
<div class="w-full py-4 px-2 text-gray-900 bg-white rounded-lg text-left capitalize font-medium shadow-lg">
<img src="https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png"
alt="alt placeholder" class="w-8 h-8 mx-auto mb-5 ">
<span class="cursor-pointer px-2 py-1 hover:bg-gray-200 hover:text-gray-700 rounded block mb-5">
<i class="w-8 fas fa-stream p-2 bg-gray-200 rounded-full">
</i>
<span class="mx-2">categories</span>
</span>
<span class="cursor-pointer px-2 py-1 hover:bg-gray-200 hover:text-gray-700 rounded block mb-5">
<i class="w-8 fas fa-search p-2 bg-gray-200 rounded-full">
</i>
<span class="mx-2">search</span>
</span>
<span class="cursor-pointer px-2 py-1 hover:bg-gray-200 hover:text-gray-700 rounded block mb-5">
<span class="w-8 mb-5 relative">
<i class="w-8 fas fa-user p-2 bg-gray-200 rounded-full">
</i>
<span
class="absolute right-0 top-0 -mt-2 -mr-1 text-xs bg-yellow-500 text-black font-medium px-2 rounded-full">3</span>
</span>
<span class="mx-2">sign ups</span>
</span>
<span class="cursor-pointer px-2 py-1 hover:bg-gray-200 hover:text-gray-700 rounded block mb-5">
<i class="w-8 fas fa-th p-2 bg-gray-200 rounded-full">
</i>
<span class="mx-2">menu</span>
</span>
<span class="cursor-pointer px-2 py-1 hover:bg-gray-200 hover:text-gray-700 rounded block mb-5">
<i class="w-8 fas fa-calendar-alt p-2 bg-gray-200 rounded-full">
</i>
<span class="mx-2">calendar</span>
</span>
</div>
</div>
<div class="p-4 w-24 ">
<!--light mode - tight side navigation with red notification-->
<div class="py-4 px-2 text-gray-900 bg-white rounded text-center shadow-lg ">
<img src="https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png"
alt="alt placeholder" class="w-8 h-8 mx-auto mb-5">
<span class="cursor-pointer hover:text-gray-500 px-2 block mb-5">
<i class="fas fa-stream">
</i>
</span>
<span class="cursor-pointer hover:text-gray-500 px-2 block mb-5">
<i class="fas fa-search p-2 bg-gray-200 rounded-full">
</i>
</span>
<span class="cursor-pointer hover:text-gray-500 px-2 block mb-5 relative">
<i class="fas fa-bell">
</i>
<span
class="absolute right-0 top-0 -mt-2 text-xs bg-red-500 text-white font-medium px-2 shadow-lg rounded-full border-2 border-white">3</span>
</span>
<span class="cursor-pointer hover:text-gray-500 px-2 block mb-5 relative">
<img
src="https://lh3.googleusercontent.com/-U0lTbxzh0bE/AAAAAAAAAAI/AAAAAAAAAAA/ACHi3rdJubMZweMDYD49ddsxq1wXai_9Cg/s48-c/photo.jpg"
alt="alt placeholder" class="w-8 h-8 mx-auto mb-5 rounded-full">
<span
class="absolute right-0 top-0 -mt-2 text-xs bg-red-500 text-white font-medium px-2 shadow-lg rounded-full border-2 border-white ">3</span>
</span>
</div>
</div>
<div class="p-4 w-24 ">
<!--light mode - tight side navigation with yellow notification-->
<div class="py-4 px-2 bg-white text-gray-900 rounded-lg text-center shadow-lg">
<img src="https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png"
alt="alt placeholder" class="w-8 h-8 mx-auto mb-5">
<span class="cursor-pointer hover:text-gray-500 px-2 block mb-5">
<i class="fas fa-stream">
</i>
</span>
<span class="cursor-pointer hover:text-gray-500 px-2 block mb-5">
<i class="fas fa-search p-2 bg-gray-200 rounded-full">
</i>
</span>
<span class="cursor-pointer hover:text-gray-500 px-2 block mb-5 relative">
<i class="fas fa-users">
</i>
<span
class="absolute right-0 top-0 -mt-2 text-xs bg-yellow-500 text-black font-medium px-2 shadow-lg rounded-full border-2 border-white">3</span>
</span>
<span class="cursor-pointer hover:text-gray-500 px-2 block mb-5">
<i class="fas fa-calendar-alt">
</i>
</span>
</div>
</div>
</div>
</div>
How to make a Dark Mode vs Light Mode Navigation with Tailwind CSS?
Install tailwind css of verion 1.0.4
Use the link
html tag to import the stylesheet of Tailwind CSS of the version 1.0.4
<link href=https://unpkg.com/[email protected]/dist/tailwind.min.css rel="stylesheet">
All the unility class needed to make a Dark Mode vs Light Mode Navigation component
bg-gray-200
p-10
flex
flex-wrap
p-4
w-full
w-1/3
py-4
px-6
mx-auto
px-2
mx-2
inline-block
block
text-xl
mt-3
w-12
h-12
mt-1
text-gray-700
text-center
p-2
w-5
w-3/5
pb-0
lg:w-1/2
bg-gray-800
bg-gray-900
mr-2
border-r
border-gray-800
w-8
h-8
-mt-1
inline
px-1
hover:text-white
relative
absolute
right-0
top-0
-mt-2
-mr-1
text-xs
bg-red-500
text-white
w-10
float-right
mr-3
bg-yellow-500
text-black
text-gray-900
bg-white
hover:text-gray-700
py-1
hover:bg-gray-800
hover:text-gray-300
text-sm
mb-5
mx-1
hover:bg-gray-200
pt-0
w-24
border-2
border-gray-900
w-64
text-left
hover:text-gray-500
border-white
69 steps to make a Dark Mode vs Light Mode Navigation component with Tailwind CSS
Control the background color of an element to gray-200 using the
bg-gray-200
utilities.Control the padding on all sides of an element to 2.5rem using the
p-10
utilities.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Control the padding on all sides of an element to 1rem using the
p-4
utilities.Use
w-full
to set an element to a 100% based width.Use
w-1/3
to set an element to a fixed width(1/3).Control the vertical padding of an element to 1rem using the
py-4
utilities.Control the horizontal padding of an element to 1.5rem using the
px-6
utilities.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Control the horizontal padding of an element to 0.5rem using the
px-2
utilities.Control the horizontal margin of an element to 0.5rem using the
mx-2
utilities.Use
inline-block
utilities to wrap the element to prevent the text inside from extending beyond its parent.Use
inline
utilities to put the element on its own line and fill its parent.Control the text color of an element to xl using the
text-xl
utilities.Control the margin on top side of an element to 0.75rem using the
mt-3
utilities.Use
w-12
to set an element to a fixed width(3rem).Use
h-12
to set an element to a fixed height(3rem).Control the margin on top side of an element to 0.25rem using the
mt-1
utilities.Control the text color of an element to gray-700 using the
text-gray-700
utilities.Control the text color of an element to center using the
text-center
utilities.Control the padding on all sides of an element to 0.5rem using the
p-2
utilities.Use
w-5
to set an element to a fixed width(1.25rem).Use
w-3/5
to set an element to a fixed width(3/5).Control the padding on bottom side of an element to 0rem using the
pb-0
utilities.Use
lg:w-1/2
to set an element to a fixed width(1/2) at only large screen sizes.Control the background color of an element to gray-800 using the
bg-gray-800
utilities.Control the background color of an element to gray-900 using the
bg-gray-900
utilities.Control the margin on right side of an element to 0.5rem using the
mr-2
utilities.Control the border color of an element to r using the
border-r
utilities.Control the border color of an element to gray-800 using the
border-gray-800
utilities.Use
w-8
to set an element to a fixed width(2rem).Use
h-8
to set an element to a fixed height(2rem).Control the margin on top side of an element to -0.25rem using the
-mt-1
utilities.Use
inline
utilities to control the flow of text inside the element to wrap normally.Control the horizontal padding of an element to 0.25rem using the
px-1
utilities.Control the text color of an element to white on hover using the
hover:text-white
utilities.Use
relative
to position an element according to the normal flow of the document.Use
absolute
to position an element outside of the normal flow of the document, causing neighboring elements to act as if the element doesn’t exist.Use the
right-0
utilities to set the right position of a positioned element to 0rem.Use the
top-0
utilities to set the top position of a positioned element to 0rem.Control the margin on top side of an element to -0.5rem using the
-mt-2
utilities.Control the margin on right side of an element to -0.25rem using the
-mr-1
utilities.Control the text color of an element to xs using the
text-xs
utilities.Control the background color of an element to red-500 using the
bg-red-500
utilities.Control the text color of an element to white using the
text-white
utilities.Use
w-10
to set an element to a fixed width(2.5rem).Use
float-right
to float an element to the right of its container.Control the margin on right side of an element to 0.75rem using the
mr-3
utilities.Control the background color of an element to yellow-500 using the
bg-yellow-500
utilities.Control the text color of an element to black using the
text-black
utilities.Control the text color of an element to gray-900 using the
text-gray-900
utilities.Control the background color of an element to white using the
bg-white
utilities.Control the text color of an element to gray-700 on hover using the
hover:text-gray-700
utilities.Control the vertical padding of an element to 0.25rem using the
py-1
utilities.Control the background color of an element to gray-800 using the
hover:bg-gray-800
utilities on hover.Control the text color of an element to gray-300 on hover using the
hover:text-gray-300
utilities.Control the text color of an element to sm using the
text-sm
utilities.Control the margin on bottom side of an element to 1.25rem using the
mb-5
utilities.Control the horizontal margin of an element to 0.25rem using the
mx-1
utilities.Control the background color of an element to gray-200 using the
hover:bg-gray-200
utilities on hover.Control the padding on top side of an element to 0rem using the
pt-0
utilities.Use
w-24
to set an element to a fixed width(6rem).Control the border color of an element to 0.5rem using the
border-2
utilities.Control the border color of an element to gray-900 using the
border-gray-900
utilities.Use
w-64
to set an element to a fixed width(16rem).Control the text color of an element to left using the
text-left
utilities.Control the text color of an element to gray-500 on hover using the
hover:text-gray-500
utilities.Control the border color of an element to white using the
border-white
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to make a Dark Mode vs Light Mode Navigation components, learn and follow along to implement your own components.