How to use the @brainly/html-sketchapp/html2asketch/helpers/utils.RESIZING_CONSTRAINTS.LEFT 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
RESIZING_CONSTRAINTS.WIDTH,
                RESIZING_CONSTRAINTS.HEIGHT
              );
            }

            // CONSTRAINTS FOR SVG IN SELECT AND COUNTER
            if (node.parentElement.classList.contains('sg-counter')) {
              layer.setResizingConstraint(
                RESIZING_CONSTRAINTS.WIDTH,
                RESIZING_CONSTRAINTS.HEIGHT
              );
            }

            // CONSTRAINTS FOR TEXT IN INPUT
            if (layer instanceof Text && node.parentElement.classList.contains('sg-input')) {
              layer.setResizingConstraint(RESIZING_CONSTRAINTS.LEFT);
            }

            // CONSTRAINTS FOR TEXT IN LABEL. SELECT, TEXTAREA
            if (layer instanceof Text &&
                node.classList.contains('custom__placeholder') ||
                node.classList.contains('sg-label__text')
            ) {
              layer.setResizingConstraint(RESIZING_CONSTRAINTS.LEFT);
            }

            // CONSTRAINTS FOR TEXT IN LIST
            if (layer instanceof Text && node.parentElement.classList.contains('sg-list__element')) {
              layer.setResizingConstraint(RESIZING_CONSTRAINTS.HEIGHT, RESIZING_CONSTRAINTS.LEFT);
            }

            // generate better layer name from node classes