Tailwind CSS Assignment – 1
Basics Questions
- Create a <div> with Tailwind that centers text both horizontally and vertically.
- Add a button styled with Tailwind having blue background, white text, and rounded corners.
- Create a responsive heading (h1) with Tailwind that is text-2xl on mobile and text-4xl on desktop.
- Apply Tailwind to set a <p> tag with custom font font-mono and text color gray-700.
- Create a card layout with shadow-lg, rounded-xl, and p-4.
- Add spacing between two <div> elements using space-x-6.
- Create a navigation bar with flex, horizontal items, and gap 4.
- Apply Tailwind to make a button hover effect: background changes from blue to green.
- Make an image responsive using w-full h-auto.
- Create a container with fixed width using max-w-md and center it with mx-auto.
- Add Tailwind to style text as uppercase, bold, and letter-spaced.
- Use Tailwind grid to create a 2-column layout.
- Create a circle shape using w-20 h-20 rounded-full bg-red-500.
- Add padding (p-6) and margin (m-4) to a div.
- Create a Tailwind-styled footer with bg-gray-900 text-white text-center.
- Use flex-col and items-center to align child elements vertically.
- Create a responsive button that is px-4 py-2 on mobile and px-8 py-4 on desktop.
- Add text truncation (truncate) to a long string.
- Use Tailwind typography to make text italic underline text-pink-600.
- Create a responsive image grid with 3 columns on desktop and 1 column on mobile.
Intermediate Questions
- Add a custom color in tailwind.config.js and apply it to a button.
- Configure Tailwind to use Google Font (e.g., Inter) and apply it to headings.
- Extend spacing scale in tailwind.config.js and use it on a div’s padding.
- Create a responsive navbar with hidden md:flex.
- Add a dark mode background using dark:bg-gray-800 and test toggle.
- Create a card with hover:scale-105 transition duration-300.
- Build a responsive layout with grid-cols-1 sm:grid-cols-2 lg:grid-cols-3.
- Add a background gradient using bg-gradient-to-r from-purple-500 to-pink-500.
- Style a button with focus:ring-4 ring-offset-2 ring-blue-400.
- Create an alert box with border-l-4 border-red-500 bg-red-100 p-4.
- Build a profile card with image (rounded-full), name, and description.
- Create a sidebar layout with flex and min-h-screen.
- Style a form input with border rounded px-4 py-2 focus:outline-none.
- Add responsive font sizes with sm:text-sm md:text-base lg:text-lg xl:text-xl.
- Create a sticky header using sticky top-0 bg-white shadow-md.
- Use divide-y divide-gray-300 to separate list items.
- Create a loading spinner using animate-spin border-4 border-t-blue-500.
- Add responsive visibility: show a div only on mobile (block md:hidden).
- Create a pricing card with title, price, and button styled using Tailwind.
- Configure PurgeCSS in Tailwind to remove unused classes and confirm file size reduction.
Advanced Questions
- Configure Tailwind with JIT mode and add a dynamic class (e.g., bg-[#1DA1F2]).
- Extend Tailwind to add custom breakpoints in tailwind.config.js.
- Add custom box shadow in Tailwind config and apply it to a card.
- Configure Tailwind to include custom animations and create a bouncing button.
- Use @layer components to define a reusable .btn-primary class.
- Use @layer utilities to add a custom text utility class.
- Add custom font family in Tailwind config and apply to entire body.
- Create a JSON config inside tailwind.config.js to define color palette and spacing.
- Convert a Bootstrap-styled button to Tailwind classes.
- Build a responsive dashboard layout with sidebar, header, and content using Tailwind grid/flex.