Tailwind CSS Tutorial #18 - Transitions
Key Takeaways
Adds transitions to elements using Tailwind CSS, demonstrating hover effects and easing functions
Full Transcript
all right then gang so we're getting there this is looking pretty good now in this video i just want to quickly show you how to add transitions so that when you hover over something it doesn't show you the hovering state immediately but rather transitions to that state over a small amount of time and it sometimes looks quite nice so we're going to do that for these two things up here and also for this down here and i think we might add some more hover effects to this as well so let's start with these two so in our code we need to scroll up to those which are right here okay so these are the anchor tags right here and these are the things we want to add transitions to so when i say a transition i mean from the initial state to the hover state and it's the background color and the text color that is transitioning so when we're creating a transition the first thing we need to do is give the element a class of transition the second thing we need to do is say what kind of easing function we want to use so we could use ease linear meaning it's smooth ease in meaning it's slower to begin with but speeds up ease out which means that it's slower towards the end and ease in out which means it's slower at the start and the end but speeds up in the middle all right so you can play around with these i'm going to go with ease out and i'm also going to set a duration to this and that is going to be 500 so 500 milliseconds so they're the three things we need to do add a transition then the easing function and then how long the transition should take so i want the same transition for this anchor tag as well so let me paste that down here and if we check this out now cross our fingers hopefully this should work yep it does and that looks kind of nice right cool so let's add maybe some more hover effects to this dude down here and then add some transitions to that as well so the next hover effect first of all that i want to add is maybe to increase the scale of this thing and also maybe decrease the background opacity so let me go down here and find this button okay it's this thing right here so because we're going to be changing the scale of it the first thing we need to do is give this a transform class and that means that we can now apply transforms to this element so the transform that we want to apply is a scale effect but only when a user hovers over this element so we need hover to prefix the class and then to change the scale we use scale hyphen and then the scale we want to use so for example one two five so if i save this and come over here we can see that it jumps to this new size when we hover over awesome the next thing i want to do is change the background opacity on hover so i'm going to say hover and then to change the background opacity we use the class bg hyphen opacity and then whatever we want the opacity to be so say for example 50 save that and preview and now we can see the background fades out a little bit more and that means we can kind of see the inner shadow a little bit more as well which i like okay now i want to transition this so let's do the same kind of thing as we did above transition and then we want to ease out as our easing function and this time the duration let's say 300 so a little smaller than the other one so that's milliseconds 300 milliseconds so if we hover all right looks pretty nice and now we have transitions on these elements so there we go my friends that's how easy it is to add transitions to your html elements between their original state and their hover state
Original Description
In this tailwind css tutorial we'll take a look at adding some transitions to our elements (e.g. to buttons)
🐱👤🐱👤 JOIN THE GANG -
https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg/join
----------------------------------------
🐱💻 🐱💻 My Udemy Courses:
+ Modern JavaScript - https://www.thenetninja.co.uk/udemy/modern-javascript
+ Vue JS & Firebase - http://www.thenetninja.co.uk/udemy/vue-and-firebase
+ D3.js & Firebase - https://www.thenetninja.co.uk/udemy/d3-and-firebase
🐱💻 🐱💻 Course Files:
+ https://github.com/iamshaunjp/tailwind-tutorial
+ Full html template - https://github.com/iamshaunjp/tailwind-tutorial/blob/lesson-2/public/index.html
🐱💻 🐱💻 Other Related Free Courses:
+ https://www.youtube.com/watch?v=hu-q2zYwEYs&list=PL4cUxeGkcC9ivBf_eKCPIAYXWzLlPAm6G
Download node.js - https://nodejs.org/en/
Get VS Code - https://code.visualstudio.com/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Net Ninja · Net Ninja · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
GraphQL Tutorial #5 - Express App Setup
Net Ninja
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
GraphQL Tutorial #8 - Root Query
Net Ninja
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
GraphQL Tutorial #12 - Author Type
Net Ninja
GraphQL Tutorial #13 - Type Relations
Net Ninja
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
GraphQL Tutorial #18 - Mutations
Net Ninja
GraphQL Tutorial #19 - More on Mutations
Net Ninja
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
GraphQL Tutorial #23 - Create React App
Net Ninja
GraphQL Tutorial #24 - Book List Component
Net Ninja
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
GraphQL Tutorial #28 - Add Book Component
Net Ninja
GraphQL Tutorial #29 - External Query File
Net Ninja
GraphQL Tutorial #30 - Updating Component State
Net Ninja
GraphQL Tutorial #31 - Composing Queries
Net Ninja
GraphQL Tutorial #32 - query variables
Net Ninja
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
GraphQL Tutorial #34 - Book Details Component
Net Ninja
GraphQL Tutorial #36 - Styling the App
Net Ninja
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
Updated Vue & Firebase Course (Udemy)
Net Ninja
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja
More on: UI Design
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
Next.js vs Remix vs SvelteKit: Which Framework Should You Learn?
Dev.to · Etrit Neziri
Had my Frontend Developer interview with Capgemini (Application Developer) today, and I wanted to…
Medium · JavaScript
10 Frontend Developer Tools to Boost Productivity in 2026
Medium · Programming
10 Frontend Developer Tools to Boost Productivity in 2026
Medium · JavaScript
🎓
Tutor Explanation
DeepCamp AI