Question: In all of the material I've read online, it appears that CSS custom properties and CSS variables are the same thing. However, at the end of an example in the [Inheritance of CSS Variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables#Inheritance_of_CSS_Variables) section of the Mozilla Developer Network documentation, there is this confusing statement:

> 
> Keep in mind that these are custom properties, not actual CSS
>  variables. The value is computed where it is needed, not stored for
>  use in other rules. For instance, you cannot set a property for an
>  element and expect to retrieve it in a sibling's descendant's rule.
>  The property is only set for the matching selector and its
>  descendants, like any normal CSS.
> 
> 
> 

Which gives me the impression that these two concepts are not synonymous. 

What is the difference between custom properties and variables?

Answer: 
A **CSS Custom Property** is the ***same thing*** as a **CSS Variable**. But that seems to come of some clumsy naming. 

They weren't wrong to title the page: [Using CSS custom properties (variables)](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables#Inheritance_of_CSS_Variables)

However a CSS Variable is not a variable in the traditional sense, as there is no way to define it so that it is globally scoped like in a programming language, or CSS Preprocessor (LESS/Sass). 

Even a root scoped custom property/variable is not global. Changing the value of a property in a child will not change the value above or for siblings of that scope. If someone is expecting to be global, it may cause confusion and I suspect that's what Mozilla's writers are trying to point out. 

if you look at 

[w3.org's CSS Custom Properties for Cascading Variables](https://www.w3.org/TR/css-variables/#custom-property) 

> 
> This module introduces a family of custom author-defined properties known collectively as custom properties
> 
> 
> 

Custom properties are definitions that can be referenced using `var(--my-custom-prop)`. Like a variable!

[quote continued...](https://www.w3.org/TR/css-variables/#custom-property)

> 
> as one only has to change the value once, in the custom property, and the change will propagate to all uses of that variable automatically.
> 
> 
> 

**Awkward...** The above statement is not true exactly. It seems Mozilla Developer Network documentation is trying clarify that idea so that it's less confusing. [Repeating the original quote](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables#Inheritance_of_CSS_Variables): 

> 
> Keep in mind that these are custom properties, not actual CSS variables. The value is computed where it is needed, not stored for use in other rules. For instance, you cannot set a property for an element and expect to retrieve it in a sibling's descendant's rule. The property is only set for the matching selector and its descendants, like any normal CSS.
> 
> 
> 

They're pointing out it's ***not a variable in the traditional sense*** of a programming language. But that it is computed just like styles, adhering to the general cascade/scoping rules of CSS. 

Thus `var(--my-custom-prop)` could resolve to very different things based on where it is declared, and that declarations don't propagate out to a higher scope. 

Here's [a codepen to mess around with](https://codepen.io/joshhull/pen/xYWaLY) if you'd like to try it out. 

So think of **CSS Custom Property** the same as **CSS Variable** but be sure to remember that values cascade, and there's no global scope.
I believe that it simply means that if you have the following rules:

```css
#foo{
  --my-prop: 10px;
}

.bar{
  height: var(--my-prop);
}

```

with the following HTML:

```
<div id="foo">
    <div class="bar"></div>
</div>

<div id="sibling">
    <div class="bar"></div>
</div>

```

then the height of the `.bar` div in the `#sibling` div is going to be 0, because the value of `--my-prop` is only inherited by descendants of `#foo`.

The language is confusing. I think the author is probably trying to draw a distinction between variables in procedural languages (like JS) versus Custom CSS Properties. You cannot set a property and use it anywhere, like you might with a variable in another language.