How to use the @brainly/html-sketchapp.Document 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
export function getASketchDocument() {
  const doc = new Document();

  doc.setName('BrainlyPencilTextSystem}');

  // DOCUMENT COLORS
  Array.from(document.querySelectorAll('.colors-list > .color-box'))
    .forEach(box => {
      const color = getComputedStyle(box).backgroundColor;

      doc.addColor(color);
    });

  // TEXT STYLES
  Array.from(document.querySelectorAll('.text-styles > *'))
    .forEach(node => {
      const styleName = node.title;
      const layers = nodeToSketchLayers(node.firstChild);