---
title: "Discussion on \"Using CSS Variables like a Pro\" | Hashnode"
description: "Discussion on \"Using CSS Variables like a Pro\". CSS variables help you create custom CSS styles that can be reused continuously throughout your document or website. This is done using the var() function."
url: "https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Using CSS Variables like a Pro](https://timonwa.hashnode.dev/using-css-variables-like-a-pro?utm_source=hashnode&utm_medium=feed)

CSS variables help you create custom CSS styles that can be reused continuously throughout your document or website. This is done using the var() function.

Nov 9, 2021 · 10 min read · timonwa.hashnode.dev  
Updated Aug 27, 2023  
Read the article

-   [#css](https://hashnode.com/tag/css)
-   [#variables](https://hashnode.com/tag/variables)
-   [#codenewbies](https://hashnode.com/tag/codenewbies)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)

## Written by

[Timonwa Akintokun](https://hashnode.com/@Timonwa)

@Timonwa · Lagos, Nigeria

  
[View profile](https://hashnode.com/@Timonwa)

Developer | Writer | Creator

Hi, I'm Timonwa! I write articles on web development that help other developers learn more easily. These articles include beginner-friendly tutorials, open source, technical writing, and more.

## Responses 6

Markdown supported · ⌘↵ to post

[Cess](https://hashnode.com/@Cesscode)

[Nov 14, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/61911ef3770afc563f667629)

Nice article.. how can one make the table of contents exactly like that ?

[Timonwa Akintokun](https://hashnode.com/@Timonwa)

[Nov 14, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/61911ef3770afc563f667629#reply-619139c983e4212d6e579d15)

Thank you.

It's just like inline linking in html/css. You use one # for all headings. Then no space between the # and the anchor name. The anchor tag names must be in lowercase, and delimited by dashes if multi-word.

Eg. `[click on this link​](​#my-multi-word-header​)`

`###My Multi Word Header`

Then I think(I can't rmmbr) if there are multiple headers with d same name, you will add number at the end of it.

Eg. `[click on this link​](​#duplicate-header1) [click on this link too](​#duplicate-header2)`

`##Duplicate Header` `###Duplicate Header`

[Cess](https://hashnode.com/@Cesscode)

[Nov 14, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/61911ef3770afc563f667629#reply-61914d00770afc563f6678ce)

Interesting... I will try it out in my next article

[Eleftheria Batsou](https://hashnode.com/@eleftheriabatsou)

[Nov 10, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618c0472468c06249afc6b70)

Thank you [Pelumi Eyitimonwa Akintokun](https://hashnode.com/@Timonwa)for this! 🤍

[Timonwa Akintokun](https://hashnode.com/@Timonwa)

[Nov 11, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618c0472468c06249afc6b70#reply-618da6c3468c06249afc8740)

You are welcome Eleftheria Batsou.

[Nomadev](https://hashnode.com/@thenomadevel)

[Nov 9, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618a9287f991b025366dfcfd)

Really appreciated, So nicely written 💟

[Timonwa Akintokun](https://hashnode.com/@Timonwa)

[Nov 9, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618a9287f991b025366dfcfd#reply-618ab6b2468c06249afc526f)

Thank you Nomadev.

[James 'Dante' Midzi](https://hashnode.com/@Psypher1)

[Nov 9, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618a8a0b468c06249afc4e02)

Great article! You clearly explained.

[Timonwa Akintokun](https://hashnode.com/@Timonwa)

[Nov 9, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618a8a0b468c06249afc4e02#reply-618ab693f991b025366e0010)

Thank you James, I try my best.

[GraceOS.](https://hashnode.com/@graceos)

[Nov 9, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618a4aab468c06249afc47f5)

Beautiful write up, thanks for sharing! 😊

[Timonwa Akintokun](https://hashnode.com/@Timonwa)

[Nov 9, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618a4aab468c06249afc47f5#reply-618a4fc8f991b025366df5f2)

Thank you Grace

[Jeremiah Lena](https://hashnode.com/@lenajeremy)

[Nov 9, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618a3a7ff991b025366df377)

Nice article, Timonwa😊😊

[Timonwa Akintokun](https://hashnode.com/@Timonwa)

[Nov 9, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618a3a7ff991b025366df377#reply-618a49c8f991b025366df59f)

Thank you Jeremiah

[Timonwa Akintokun](https://hashnode.com/@Timonwa)

[Nov 9, 2021](https://hashnode.com/posts/using-css-variables-like-a-pro/618a2ff8468c06249afc433e/comment/618a3a7ff991b025366df377#reply-618a4f8e468c06249afc483d)

Thank you Jeremiah
