Coder Social home page Coder Social logo

ryanve / flexboxes Goto Github PK

View Code? Open in Web Editor NEW
31.0 2.0 4.0 112 KB

CSS flexbox framework with pure flexbox grid ability

Home Page: https://ryanve.github.io/flexboxes

License: BSD Zero Clause License

CSS 38.29% HTML 61.71%
css flexbox grid-system flex grid grids functional-css layout layouts

flexboxes's Introduction

flexboxes

flexboxes is a functional flexbox library and pure flexbox grid system designed for prototyping and production.

setup

Download flexboxes.css and load stylesheet

<link rel="stylesheet" href="flexboxes.css">
  • .flex-inline for inline-flex
  • .flex-block for flex
  • .flow-east for row
  • .flow-west for row-reverse
  • .flow-south for column
  • .flow-north for column-reverse
  • .flow-over for nowrap
  • .flow-wrap for wrap
  • .flow-warp for wrap-reverse

Distribute free space via auto margins

  • .free-all frees all
  • .free-top frees top
  • .free-bottom frees bottom
  • .free-left frees left
  • .free-right frees right
  • .free-north frees block-start
  • .free-south frees block-end
  • .free-west frees inline-start
  • .free-east frees inline-end
  • .order-before
  • .order-after
  • .items-start
  • .items-end
  • .items-center
  • .items-baseline
  • .items-stretch
  • .self-center
  • .self-baseline
  • .self-stretch
  • .self-start
  • .self-end
  • .just-start
  • .just-end
  • .just-center
  • .just-between
  • .just-around
  • .pack-start
  • .pack-end
  • .pack-center
  • .pack-between
  • .pack-around
  • .pack-stretch

Shorthand classes supply common presets

  • .flex-fade for 0 1 auto aka shrinkable
  • .flex-fame for 1 0 auto aka growable
  • .flex-auto for 1 1 auto aka flexible
  • .flex-none for none aka inflexible

Compose with grow shrink basis

  • .grow-0
  • .grow-1
  • .grow-2
  • .grow-3
  • .grow-4
  • .grow-5
  • .grow-6
  • .grow-8
  • .grow-7
  • .grow-9
  • .grow-10
  • .grow-11
  • .grow-12
  • .shrink-0
  • .shrink-1
  • .shrink-2
  • .shrink-3
  • .shrink-4
  • .shrink-5
  • .shrink-6
  • .shrink-7
  • .shrink-8
  • .shrink-9
  • .shrink-10
  • .shrink-11
  • .shrink-12
  • .basis-0 0/12 grid
  • .basis-1 1/12 grid
  • .basis-2 2/12 grid
  • .basis-3 3/12 grid
  • .basis-4 4/12 grid
  • .basis-5 5/12 grid
  • .basis-6 6/12 grid
  • .basis-7 7/12 grid
  • .basis-8 8/12 grid
  • .basis-9 9/12 grid
  • .basis-10 10/12 grid
  • .basis-11 11/12 grid
  • .basis-12 12/12 grid
  • .basis-100vw
  • .basis-100vh
  • .basis-100vmax
  • .basis-100vmin
  • .basis-golden
  • .basis-content
  • .basis-auto

area

Some flexbugs are solvable via min or max width or height

  • .area-min sets both mins to 0 re: nesting
  • .area-max sets both maxes to 100%

Consider area.css for more

@media

Responsive orientation classes are available for flex-flow and display classes. Append @portrait or @landscape to these classes to limit them to that orientation. This affords layouts that flow or wrap differently based on viewport orientation or layouts that only flex in one orientation. Try the #fitting example in both portrait and landscape to see how it adapts. You can do this on a phone by rotating the phone or on a computer by resizing the browser window.

class="flex-block flow-west@portrait flow-north@landscape"

portrait

  • flow-east@portrait
  • flow-west@portrait
  • flow-south@portrait
  • flow-north@portrait
  • flow-over@portrait
  • flow-wrap@portrait
  • flow-warp@portrait
  • flex-inline@portrait
  • flex-block@portrait

landscape

  • flow-east@landscape
  • flow-west@landscape
  • flow-south@landscape
  • flow-north@landscape
  • flow-over@landscape
  • flow-wrap@landscape
  • flow-warp@landscape
  • flex-inline@landscape
  • flex-block@landscape

examples

ryanve.github.io/flexboxes

flexboxes's People

Contributors

ryanve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flexboxes's Issues

violet png

1280x1280

violet

![violet](https://user-images.githubusercontent.com/949985/82156190-d745d780-9847-11ea-9e78-ae29d8741cac.png)

Media Queries

Interesting library. Is there any plan to add additional media queries for different device sizes, in addition to the current portrait and landscape ones that don't specify device size?

Media query classes syntax

Which syntax is more intuitive?

portrait-

<div class="flex portrait-flex-wrap">
  <div class="flex-auto basis-6">1</div>
  <div class="flex-auto basis-6">2</div>
  <div class="flex-auto basis-6">3</div>
  <div class="flex-auto basis-6">4</div>
</div>

@portrait

<div class="flex flex-wrap@portrait">
  <div class="flex-auto basis-6">1</div>
  <div class="flex-auto basis-6">2</div>
  <div class="flex-auto basis-6">3</div>
  <div class="flex-auto basis-6">4</div>
</div>

Examples

Example website would be good ;)

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.