How to use the @brainly/html-sketchapp/html2asketch/helpers/utils.RESIZING_CONSTRAINTS.HEIGHT function in @brainly/html-sketchapp

To help you get started, we’ve selected a few @brainly/html-sketchapp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brainly / html-sketchapp-style-guide / src / styleguide2asketch.js View on Github external
// eslint-disable-next-line max-len
            if (symbol._name.startsWith('Button/') && layer instanceof SVG || symbol._name.startsWith('Label/') && layer instanceof SVG) {
              const type = node.children[0].id;
              const size = node.clientHeight;
              const icon = icons.find(icon => icon.type === type);

              layer = icon.symbol.getSymbolInstance({
                x: layer._x,
                y: layer._y,
                width: size,
                // eslint-disable-next-line comma-dangle
                height: size
              });
              // eslint-disable-next-line max-len
              layer.setResizingConstraint(RESIZING_CONSTRAINTS.HEIGHT, RESIZING_CONSTRAINTS.WIDTH, RESIZING_CONSTRAINTS.LEFT);
            }

            if (layer instanceof SVG && node.classList.contains('sg-icon') && !symbol._name.startsWith('Icon/')) {
              const type = node.children[0].id;
              const color = getComputedStyle(node).fill;
              const size = node.clientHeight;
              const icon = icons.find(icon => icon.type === type && icon.size === size);

              if (icon) {
                layer = icon.symbol.getSymbolInstance({x: layer._x, y: layer._y, width: size, height: size});

                // CONSTRAINTS FOR ICON IN LIST
                if (node.parentElement.classList.contains('sg-list__icon')) {
                  layer.setResizingConstraint(
                    RESIZING_CONSTRAINTS.WIDTH,
                    RESIZING_CONSTRAINTS.HEIGHT,