Code Monkey home page Code Monkey logo

layin's Introduction

Layin

另外一种写栅格化系统或者布局的方法。Layin 提供两种不同的布局方式,例如普通的(Float)浮动布局,还有(Flexbox)布局的支持。

介绍

使用 Attribute 来替代 Class,实现栅格化一致的效果:
<div row>
  <div col="3">
    <div demo-box="large">3</div>
  </div>
  <div col="4">
    <div demo-box>4</div>
  </div>
  <div col="5">
    <div demo-box>5</div>
  </div>
</div>
通过 Attribute 的值来选择是否采用 Flexbox 布局方式:
<div row="flex" row-align="center center">
  <div col="3" col-order="3">
    <div demo-box="large">3</div>
  </div>
  <div col="4" col-order="2">
    <div demo-box>4</div>
  </div>
  <div col="5" col-order="1">
    <div demo-box>5</div>
  </div>
</div>
栅格化细节
  • 支持 12 栏,且不设置每一行的左右边距
  • 支持 Flex 布局,在 Flex 布局情况下,可以使用 Order 进行排序
  • 普通布局支持 Offset/Pull/Push

参数概览:

属性 解释
row null/flex
row-align start/center/end etc 对齐方式
col 1 ~ 12 一列,共12列
col-order 1 ~ 12 row 需要为 flex
col-offset 1 ~ 12
col-pull 1 ~ 12
col-push 1 ~ 12

使用

参与开发
  1. Clone this repo
  2. Npm install
  3. Gulp
直接使用

拷贝layout.css添加到自己的页面即可。

联系

123 123 123 123 123 123

layin's People

Contributors

pizn avatar

Watchers

 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.