If you look at the view-common.ts class; attempting to assign anything via JavaScript to the style property of the class, will throw a runtime error about the style being read only. However in the Declarative UI, you use the style property to assign a text style string to the component.
This is inconsistent, Anything I can do in the Declarative UI; should be equally do-able via JavaScript. Yes, I realize I can modify individual View.style.someProperty; but if I can use a String in the Declarative UI; I should be able to use a string via JavaScript.
I should be able to do view.style = "padding-left: 2; background-color: red" and get this applied. Just like if I put it in the Declarative UI XML.
I believe what needs to happen if I apply a inline style string to the style; that I need to reset the styles variable; re-apply App.css, then Page.css; then run the same code that is inside this._applyInlineStyle(inlineStyleString);. This way the style is reset back to scratch each time I apply a inline style string.
Any arguments against? If my position and assumptions on what needs to happen is correct, I can work on a commit patch later in the week...
If you look at the view-common.ts class; attempting to assign anything via JavaScript to the style property of the class, will throw a runtime error about the style being read only. However in the Declarative UI, you use the style property to assign a text style string to the component.
This is inconsistent, Anything I can do in the Declarative UI; should be equally do-able via JavaScript. Yes, I realize I can modify individual View.style.someProperty; but if I can use a String in the Declarative UI; I should be able to use a string via JavaScript.
I should be able to do view.style = "padding-left: 2; background-color: red" and get this applied. Just like if I put it in the Declarative UI XML.
I believe what needs to happen if I apply a inline style string to the style; that I need to reset the styles variable; re-apply App.css, then Page.css; then run the same code that is inside this._applyInlineStyle(inlineStyleString);. This way the style is reset back to scratch each time I apply a inline style string.
Any arguments against? If my position and assumptions on what needs to happen is correct, I can work on a commit patch later in the week...