Giter VIP home page Giter VIP logo

dtl's Introduction

Designs to Layouts

This is a work-in-progress Figma plugin that can be used to take a page and convert the top-level frames in that page into layouts. Those layouts can be HTML pages, views in an application, pages in a document and many other things. The plugin produces an intermediate representation that can be converted into the target layout format by writing an interpreter. Currently only Vaadin 14 Java projects are supported, but more targets are coming.

In more detail, dtl first converts the absolutely positioned components into a tree of components with proper nesting. Then the positioning of those components is reproduced using flexbox. That should produce a layout that maintains the proper positioning of elements when the layout is scaled. The resulting layout is not 1:1 with the design, but one goal is to get it as close as possible.

To achieve this, each element needs its description field filled with the tag it represents (button, vaadin-text-field...). To create the layout, components need to be grouped into layouts. This is done by surrouding them with a component whose tag is div. Each layout can contain components positioned either vertically or horizontally. That rule might be relaxed in the future when things like grid layout will be available.

How to install the plugin and convert the example design

First either clone this repository or download a zip of it via the "clone or download" button above. Then import the example_design.fig file into figma. To install the plugin, right click on the design, navigate to Plugins > Development > New Plugin... There click to choose the manifest.json inside the copy of this repository you just downloaded, and you're done. To access the plugin, right click on the design again and navigate to Plugins > Development > Designs to Layouts. Click on Generate layouts to see what your layouts should look like in the application and then click on Download to get a Vaadin project.

Roadmap

Since there is no feedback yet, these are things that would be nice to have:

  • Support for styles created in Figma
  • Use text in components
  • Snippets instead of tag name for component conversion
  • Navigation between layouts
  • Automatic clustering to reduce the need to draw layout components
  • Grid layout

dtl's People

Contributors

mjvesa avatar

Watchers

 avatar

dtl's Issues

Use the exporters from UniDe

There is an issue for UniDe regarding exporting to more platforms than just Java mjvesa/unide-src#63

Once that has been implemented, the same exporters should work with this plugin just fine, so let's use them here as well.

Use text in components

Find the parents of TextNode nodes and assign the content as the text property of those. That should already allow editing the text content of things that have one piece of text in them.

Process top level frames into layouts

Currently only one frame is supported. Find out which frames are the top level frames and group all other components into those. Then convert the frames one by one into layouts, using the name of the frame as the name of the layout.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.