Facepunch / sbox-issues

176 stars 12 forks source link

StyleSheetAttribute with path parameter doesn't hotload stylesheets #3341

Open DoctorGurke opened 1 year ago

DoctorGurke commented 1 year ago

Describe the bug

When I use the StyleSheetAttribute in razor panels with a relative path argument it won't hotload the stylesheet.

To Reproduce

  1. Make some test panel type
  2. Use the StyleSheetAttribute with a local path instead of empty arg and naming scheme
  3. Try to hotload the stylesheet

Expected behavior

It should hotload the stylesheet

Media/Files

No response

Additional context

No response

Remscar commented 1 year ago

Even with the full path (or relative path from /code) doesn't work either, yet it will print something in console saying "updating stylesheet"

trundlr commented 1 year ago

If you specify from the level under /code, it should work (from my experience):

https://github.com/apetavern/sbox-grubs/blob/main/code/UI/MainMenu/OptionsMenu/OptionsMenu.razor#L3

Remscar commented 1 year ago

If you specify from the level under /code, it should work (from my experience):

https://github.com/apetavern/sbox-grubs/blob/main/code/UI/MainMenu/OptionsMenu/OptionsMenu.razor#L3

Pretty sure we were doing that before and it wasn't working properly. May have not had a starting / though

garrynewman commented 1 year ago

Is this behaviour different between packaged and local addons?

PolSpock commented 1 year ago

Hello i have the same issue with Razor :

Edit : same problem with @attribute [StyleSheet("gamemenu.razor.scss")]

Edit 2 : like anthonysharpy told me, just using @attribute [StyleSheet] work fine for file named like gamemenu.razor.scss and gamemenu.razor