Pratham Profile picture
7 Jun, 10 tweets, 2 min read
CSS Animation and CSS Transition are two different modules of CSS but many of us get confused that when to use which one?

Let's try to explore more about them 🧡 πŸ‘‡πŸ»
Though there are some similarities in animation and transition but first let's try to find out the real difference
Transition is something that needs to be triggered. For example, changing the height when the user hover the element

On the other side, animations do not need to be triggered.
Consider this, When I hover over the box, the height changes.

Here hover is the trigger
Watch the above video again, We can say that transition is a two-point operation that takes place between point A and point B

In the above example,

Point A - Initial point - 100px height
Point B - Final point - 200px height
On the other hand, the animation is defined by a keyframe at-rule which varies from one state to another with various properties and time frames.
The other thing to note here is that we can't change multiple properties while working with CSS transition but CSS animation provides us this functionality.
πŸ“Œ Let's talk about how complex these two modules are

The syntax of transition is a little easier than animation hence it is recommended to use CSS transition while manipulating DOM
On the other hand, keyframes syntax is quite difficult which makes it tough to work with JavaScript
I think these are some key differences between transition and animations. I hope you like this thread ❀

Peace out πŸ˜‰

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Pratham

Pratham Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Prathkum

9 Jun
6 GitHub repositories that can help you in writing better CSS code

🧡 πŸ‘‡πŸ»
1. Awesome CSS Learning

- A tiny list limited to the best CSS Learning Resources

πŸ”— github.com/micromata/awes… Image
2. Spin Kit

- A collection of loading indicators animated with CSS

πŸ”— github.com/tobiasahlin/Sp… Image
Read 7 tweets
8 Jun
10 great handmade CSS and JavaScript cheat sheets you won't find anywhere

πŸ§΅πŸ‘‡
1. CSS Box Model πŸ“¦
2. Types of Border Style πŸ”²
Read 12 tweets
7 Jun
5 great favicon websites for every web developer and designers πŸ”―

πŸ§΅πŸ‘‡πŸ»
1. Favicon

The only favicon generator you need for your next project. Quickly generate your favicon from text, image, or choose from hundreds of emojis.

πŸ”— favicon.io
2. Favicon .cs

favicon .cc is a tool to create or download favicon.ico icons, that get displayed in the address bar of every browser.

πŸ”— favicon.cc
Read 6 tweets
7 Jun
Web development is all about exploration. If you are learning this, explore more and learn more from these websites

🧡 πŸ‘‡πŸ»
πŸ“Œ HTML

1. Learn HTML
learn-html.org

2. HTML best practice
hail2u.github.io/html-best-prac…

3. HTML reference
htmlreference.io
πŸ“Œ CSS

1. CSS reference
cssreference.io

2. Learn to code
learn.shayhowe.com

3. CSS layout
learnlayout.com

4. CSS tutorial
csstutorial.net

5. Learn about colors
hexinvaders.com
Read 4 tweets
7 Jun
5 HTML features probably you haven't heard yet

πŸ§΅πŸ‘‡πŸ»
1️⃣ enterkeyhint attribute

The enterkeyhint is a global attribute defines the action for "enter" key on virtual keyboard

It accpets the following values πŸ‘‡πŸ»
2️⃣ sizes attribute

You may have heard about "size" attribute but did you know about "sizes" attribute?

The sizes attribute specifies the sizes of icons for visual media.

Check the compatibility here caniuse.com/?search=sizes
Read 7 tweets
5 Jun
Check out these 3 things that will prove how powerful CSS is

πŸ§΅πŸ‘‡πŸ»
1️⃣ Pure CSS Typewriter effect

- You can create cool typing effect using steps() function of animation-timing-function
Check out the full source code here πŸ‘‡πŸ»

codepen.io/prathamkumar/p…
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(