# Stylesheet Scripting

**URL:** <https://forum.inductiveautomation.com/t/stylesheet-scripting/69050>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [January 26, 2023, 8:35pm UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050 "2023-01-26T20:35:01Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [January 26, 2023, 8:35pm UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/1 "2023-01-26T20:35:01Z")

</div>

I'm going to go ahead and guess that there's no way to programmatically update the CSS stylesheet through scripting to alter themes "on-the-fly"? Might there be another way to do that? Maybe editing the actual stylesheet file on the gateway? I'm not sure where it's located.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [January 26, 2023, 8:37pm UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/2 "2023-01-26T20:37:10Z")

</div>

What is the use case/reason behind wanting to?

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [January 26, 2023, 8:37pm UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/3 "2023-01-26T20:37:39Z")

</div>

It looks like the file is located at:

```auto
C:\Program Files\Inductive Automation\Ignition\data\projects\PROJECT_NAME\com.inductiveautomation.perspective\stylesheet\stylesheet.css

```

You should be able to edit it externally (or via scripting), and the changes will be picked up every 5 minutes via the gateway.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [January 26, 2023, 8:39pm UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/4 "2023-01-26T20:39:03Z")

</div>

I want to alter styles on the fly to see changes to variable (color) definitions in real-time and using a color picker, so I don't have to mess with hex codes so much. I could then use this to quickly make new styles using a script to save the current stylesheet as a style in the install directory.

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [January 26, 2023, 8:39pm UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/5 "2023-01-26T20:39:21Z")

</div>

Not sure about amarks, but I have ours setup to edit a different css file to add css definitions on a per-user basis

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [January 26, 2023, 8:39pm UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/6 "2023-01-26T20:39:25Z")

</div>

And I'm guessing that 5 minutes is constant? I can't force an update?

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [January 26, 2023, 8:40pm UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/7 "2023-01-26T20:40:58Z")

</div>

Supposedly, the ability to force an update is a planned feature:

> [@\[IGN-1655\]Force to reload the file page-config/config.json after editing it from disk](https://forum.inductiveautomation.com/t/ign-1655-force-to-reload-the-file-page-config-config-json-after-editing-it-from-disk/64908/4):
>
> The effort to add a system.project.scan() (and associated SDK-callable mechanism) is on the short-list for one of our teams, which likely means it will be picked up for development early next year.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 26, 2023, 8:54pm UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/8 "2023-01-26T20:54:21Z")

</div>

That's a slightly different ask; the asset managers that watch for themes, icon sheets, and fonts for Perspective are _supposed_ to be automatic and pick up changes immediately.

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [January 26, 2023, 9:02pm UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/9 "2023-01-26T21:02:02Z")

</div>

I know some of the changes I make require me to log out and back in before they take affect, at least in the client.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [January 27, 2023, 7:49am UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/10 "2023-01-27T07:49:41Z")

</div>

you can use the inspector in the browser to add and modify styles on the fly to have instant feedback, and copy the styles to your stylesheet

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 27, 2023, 9:03am UTC](https://forum.inductiveautomation.com/t/stylesheet-scripting/69050/11 "2023-01-27T09:03:20Z")

</div>

That's what I was about to say. Seems to be the simplest and most effective solution to that use case.
