CSS VARIABLE SERIES FOR REGULAR JOE: EPISODE 1

Teslacrypt
2 min readSep 16, 2018

--

episode one image for css varible series for regular Joe

Before you can understand what css variable is you need to know the meaning of a variable first.

What is variable?

Variable is the container that stores values to be reused.

Joe what that means is that a variable is what store an information or something that will be reused over and over again.

For example Mike is looking for a trusted mechanic that will fix his car any time the car needed to be fixed.

What Mike will do is to search or ask for recommendation

When Mike get a faithful and skillful mechanic that fixed the car properly, next time when Mike’s car need to be fixed, he will not go through the process of searching for a mechanic a gain.

Let’s say the name of the mechanic is Peter Bush, so anytime the car breaks down Mike car Peter Bush and the car get fixed. Peter Bush is the identifier of the variable

What is a Variable identifier?

An identifier is what is used to identify variable that stores the information you want.

In our previous example Peter Bush as a trusted mechanic, Peter Bush is who that stores faithfulness and skillful mechanic. So when mike want a trusted and a faithful mechanic he calls Peter Bush.

Despite Peter Bush is a faithful and skillful mechanic but not everyone can have access to him.

Accessing variable is called Variable Scope.

What is Scope?

A scope is a set of variable you have access to.

And the scope is of two: the Global and the Local variable.

What is Global Variable and Local Variable?

Global variables are variable you have access to everywhere in your code.

Let’s say anyone that register his or her business in Washington DC can offer his or her services everywhere in America. In other words his or her services are accessible to the whole Americans.

We can technically say that his or her business is a global variable but let say Peter Bush register his company in Francisco, Peter Bush can only be accessible by those in Francisco. So we can say Peter Bush business or services is register locally while the other person is register globally.

So where you register your variable matters a lot, it is where you register your variable that will determine its accessibility.

So what is CSS Variable?

According to mozilla variables allows a values to be stored in one place, then referenced in multiple other places

For Joe css variable is a code stored in a variable to be reused.

If you have question please kindly comment bellow.

Clapping does not hurt and sharing it doesn’t kill, please clap and share.

--

--

Teslacrypt
Teslacrypt

Written by Teslacrypt

Interested in blockchain and computer programming

No responses yet