Giter Site home page Giter Site logo

swiss's Introduction

Swiss

A simple tool for calculating layout grid dimensions.

swiss_calc

Calculates a grid that will fit within a given space. Give swiss the number of columns, the space the layout grid must fit within, and a ballpark gutter. Swiss will find you a grid to fit these constraints.

Example:

$ swiss_calc 12 1024 34 --include_outer
Width: 950.0
Total: 1018.0
Gutter: 34.0
Columns: 48.0, 130.0, 212.0, 294.0, 376.0, 458.0, 540.0, 622.0, 704.0, 786.0, 868.0, 950.0

You can use the --unit flag to specify an underlying grid unit. For example, if you specify 8, the grid generated will cleanly fit on top of an 8px grid.

$ swiss_calc 12 1024 34 --include_outer --unit 8
Width: 928.0
Total: 992.0
Gutter: 32.0
Columns: 48.0, 128.0, 208.0, 288.0, 368.0, 448.0, 528.0, 608.0, 688.0, 768.0, 848.0, 928.0

Note that when unit is specified, gutter may be adjusted to conform to unit.

Install

Requirements:

  • Python 2.x+

Install using pip:

git clone https://github.com/gordonbrander/swiss.git
cd swiss
pip install -e .

Or just use directly:

./swiss.py 12 1024 32

swiss's People

Contributors

gordonbrander avatar

Watchers

 avatar  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.