GithubHelp home page GithubHelp logo

brick-layout's Introduction

brick-layout

A Brick layout component.

Demo

Check it live!

Usage

  1. Import Web Components polyfill:

    <script src="bower_components/platform/platform.js"></script>
  2. Import Custom Element:

    <link rel="import" href="src/element.html">
  3. Start using it:

    <brick-layout></brick-layout>

Options

Attribute Options Default Description
horizontal boolean - Use a horizontal instead of the default vertical layout.
horizontal-min-[s/m/l] boolean - Use a horizontal instead of the default vertical layout starting at a page width of 768/992/1200px.
open boolean - Open child drawer elements.
Attributes on direct child-elements Options Default Description
flex boolean - Set flex:1 for this element.
drawer boolean - use this element as a drawer. drawer can he hidden and shown by setting the show attribute.
drawer-top boolean - use this element as a drawer sliding in from the top. drawer can he hidden and shown by setting the show attribute.

All those attributes can also be set as attr-lt-[s/m/l], attr-gt-[xs/s/m] and attr-[xs/s/m/l], for example: drawer-lt-s. Attributes declared with attr-lt-[s/m/l] are active up to the specified page width. Attribites declared with attr-gt-[xs/s/m] are active above the specified page width. Attribites declared with attr-[xs/s/m] are active at the specified page width.

Attributes on descendent elements | Options | Default | Description hide | boolean | - | Set display: none for this element.

Hide can also be used with the attr-lt-[s/m/l], attr-gt-[xs/s/m] and attr-[xs/s/m/l] pattern.

Methods

Method Parameters Returns Description
toggleDrawer() Toggle the drawer state.
openDrawer() Open the drawer.
closeDrawer() close the drawer.

Development

Brick components use Stylus to generate their CSS.

This repository comes outfitted with a set of tools to ease the development process.

To get started:

  • Install Bower & Gulp:

    $ npm install -g bower gulp
  • Install local dependencies:

    $ npm install && bower install

While developing your component, there is a development server that will watch your files for changes and automatically re-build your styles and re-lint your code.

To run the development server:

  • Run gulp server
  • Navigate to http://localhost:3001

To simply build and lint your code, run gulp build.

You can also push your code to GitHub Pages by running gulp deploy.

brick-layout's People

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.