Arslan Khalid Profile picture
Sep 15, 2020 7 tweets 3 min read Read on X
How to style #CSS Element State Pseudo Classes

🧵A thread🧵
:in-range and :out-of-range

Style number type inputs when the value entered by user is out-of-range or in-range. ImageImage
:enabled & :disabled

Style the elements in enabled (default) and disabled state.

Disabled state is handy when displaying immutable data and helping users avoid multiple clicks on a form button. How to use enabled and disa...
:checked

Checked state for radio and checkbox type inputs which are commonly used in forms.

Use it to change the label style to add another visual cue for the user. How to use checked pseudo s...
:invalid

Checks if the input type specified matches the value entered.

If the input type is email and the user enters an invalid email then you can use :invalid selector to give hint to the user. How to use :invalid pseudo ...
:hover :focus :active

Style all three states if it's the preferred behavior.

Otherwise you can combine :active and :hover states. How to use pseudo states on...
Which other pseudo states do you normally use?

Any suggestions for the next topic you want me to cover in CSS.

I'd love to know your suggestions.

• • •

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

Keep Current with Arslan Khalid

Arslan Khalid 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 @thearslankhalid

Oct 2, 2020
CSS Animations:

Usage and Performance and Tips

🧵A thread 🧵
Usage:

Only two properties are required for a CSS animation.

1. animation-name
2. animation-duration

All other properties are optional.
@ keyframes is the timeline for an animation:

You can use it in the following two ways. ImageImage
Read 8 tweets
Oct 1, 2020
CSS Easing Functions:
Easing is a word used to describe the acceleration and deceleration of a transition or an animation along a timeline.

We can plot this a graph.

The graph for a linear easing is a straight line. Image
Animation timing function property in CSS allows to specify the easing.

We have 5 easing functions already baked into CSS. Image
Read 7 tweets
Sep 25, 2020
CSS Transitions:

Usage and Performance

🧵A thread 🧵
Usage:

Only two properties are required for a CSS transition.

1. transition-property
2. transition-duration

The other two properties are optional ( transition-delay and transition timing function )
There are two ways to use transitions.

A. You could break everything.
B. Shorthand.
Read 9 tweets
Sep 24, 2020
Getting😎with JSON:

( 🧵A mini-thread🧵 )

JSON is used to exchange data with server.

Consider you are a developer for a car showroom and you need to add new cars to your database.

For example the new cars JavaScript Object is:

#javascript #100DaysOfCode
Servers receive data in string format.

So you have to convert to your new cars JavaScript object to a string.

JSON.stringify() function can help you do that.

Here's how:
When getting data from server, the data is always a string.

You can use JSON.parse() function to convert the received cars data into JavaScript object.

For example:
Read 4 tweets
Sep 20, 2020
🔥Git Good Practices

1. Make clean commits:

Don't do too much on one commit.

Fix one bug, commit, fix second bug, commit and so on.

Break features into steps and repeat the clean commit process.
2. Good commit messages:

Capitalized, meaningful names in the present tense is the best commit message practice.

Example:

Added responsiveness to the website
3. Commit often:

Create small commits for any meaningful update that you make.

For example, when you add a new section or code a new component.
Read 5 tweets
Sep 18, 2020
CSS Property ( will-change )

The will-change property hints the browsers what properties are going to change.

Therefore, helping the browser set up optimizations before an element is actually changed.

This is great for optimizing animations / transitions.

Here's how it's done Image
Although it seems cool to use will-change as much as you can to optimize the performance of the page.

It's recommended to use on elements that are sure to change like sliders, modals.
Moreover, will-change property should only be used to tackle performance issues not anticipate them.

Optimizations use machine resources to accelerate the rendering process and it can become a lot labor intensive for browser to optimize unnecessary elements.
Read 6 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

Don't want to be a Premium member but still want to support us?

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

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(