# CSS Variablen werden nicht mehr kompiliert nach Shopware Update

**URL:** <https://forum.shopware.com/t/css-variablen-werden-nicht-mehr-kompiliert-nach-shopware-update/93661>\
**Category:** Themes & Design\
**Created:** [25. März 2022 um 07:22 UTC](https://forum.shopware.com/t/css-variablen-werden-nicht-mehr-kompiliert-nach-shopware-update/93661 "2022-03-25T07:22:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexGalax](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/alexgalax/32/9925_2.png) [@AlexGalax](https://forum.shopware.com/u/AlexGalax)\
**Post date:** [25. März 2022 um 07:22 UTC](https://forum.shopware.com/t/css-variablen-werden-nicht-mehr-kompiliert-nach-shopware-update/93661/1 "2022-03-25T07:22:45Z")

</div>

**Shopware 6.4.7**  
In meiner base.scss werden in der :root Pseudoklasse css Variablen definiert.

```css
:root {
  --text-color: $sw-text-color;
  --test-var: #000;
}
.test-class{
  color: $sw-text-color;
}

```

Wird mit `theme:compile` wie folgt kompiliert:

```css
:root {
  --text-color: #000;
  --test-var: #000;
}
.test-class{
  color: #000;
}

```

In **Shopware 6.4.9** wird es nun so kompiliert:

```css
:root {
  --test-var: #000;
}
.test-class{
  color: #000;
}

```

Die Variablen werden einfach nicht mehr kompiliert. WARUM? Es ist doch manchmal echt zum verzweifeln.

---

<div class="post-metadata">

**Author:** ![AlexGalax](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/alexgalax/32/9925_2.png) [@AlexGalax](https://forum.shopware.com/u/AlexGalax)\
**Post date:** [28. März 2022 um 08:13 UTC](https://forum.shopware.com/t/css-variablen-werden-nicht-mehr-kompiliert-nach-shopware-update/93661/2 "2022-03-28T08:13:11Z")

</div>

kann das jemand reproduzieren?

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [28. März 2022 um 08:51 UTC](https://forum.shopware.com/t/css-variablen-werden-nicht-mehr-kompiliert-nach-shopware-update/93661/3 "2022-03-28T08:51:45Z")

</div>

Ich habe es nicht mit deinen Variablen getestet, meine selbst erstellten Themes funktionieren aber alle noch.

---

<div class="post-metadata">

**Author:** ![AlexGalax](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/alexgalax/32/9925_2.png) [@AlexGalax](https://forum.shopware.com/u/AlexGalax)\
**Post date:** [28. März 2022 um 09:14 UTC](https://forum.shopware.com/t/css-variablen-werden-nicht-mehr-kompiliert-nach-shopware-update/93661/4 "2022-03-28T09:14:29Z")

</div>

ok, du hast den Punkt um den es geht, nicht getestet. Und wie soll mir das jetzt helfen?

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [28. März 2022 um 10:55 UTC](https://forum.shopware.com/t/css-variablen-werden-nicht-mehr-kompiliert-nach-shopware-update/93661/5 "2022-03-28T10:55:21Z")

</div>

Ich habe andere root Variablen, die funktionieren. Daher ist meine Aussage übertragbar.

Aber extra für dich, mein Ergebnis unter 6.4.9.0:

:root {  
–test-var: #000;  
}

.test-class {  
color: #4a545b;  
}

---

<div class="post-metadata">

**Author:** ![AlexGalax](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/alexgalax/32/9925_2.png) [@AlexGalax](https://forum.shopware.com/u/AlexGalax)\
**Post date:** [28. März 2022 um 12:02 UTC](https://forum.shopware.com/t/css-variablen-werden-nicht-mehr-kompiliert-nach-shopware-update/93661/6 "2022-03-28T12:02:08Z")

</div>

vielen Dank!  
Dann muss ich mal schauen woran das liegen könnte…
