Deprecate global "size" setting
Closed this issue · 1 comments
jarek-foksa commented
Global size setting should be delegated to the host environment. I have already migrated Boxy SVG to rely exclusively on the zoom factor set using webFrame.setZoomFactor()
(Electron) or the native "Zoom in/out" controls (PWA).
Following APIs should be removed from Xel:
<meta name="xel-size"
tagXel.size
getter/settersizechange
event on theXel
objectsize="larger"
andsize="smaller"
attributes on all elements (usesize="large"
andsize="small"
instead)computedsize
attribute (usesize
instead)
The size
getter/setter on each widget should be adjusted so that the only allowed values are "small", "large" or null (default):
class {
// @type "small" || "large" || null
// @default null
// @attribute
get size() {
let size = this.getAttribute("size");
return ["small", "large"].includes(size) ? size : null;
}
set size(size) {
["small", "large"].includes(size) ? this.setAttribute("size", size) : this.removeAttribute("size");
}
}
Finally, make sure to increase the major Xel version number and document all breaking changes in the changelog.
jarek-foksa commented
Done (571c4ec).