npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wolox/layout

v0.0.1

Published

Wolox generic layout for frontend projects

Downloads

1

Readme

Wolox Layout

circle-ci npm

FEArmy

Features

  • separations.scss file contains all the margin class generators for your own stylesheet.
  • layout.scss contains a series of classes that can be used to define a page's layout using flexbox.

Installation

  1. intall the package with npm or yarn

npm

npm i wolox-layout

yarn

yarn add wolox-layout
  1. Import the wolox-bootstrap.scss to have margins, and layout all toghether. Or you can import them separately if needed.
@import '~wolox-bootstrap/wolox-bootstrap';
 // or
@import '~wolox-bootstrap/layout';
@import '~wolox-bootstrap/separations';

Usage

General import of Wolox-boostrap

This will generate a series of classes based on the default minimum (0), maximum (200px) and scale (10px) that looks like this:

.m-0 { margin: 0; }
.m-1 { margin: 10px; }
...
.m-20 { margin: 200px; }

.m-top-0 { margin: 0; }
.m-top-1 { margin: 10px; }
...
.m-top-20 { margin: 200px; }

@media (max-width: 960px) {
.m-top-0-sm { margin: 0; }
.m-top-1-sm { margin: 10px; }
...
.m-top-20-sm { margin: 200px; }
}

// And so on for every type of margin from 0 to 200px.

### Variable overriding

These are the variables you can override to create new styles:

  • $media-breakpoint: 960px !default;: This variable is used to define the breakpoint of the autogenerated flex properties.
  • $max-item-size: 3 !default;: This is the max value de flex prop can take inside the item- class
  • $max-order-size: 3 !default;: This is the max value de order prop can take inside the order- class
  • $min-value: 0 !default;: This is the min value for margins
  • $max-value: 200 !default;: This is the max value for margins
  • $scale: 10 !default;: This is the increment value for the min and max values for margins
  • $suffix-sm: 'sm' !default;: This is the suffix the class will have for responsive
  • $breakpoint: 960 !default;: This will be the width breakpoint for responsive classes

Layout API interface

To generate a flexbox layout you can do:

<div class="column middle">...</div>

<!-- this is the equivalent to: -->
.my-custom-class {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

In summary, for vertical alignment we use top, middle, bottom and for horizontal alignment: start, center, end.

| Column | Class name | | :------------ |:---------------:| | align-items: center | column center | | align-items: flex-end | column end | | align-items: flex-start | column start | | justify-content: center | column middle | | justify-content: flex-end | column bottom | | justify-content: flex-start | column top | | justify-content: space-between | column space-between | | justify-content: space-around | column space-around |

| Row | Class name | | :------------ |:---------------:| | align-items: center | row middle | | align-items: flex-end | row bottom | | align-items: flex-start | row top | | justify-content: center | row center | | justify-content: flex-end | row end | | justify-content: flex-start | row start | | justify-content: space-between | row space-between | | justify-content: space-around | row space-around |

For responsive classes (using 960px as the default breakpoint) append -sm suffix to the class.

<div class="row space-between space-around-sm">
  ...
</div>

#### Order and flex value This generator also creates clases to manipulate order and flex properties.

@for $i from 1 through 3 {
  .order-#{$i} {
    order: $i;
  }
}

This snippet will create this classes

.order-1 { order: 1 }
.order-2 { order: 2 }
.order-3 { order: 3 }

And for flex:

.item-1 {
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.item-2 {
  min-width: 0;
  min-height: 0;
  flex: 2;
}

.item-3 {
  min-width: 0;
  min-height: 0;
  flex: 3;
}

About

This project is maintained by Francisco Iglesias and it was written by Wolox.

Wolox