Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

modular-grid

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modular-grid

  • 0.0.15
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Modular Grid System

Usage

  • Drop _modular.scss and the grid folder into your assets folder. Then overwrite any options and @import 'modular';.
  • Initially the grid system has six columns, you can change this in grid/_defaults.scss
  • An element's width can be defined with the classes .m1 through .m6 (m6 being 100% width).
  • To define an element's width at several resolutions you extend or use like so: .m6-3-1. The first number is the mobile width, the second is the tablet size, the last is the desktop size. So our module with .m6-3-1 will be full screen width for mobile, half screen width for tablets, and take up 1/6th width for desktop users.
  • You can also use a value of 0 to hide an element at that particular resolution.
  • In order to create a complete row you need to extend or use classes so that the total size at each resolution equals the column count. (in this case 6)
  • You can push things from the left by using the .l# or .l#-#-# classes. You can also keep rows clear by using .r# or .r#-#-#to add right margin.
  • If you want to corral the little modules and put them in a nice bucket @extend %container will give the element a nice width with good margins for the three sizes.

Example: These two divs will constitute a row at all three resolutions.

<div class="m2-4-4">
I'm 2 columns wide at mobile size, and 4 columns wide at other resolutions.
</div>
<div class="m4-2-2">
I'm 4 columns wide at mobile size, and 2 columns wide at other resolutions.
</div>

TODO

  • Create a gem for easy install.
  • Add the ability to leave off numbers and have it just assume the remaining widths are the last value
  • Work on the unrolling the loops or something to make the code more legible/faster.
  • Create Stylus and Less versions.

Attribution

This was kindly open-sourced by Groopt Inc. in October of 2013.

FAQs

Package last updated on 01 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc