How much of this could be incorporated in the regular version of betzaNew.js for improving the behavior under 'size pressure'?
The divs added for the flex code will interfere with the grid CSS I used on a few pages. But if you wanted to incorporate it, I could edit these pages to not use the grid CSS.
I suppose the new cell-size directives would always be an improvement?
They will be for browsers that support the CSS min function. For browsers that do not, they should appear at the assigned size. For a phone to have no browser that supports min, it would have to be so out-of-date that it can support only ancient versions of browsers. The Kindle is a special case, because you cannot install other browsers, and its browser is not as capable as most browsers. But its screen is large enough to display a board at full size without needing to reduce its size.
The rim-suppression color is a bit tricky, as I already made so many Diagrams that use FFFFFF for this. But I suppose it would not be harmfull to suppress it on both FFFFFF and FFFFF0.
One problem with your current diagrams is that when rimColor is set to #FFFFFF, it puts the coordinates on a background of that color, which puts a border on two sides of the board without putting any border on the other two sides.
But perhaps it would be better to keep using FFFFFF as 'signalling code' for rim suppression, and let the Diagram use FFFFF0 in that case for the color of the part of the rim it still displays (as background for the coordinates).
Instead of doing that, I have set it up so that the signal for rim suppression is to not assign a value to rimColor. When no color is assigned, it does not add a value for background to the rimStyle variable, and it does not display borders on the top and right. Likewise, when no color is assigned to coordColor, it does not assign a color value to rimStyle. So, when either of these is not assigned, it just uses the color already in use on the page.
If I added code that replaces '#FFFFFF' with an empty string for the rimColor value, then that color would still signal rim suppression, and the rank and file markers would appear against the same background color as the page instead of one that slightly differs from it.
This method would be more robust in the hypothetical case we would ever want to change the page background color. The replacement color could be defined as a variable at the start of the script. Or perhaps the script could even be made smart enough to extract it from the surrounding HTML element?
By not assigning a background color when none is specified, it uses the background color on the page without needing to look it up.
The divs added for the flex code will interfere with the grid CSS I used on a few pages. But if you wanted to incorporate it, I could edit these pages to not use the grid CSS.
They will be for browsers that support the CSS
min
function. For browsers that do not, they should appear at the assigned size. For a phone to have no browser that supportsmin
, it would have to be so out-of-date that it can support only ancient versions of browsers. The Kindle is a special case, because you cannot install other browsers, and its browser is not as capable as most browsers. But its screen is large enough to display a board at full size without needing to reduce its size.One problem with your current diagrams is that when rimColor is set to #FFFFFF, it puts the coordinates on a background of that color, which puts a border on two sides of the board without putting any border on the other two sides.
Instead of doing that, I have set it up so that the signal for rim suppression is to not assign a value to rimColor. When no color is assigned, it does not add a value for
background
to therimStyle
variable, and it does not display borders on the top and right. Likewise, when no color is assigned to coordColor, it does not assign a color value torimStyle
. So, when either of these is not assigned, it just uses the color already in use on the page.If I added code that replaces '#FFFFFF' with an empty string for the rimColor value, then that color would still signal rim suppression, and the rank and file markers would appear against the same background color as the page instead of one that slightly differs from it.
By not assigning a background color when none is specified, it uses the background color on the page without needing to look it up.