Pratham Profile picture
16 May, 16 tweets, 4 min read
Functions exists in CSS as well

CSS functions can represent more complex data types and can do special data processing and calculations. Let's talk about it in detail

πŸ§΅πŸ‘‡πŸ»
The syntax of CSS functions is same and standard like in other programming languages. Function name followed by the set of parenthesis and they can accept multiple argument.

{ 2 / 16 }
The functions in CSS is broadly divided into 8 categories. They are

1. Transform functions
2. Math functions
3. Filter functions
4. Color functions
5. Image functions
6. Counter functions
7. Font functions
8. Shape functions

{ 3 / 16 }
You're already familiar with most of the common functions that are used widely. For example, rgba() functions which comes in color functions category.

rgba stands for red, green, blue and alpha

{ 4 / 16 }
The most widely used CSS functions are transform functions which includes

- rotate
- scale
- skew
- translate

{ 5 / 16 }
Let's talk about a powerful function in CSS which is matrix function. matrix() function can perform multiple transformation togethers.

It accepts 6 params scaleX, skewY, skewX, scaleY, translateX and translateY

{ 6 / 16 }
For example, check out this piece of code which illustrate the matrix function πŸ‘‡πŸ»

{ 7 / 16 }
You can add cool effect in image using filter functions. Filter functions can change graphical effects of an image which can change the appearance

{ 8 / 16 }
You can refer to my this thread for detailed explanation of filter functions



{ 9 / 16 }
Alright moving forward, the free main functions which you need to know because they are widely used are linear-gradient, conic-gradient and radial gradient.

They all are types of image functions.

{ 10 / 16 }
The conic-gradient() functions create a background image with mentioned color rotated around the center like a wheel

background: conic-gradient(red, orange, yellow, green, blue);

{ 11 / 16 }
The CSS linear-gradient() functions is used to create the background images consisting of a two or more colors. It creates the gradient background.

But there are a lot values we can pass in this linear-gradient function which makes it confusing.

{ 12 / 16 }
The radial-gradient() CSS function creates an image consisting of a progressive transition between two or more colors that radiate from an origin.

{ 13 / 16 }
Shapes functions has also some practical use in order to create shapes. We can use them with clip-path, offset-path and shape-outside property.

{ 14 / 16 }
The polygon() function of shape functions is used to make some complex shapes. For example, check out this arrow shape which is created using polygon functions πŸ‘‡πŸ»

{ 15 / 16 }
There are a lot of CSS functions which we can use. But in this thread I have included some functions which are widely used.

Did I forget to add some functions? Feel free to add more ❀️

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

18 May
React Hooks are the functions which "hook into" React state and lifecycle features from function components. Hooks allows you to manipulate state and other React feature without writing a class. Let's talk about widely used hook

useEffect hook at a glance πŸ§΅πŸ‘‡πŸ» Image
useEffect hook is the heart of React functional components

If you're familiar with class components then you might know that we have various lifecycle methods but in functional components, we don't have any lifecycle methods. Instead we have a powerful hook called useEffect
By using useEffect, you tell React that your component needs to do something after render. React will remember the function you passed (we'll refer to it as our β€œeffect”), and call it later after performing the DOM updates

So let's start by understanding the syntax first

3/15 Image
Read 15 tweets
17 May
5 great background websites for every web developer and designer

πŸ§΅πŸ‘‡
1. Magic pattern

Beautiful pure CSS background patterns that you can actually use in your projects. They are highly customizable as well.

πŸ–‡οΈ magicpattern.design/tools/css-back…
2. Cool backgrounds

Collection of cool backgrounds that you can add to blogs, websites, or as desktop and phone wallpapers

πŸ–‡οΈ coolbackgrounds.io
Read 6 tweets
17 May
Have you heard the term "Tooltip" in web development?

Tooltips guide your visitors to take action and hence provides extra layer of guidance without any difficulties and hence increase the user experience

Let's create a tooltip using HTML and CSS only πŸ§΅πŸ‘‡πŸ»
We just need to create an element that we will be visible only when user moves the mouse pointer over an elment

STEP1: Let's start with the HTML structure <div class="content">WHAT IS A TOOLTIP?   <span cl
STEP2: Popup text

- Add some width and padding
- Hide the popup element throughout and show it only on hover
- Place it above the element
- Add little transition for smooth rendering
Read 7 tweets
17 May
CSS art is a good way to enhance and improve your CSS knowledge.

Let's create Phineas using pure CSS in few simple steps πŸ§΅πŸ‘‡πŸ»
STEP 1. Create a head

create a triangle and rotate it so that it looks like a head
STEP 2. Create smile and ear

We have a pseudo elements in CSS, so we can create smile and ear using head::after and head::before. Its a good way to learn about pseudo-elements
Read 11 tweets
15 May
You can check out these websites if you're learning HTML, CSS and JavaScript 🧡...
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

6. Learn gird layout
griddy.io
Read 4 tweets
15 May
Are you planning to learn CSS for adding some cool styling in your website?

In this thread, I'm covering all the basics and proper plan you need to know in order to getting started with CSS.

🧡 πŸ‘‡πŸ»
We need to know the importance of CSS first. Why CSS?

Well I guess CSS is the only language that add some visuals in website. Without CSS, Without it, websites would still be plain text on white backgrounds.

{ 02 / 17 }
Let's compare a website with and without CSS

Image 1: With CSS
Image 2: Without CSS

{ 03 / 17 }
Read 17 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!

:(