GithubHelp home page GithubHelp logo

dougdesigner / fluid-for-sketch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matt-curtis/fluid-for-sketch

0.0 1.0 0.0 2.51 MB

Sketch-flavored Auto Layout-like Constraints

Objective-C 5.21% JavaScript 94.79%

fluid-for-sketch's Introduction

๐Ÿ’ง Fluid for Sketch 1.0

A collaborative project brought to you by Matt Curtis & Cat Noone

Fluid is a Sketch plugin that provides a means to create more constraint-based, responsive designs. It is based on Auto Layout constraints.

๐Ÿ“ฆ Download Plugin (Zipped) โฌ‡๏ธ Download the Example Sketch Document

--

Installation

NOTE: For the time being, installs via Sketch Toolbox do not work, and you must install it manually.

  1. Download the .zip above and extract it.
  2. Double-click Fluid.sketchplugin.
  3. ??? Profit.

Features

  • Pin, Offset, Center, and Size relative to Parent Group, Parent Artboard, or Previous Sibling Layer.
  • Utilize simple mathematic expressions as values, such as 50% - 10
  • View your artboards at different sizes (Mobile, Tablet, Desktop) using Preview Mode **
  • Constraints are stored directly on a layer, so no worries with layer names.

Usage

First and foremost, we recommend downloading the example Sketch document included in this repo (linked to it above). There are several examples included there, and examining the constraints used and playing around with the different options (i.e. Changing constraints, re-sizing artboards and pressing Update Layout) makes things clearer.

There are 4 primary actions: Show/Hide Toolbar, Update Layout, Edit Constraints and Preview. All of the features the plugin provides are available via Plugins > Fluid for Sketch.

Show/Hide Toolbar (โŒƒ + โ‡ง + T)

For convenience, the plugin provides a toolbar that floats above the current document, giving you quick access to all of the above actions.

Toolbar

Edit Constraints (โŒƒ + โ‡ง + C)

Constraint Inspector

This option shows the Constraint Inspector popup. Here you can edit all of the constraints for the currently selected layer.

Next to each section (Align, Fixed Size and Pinning) is a dropdown button. Pressing it opens a menu where you can set relativity:

Constraint Inspector Relativity

Update Layout (โŒƒ + โ‡ง + L)

Adjusts the layers in the current artboard to reflect your constraints.

Preview (โŒƒ + โ‡ง + P)

Preview Mode

Opens a window that allows you to preview the currently selected artboard at different sizes (Mobile, Tablet, Desktop). See notes for more info.

Additional Notes

Preview Mode

Preview Mode is rather limited at this time, as it only allows you to preview artboards at a preset number of sizes: Mobile, Tablet and Desktop. Expanding it to include more presets, custom sizes, zooming and more are WIP.

Width & Height

If you have Fixed Width or Fixed Height checked, and leave the value blank, the plugin will lock the width or height to whatever the current height or width is in Sketch. This is useful in some cases where you want to ensure the height and width do not change. Less useful for groups, where the height and width are equal to the content (see 'Groups' below)

Groups

Since the width and height of Groups in Sketch are dependent on their sub-layers, this plugin does not actually resize the height or width of a group, as that would distort the layers within it. Rather, it simulates that sizing when calculating the geometry of sub-layers.

Symbols

It's worth noting that while constraints you set on a Symbol itself will not propagate to other instances of that Symbol, any constraints you set on its sub-layers will.

Text

If you set the width of a text layer but not its height, the plugin will set the height of the text layer to the height of the text after reflow.

Proportions (Aspect Ratio Sizing)

In order to acheive this, the easiest way is to use the aspect ratio lock in Sketch's Layer Inspector, and set your constraints to change width or height.

Contact

If you have any questions, comments, become attacked by technical bugs, or have ideas to improve the plugin, ping us on twitter: @matt_sven and @imcatnoone.

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.