I have a GUI in ReplicatedStorage that has a StyleLink pointing to a StyleSheet.
A local script is copying that GUI into Player.PlayerGui.
There seems to be like a 70% chance that the stylesheet does not get applied.
I even tried explicitly relinking after cloning in case it was something with the stylesheet not being loaded yet.
Basically:
local stylesheet = game.ReplicatedStorage:WaitForChild("Design"):WaitForChild("GameControlStyleSheet")
clonedGui.StyleLink.StyleSheet = stylesheet
but that doesn’t seem to change the result.
What it usually looks like when the stylesheet is not being applied.
What it looks like during the times the stylesheet actually is applied.

Expected behavior
I would expect the stylesheet to be applied to the cloned GUI every time.
Or Consistently not work if I had something setup wrong.
Hi @CookieAroundTheBend, can you provide the place file or .rbxm with the specific GUI so that we can take a closer look?
stylesheet_example.rbxl (100.4 KB)
Attaching a stripped down example file. It seems to happen less frequently but still like 3 out of 10 times when starting/stopping the Test.
Hi, we looked into your repro file and this is actually the intended behavior. The inconsistent loading occurs because the priority of BaseStyleSheet and StyleSheet are the same for their StyleDerives under GameControlStyleSheet. To fix this, go to the derives screen under GameControlStyleSheet and reorder the derives by clicking the arrow. In your case, since you want StyleSheet to override BaseStyleSheet, it should look like this.
You can verify that it worked by going to the StyleDerive instance under GameControlStyleSheet and seeing that the Priority property should now be 1.
Let us know if you have any questions and thanks for the report!
Hmm, interesting. Didn’t know they could have the same priority. Since that is possible it feels like there should be a way to see that in the Style Editor UI since you can’t trust the ordering that you see.
Thanks for looking into it!
1 Like