jarek-foksa/xel

Deprecate global "size" setting

Closed this issue · 1 comments

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" tag
  • Xel.size getter/setter
  • sizechange event on the Xel object
  • size="larger" and size="smaller" attributes on all elements (use size="large" and size="small" instead)
  • computedsize attribute (use size 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.

Done (571c4ec).