Giter VIP home page Giter VIP logo

speedgrid.js's Introduction

micro-library for CSS Flexbox and CSS Grid

more details --> https://toshihidemiyake.github.io/SpeedGrid/

Overview

SpeedGrid dynamically generates inline CSS by specifying the class name.

  • Easy maintenance --CSS Flexbox and CSS Grid layout can be changed without editing CSS.
  • Super-Lightweight--SpeedGrid is just 4KB.(minified one is 3KB)
  • Rapid layout experience--You can use the Flexbox&Grid system intuitively.
  • Usage

    Flexbox

    Describe the class name in the container.
    Class names should be created by combining flex, xxx, and yyy.
    Each of them have to be connected with -.

    flex--corresponds to display:flex;.
    xxx --corresponds to justify-content.
    yyy--corresponds to align-items.

    XXX YYY
    strings CSS strings CSS
    left- justify-content:flex-start; -top align-items:flex-start;
    center- justify-content:center; -middle align-items:center;
    right- justify-content:flex-end; -bottom align-items:flex-end;
    between- justify-content:space-between;
    around- justify-content:space-around;
    evenly- justify-content:space-evenly;

    If you write the class name in the container like <div class="flex-center-middle"></div>, the actual output will look like this:

    <div class="flex-center-middle" style="display: flex; justify-content: center; align-items: center;"></div>

    ※It is also possible to specify only one of flex or flex-xxx or flex-yyy.


    Grid

    Describe the grid area with grid lines of the X and Y axes, as the class name in child elements. Grid-start and grid-end are specified with a slash. Whitespace before and after the slash is not required. You have to do the work of setting up the display:grid; and grid tracks for the container by yourself. Gridlines must be less than 10.



    If you write the class name in the child elements like <div class="grid-x-2/4 grid-y-3/4"></div>, the actual output will look like this:

    <div class="grid-x-2/4 grid-y-3/4" style="grid-area: 2 / 3 / 4 / 4;"></div>

    gap

    You can specify the gap property for Flexbox and Grid. The easiest way to use this is to simply specify gap-nn (nn=number) in the class name. You can also specify each gap for the horizontal and vertical axes by using the prefix gapx-,gapy-. You can use px, %, or em as the unit. px is used by default, but you can specify the unit by adding per or em between gap- and -nn.

    Simple Usage

    gap-nn (nn=number)

    Options

  • gapx-nn
  • gapy-nn
  • gap-per-nn
  • gapx-per-nn
  • gapy-per-nn
  • gap-em-nn
  • gapx-em-nn
  • gapy-em-nn

  • more details --> https://toshihidemiyake.github.io/SpeedGrid/
    support -->Buy me a coffee

    speedgrid.js's People

    Contributors

    toshihidemiyake avatar

    Stargazers

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