<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/css-variables-but-with-a-dash-of-javascript--vhcg6ziad" -->

---
title: CSS variables but with a dash of JavaScript ✨ | daily.dev
description:  CSS Custom Properties or CSS Variables allows us to store a value stored in one place, then referenced in multiple other places. This is useful not only...
canonical: https://daily.dev/posts/css-variables-but-with-a-dash-of-javascript--vhcg6ziad
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: CSS variables but with a dash of JavaScript ✨ | daily.dev
og:description:  CSS Custom Properties or CSS Variables allows us to store a value stored in one place, then referenced in multiple other places. This is useful not only...
og:url: https://daily.dev/posts/css-variables-but-with-a-dash-of-javascript--vhcg6ziad
og:image: https://api.daily.dev/og/posts/VhCG6ZIAd.png
og:image:alt: CSS variables but with a dash of JavaScript ✨
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CSS variables but with a dash of JavaScript ✨

**[daily.dev](https://daily.dev/sources/daily)** · 13 upvotes · 3 comments

## Summary

CSS Custom Properties or CSS Variables allows us to store a value stored in one place, then referenced in multiple other places. This is useful not only because they can be used at multiple instances and makes editing the values easy but also, it makes the properties easier to read when referring to it later.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://daily.dev/posts/css-variables-but-with-a-dash-of-javascript>

## Community discussion

Top comments from developers on daily.dev.

**@ghost** · 1 upvotes

> Here's a summary of sub-topics:
>
>
> 1. Quick note on CSS variables 📝
> 2. Introducing JavaScript ✨
> 3. Using event listeners 👂
> 4. More resources 🤩
>
>
> Thanks to everyone who read it :)

**@rahxul** · 0 upvotes

> This post is just like Pizza with extra spice

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/css-variables-but-with-a-dash-of-javascript--vhcg6ziad)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"CSS variables but with a dash of JavaScript ✨","url":"https://daily.dev/posts/css-variables-but-with-a-dash-of-javascript--vhcg6ziad","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/css-variables-but-with-a-dash-of-javascript--vhcg6ziad"},"datePublished":"2020-11-06T09:05:19.600Z","dateModified":"2021-10-07T14:17:10.317Z","description":" CSS Custom Properties or CSS Variables allows us to store a value stored in one place, then referenced in multiple other places. This is useful not only...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/05eb57e059015b217b5b41ba110bed0b","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/05eb57e059015b217b5b41ba110bed0b","isAccessibleForFree":true,"articleSection":"daily.dev","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"daily.dev","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/daily2","url":"https://daily.dev/sources/daily"},"commentCount":3,"discussionUrl":"https://daily.dev/posts/css-variables-but-with-a-dash-of-javascript--vhcg6ziad","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":13},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"keywords":"javascript,css"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"daily.dev","item":"https://daily.dev/sources/daily"},{"@type":"ListItem","position":3,"name":"CSS variables but with a dash of JavaScript ✨"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/css-variables-but-with-a-dash-of-javascript--vhcg6ziad","comment":[{"@type":"Comment","text":"Here’s a summary of sub-topics:\n\nQuick note on CSS variables 📝\nIntroducing JavaScript ✨\nUsing event listeners 👂\nMore resources 🤩\n\nThanks to everyone who read it :)","datePublished":"2020-11-06T14:08:02.019Z","url":"https://daily.dev/posts/VhCG6ZIAd#c-Qe5_9WuMy","author":{"@type":"Person","name":"Deleted user","url":"https://daily.dev/ghost","image":"https://media.daily.dev/image/upload/s--hNIUzLiO--/f_auto/v1705327420/public/ghost_vlftth"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"This post is just like Pizza with extra spice","datePublished":"2020-11-06T14:47:34.948Z","url":"https://daily.dev/posts/VhCG6ZIAd#c-9e8Hl_1Ym","author":{"@type":"Person","name":"Rahul","url":"https://daily.dev/rahxul","image":"https://media.daily.dev/image/upload/s--w_EB7y0c--/f_auto,q_auto/v1/avatars/avatar_UA2asvbfX"}}]}
```

