# Apex Chart CSS variables not applying

**URL:** <https://forum.inductiveautomation.com/t/apex-chart-css-variables-not-applying/65968>\
**Category:** 3rd Party Modules\
**Tags:** perspective\
**Created:** [November 2, 2022, 3:57am UTC](https://forum.inductiveautomation.com/t/apex-chart-css-variables-not-applying/65968 "2022-11-02T03:57:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [November 2, 2022, 3:57am UTC](https://forum.inductiveautomation.com/t/apex-chart-css-variables-not-applying/65968/1 "2022-11-02T03:57:21Z")

</div>

I have tried to apply some basic CSS overrides using a custom theme, and have successfully set the **title text color** , and **gridline color** using the following CSS overrides:

```auto
/* Define common apexcharts styling that makes default charts look better in all themes */
.apexcharts-gridline {
    stroke: var(--neutral-70);
}
.apexcharts-xaxis-tick {
    stroke: var(--neutral-70);
}
.apexcharts-yaxis-tick {
    stroke: var(--neutral-70);
}

/* Set grid rows fill color to transparent across the board */
.apexcharts-grid-row {
    fill: transparent;
}
/* Ensure all text is based off theme neutral varibles so it works with light & dark themes */
.apexcharts-title-text {
    fill: var(--neutral-100);
}

```

However I can't get the following working, even after drilling down in the browser using developer tools to find the appropriate classes.

```auto
/* CAN'T GET THESE WORKING */
.apexcharts-text apexcharts-yaxis-label {
    fill: var(--neutral-80);
}
.apexcharts-text apexcharts-yaxis-title-text {
    fill: var(--neutral-80);
}

.apexcharts-yaxis-title {
    fill: var(--neutral-100);
}
.apexcharts-yaxis-text-g{
    fill: var(--neutral-80);
}
.apexcharts-xaxis-title {
    fill: var(--neutral-100);
}
.apexcharts-xaxis-text-g{
    fill: var(--neutral-80);
}

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/62a372a9315fd7f3f64faa62cb6e7f82ee7f6f0a.png)

Any help would be much appreciated. I really don't want to have to bind some of these things to the chart options Style properties on every Apex Chart i create.  
I can't quite figure out why some of the CSS overrides work and some don't.. I'm sure it is something silly.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [November 2, 2022, 4:36am UTC](https://forum.inductiveautomation.com/t/apex-chart-css-variables-not-applying/65968/2 "2022-11-02T04:36:14Z")

</div>

I think the CSS `!important` rule just became my friend..

> **[CSS !important Property](https://www.w3schools.com/css/css_important.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [November 2, 2022, 5:04am UTC](https://forum.inductiveautomation.com/t/apex-chart-css-variables-not-applying/65968/3 "2022-11-02T05:04:29Z")

</div>

Also needed a full stop between classes such as:

```auto
.apexcharts-text apexcharts-xaxis-label {
    fill: var(--neutral-80) !important;
}

```

SHOULD BE:

```auto
.apexcharts-text.apexcharts-xaxis-label {
    fill: var(--neutral-80) !important;
}

```
