I've come across an interesting bug on Ignition version 8.1.47.
Worth noting: I tried to replicate this on another 8.1.47 server but was unable to. I also tried restarting the server but to no avail.
After a lot of testing to figure out why my perspective style class (not is stylesheet.css) doesn't work, I figured out that the first class from top to bottom does work properly, like the style is not applied. I checked the DOM in the browser and found the style class is applied to the div:
This sentance confuses me, which is it the style works and is applied or it doesn't work because it isn't applied?
For what it is worth, CSS works on a Top to bottom hirarcy, styles which are declared later in the document take precedence all things equal.
You can force your styles to take precendence in other ways, but this is difficult in the style class editor. Ignition inserts style classes at the end of the compiled CSS so style classes should take precedence based on source order, but if an earlier class declared by Ignition has a higher specicifity, or is marked !important, you styles may not be applied.
As for the script not finding a reference to your dummy_style, I am not suprised. I believe that user provided styles are compiled into the CSS at runtime on the gateway, and then sent to the client. The script console runs in Vison Client scope and so, doesn't really have access to that information.
Testing the the browser is always prefered. Perhaps move the script into a button on the view, so that you can run it in a prespective scope.
I suggest you look for errors in your CSS, as sometimes these can impact all CSS that follows and effectively disable it. I forgot a colon (or something equally silly) in my stylesheet one time near the top of a longish file, and all of a sudden half my styling was gone
Thank you both for your suggestions, but after a long nights sleep and a bit of luck I figured out what is going on. I made a mistake in my stylsheet.css:
Best guess is that Ignition compiles the stylesheet.css and the Ignition styles into one CSS file from top to bottom which caused the first selector, in this case 'dummy_style' not to work...