Git Product home page Git Product logo

sketch-react's Introduction

sketch-react

https://zjuasmn.github.io/sketch-react

Project is still in beta, help and advise are welcome.

The goal of this project is trying to reduce the gap between UI design and front-end development (for now, just html). A lot of time of front-end development is spent in matching the given UI design instead of implementing application logic. There are collaboration tools like Zeplin to help marking the design, but programmer still needs to measure and copy css for each element assemble them and copy icons and other assets one by one.

Here, we take a step further by generate html from .sketch file(v43+). So you can copy a group of element as html code and paste it in online or local text editor. Just a copy and paste from design to working code. Enjoy it.

Roadmap

  • export to React code
  • autoprefix css
  • reduce export code size
    • svg code optimization
    • class style generate from symbol, share style
  • optimize position css
    • detect row or column pattern of elements
    • detect padding
    • detect corner element
  • minor edit
    • visible & lock
    • ...

Limitation

Due to the limitation of html, it cannot be 100% math the original design, like background blur, multiple borders, multiple fills, masking, image color adjust and so on.

General

Feature Support Related CSS Attributes
Position Support top, left
Size Support width, height
rotation, flip Support transform
Opacity Support opacity
Blending Support mix-blend-mode
Lock No
Hide Support display:none

Text(rendered as <span/>)

Feature Support Related CSS Attributes
Typeface Limit(no fallback) font-family
Weight Support font-weight
Color Limit(only solid color) color
Size Support font-size
Alignment Support text-align
Width Limit (Auto)width:auto(Fixed)width:?px
Spacing-Character No letter-spacing
Spacing-Line Limit line-height
Spacing-Paragraph No
Fills No
Borders No
Shadows No
Blur No

Symbol

Feature Support Related CSS Attributes
Size Limit(only support same size as symbol master)
Overrides no

Image (render as <img/>)

Feature Support Related CSS Attributes
Color Adjust no

Group(<div/>)

Feature Support Related CSS Attributes
mask limit(only when the mask is the most bottom layer and it is simple shape and all sibling layer don't ignore the mask) overflow:hidden

Shape

Simple Shape(<div/>)

A shape is considered as simple when it is a rectangle or Oval with its points unedited.

Complex Shape(<svg/>)

complex shape needed to be flatten before render.

Feature Support Related CSS Attributes
fill limit(only one fill with solid color) fill
borders limit(only one border with solid color) stroke,stroke-width
shadows & innerShadows no
blur no
bool operation no

sketch-react's People

Contributors

zjuasmn avatar

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.