---
title: "Discussion on \"Combining SASS variables with CSS custom properties\" | Hashnode"
description: "Discussion on \"Combining SASS variables with CSS custom properties\". On the surface, both of these do the same thing. These will both set the background to red.\nSCSS:\nbody {\n  $red: #ff0000;\n  background: $red;\n}\nCSS:\nbody {\n  --red: #ff0000;\n  background: var(--red);\n}\nBut they are different.  There's a CSS Tricks ex..."
url: "https://hashnode.com/posts/combining-sass-variables-with-css-custom-properties/607a94d4c99e200d08f7a981"
---

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

Discussion

# [Combining SASS variables with CSS custom properties](https://blog.nicm42.me.uk/combining-sass-variables-with-css-custom-properties?utm_source=hashnode&utm_medium=feed)

On the surface, both of these do the same thing. These will both set the background to red. SCSS: body { $red: #ff0000; background: $red; } CSS: body { --red: #ff0000; background: var(--red); } But they are different. There's a CSS Tricks ex...

Apr 17, 2021 · 1 min read · blog.nicm42.me.uk  
Read the article

-   [#css](https://hashnode.com/tag/css)
-   [#scss](https://hashnode.com/tag/scss)
-   [#sass](https://hashnode.com/tag/sass)

## Written by

[Nic](https://hashnode.com/@nicm42)

@nicm42 · England

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

This week I learnt...

Front End Developer. I like problem solving and making things pretty. I also like red.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
