Title: Using WordPress Theme customizer with SCSS?
Last modified: August 30, 2016

---

# Using WordPress Theme customizer with SCSS?

 *  [joelalexandersson](https://wordpress.org/support/users/joelalexandersson/)
 * (@joelalexandersson)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/using-wordpress-theme-customizer-with-scss/)
 * Hello!
 * Does anyone know if it’s possible to somehow use the theme customizer settings
   with SCSS or maybe have a better solution to this problem:
 * My problem is that I’ve got a scss file with all the color settings for my websites
   but I got this idea that I wanted to transfer this to the theme customizer and
   set all the colors in wordpress instead.
 * Lets say I have a color setting in scss that looks something like this:
    @mainColor
   = #000000;
 * and then a bunch of classes that get’s the color @mainColor in different ways.
   Links, backgrounds..whatever.
 * Can I, in some way, through the theme customizer set @mainColor to whatever I
   want?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/using-wordpress-theme-customizer-with-scss/#post-6857774)
 * This is possible using something like [https://github.com/leafo/scssphp](https://github.com/leafo/scssphp)
 * Check out this [proof-of-concept code](http://pastebin.com/PruWJ1BH) at Pastebin.
   Don’t use this code verbatim, as I don’t do any sanity checking or validating,
   but it’ll hopefully be enough to get you started.
 *  Thread Starter [joelalexandersson](https://wordpress.org/support/users/joelalexandersson/)
 * (@joelalexandersson)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/using-wordpress-theme-customizer-with-scss/#post-6857953)
 * Thanks Stephencottontail! That kind of of did what I wanted! Just one question.
   When i update the color from the wordpress customizer and it compiles into the
   css file. It just keeps adding classes like this and is never replaced:
 * a {
    color: #2401a3; } a:hover { color: #130157; } a { color: #d33; } a:hover{
   color: #a81c1c; } a { color: #ee2; } a:hover { color: #b6b60e; } a { color: #
   d11b4b; } a:hover { color: #8d1233; } a { color: #19db15; } a:hover { color: #
   11950e; } a { color: #ff0707; } a:hover { color: #ba0000; }
 * How can you achieve that it’s replaced instead of added over and over again?
 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/using-wordpress-theme-customizer-with-scss/#post-6857958)
 * That’s why it’s proof-of-concept. 😉
 * Try changing line 33 to this:
 * `$file = fopen( get_template_directory() . '/css/customizer.css', 'w' );`

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Using WordPress Theme customizer with SCSS?’ is closed to new replies.

## Tags

 * [" theme settings"](https://wordpress.org/support/topic-tag/theme-settings/)
 * [scss](https://wordpress.org/support/topic-tag/scss/)
 * [theme customizer](https://wordpress.org/support/topic-tag/theme-customizer/)

 * 3 replies
 * 2 participants
 * Last reply from: [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/using-wordpress-theme-customizer-with-scss/#post-6857958)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
