One of my customers has their own CSS button style that I'm trying to apply to Smartclient. They'd like it to be rounded, in addition to numerous other styles including state manipulation. To bring their style into Smartclient, I'm trying the following:
which seems to capture most of the styling well, except for the border and the radius. To try to figure this out, I dug into radius. After stepping through your code, I noticed that in `getComputedStyle` you're relying on an API call document.defaultView.getComputedStyle:
what I'm seeing is that the style that's in the test element is not being captured by Smartclient. When I print out borderRadius, it says 0, but when I expand the style object in the console, the border radius is not zero. If I use a breakpoint there, then the correct style is captured (and the button in the page is rounded).
Playing with commenting out lines in my style sheet, I find that the incompatible style is:
so it looks like transitions are preventing your code from working as I would hope, I'm guessing because you're reading some kind of "initial" styles, not the transitioned styles. Is there a way you could strip transitions before you compute styles?
I tried to reproduce this in your showcase
https://www.smartclient.com/smartcli...izeIncrease=10
but when I click "Try it", even without making any changes, it gives me an error:
I'm using Chrome on macOs:
Version 61.0.3163.100 (Official Build) (64-bit)
"v11.1p_2017-10-03/LGPL Deployment"
Code:
isc.Button.create({ baseStyle:"primary-action", //baseStyle:"buttonRounded", showDisabled: false, showDown: false, showFocus: false, showFocused: false, showRollOver: false, title: "<span class='standardFont' style='font-size:" + scale + "'>Clear Filters</span>", width: 100, height: 30, }),
which seems to capture most of the styling well, except for the border and the radius. To try to figure this out, I dug into radius. After stepping through your code, I noticed that in `getComputedStyle` you're relying on an API call document.defaultView.getComputedStyle:
Code:
console.log("id:",ID); if (document.defaultView && document.defaultView.getComputedStyle) { style = document.defaultView.getComputedStyle(element, null); } if (style == null) { style = {}; this.logWarn("getComputedStyle() not natively available - can't " + "guarantee accurate styling information for element:" + this.echoLeaf(element)); if (this.logIsDebugEnabled()) { this.logDebug(this.getStackTrace()); } } styleInfo = {}; console.log("style:",style["borderRadius"]); console.log("style:",style); for (var property in mask) { console.log("setting:",property,style[property]); styleInfo[property] = style[property]; }
Playing with commenting out lines in my style sheet, I find that the incompatible style is:
Code:
-moz-transition: all 250ms ease-in-out; -o-transition: all 250ms ease-in-out; -webkit-transition: all 250ms ease-in-out; transition: all 250ms ease-in-out;
I tried to reproduce this in your showcase
https://www.smartclient.com/smartcli...izeIncrease=10
but when I click "Try it", even without making any changes, it gives me an error:
I'm using Chrome on macOs:
Version 61.0.3163.100 (Official Build) (64-bit)
"v11.1p_2017-10-03/LGPL Deployment"
Comment