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

patchwork-app

v0.2.0

Published

Patchwork is a responsive CSS framework using the benefits of HTML5's Flexbox.

Downloads

25

Readme

Patchwork

Travis   npm   License MIT   Experimental

  • Bower: bower install patchwork-app

Getting Started

Patchwork uses CSS Flexbox to create a convenient CSS framework that leverages the order property with a responsive approach.

You may well have been asked to re-order elements for different viewports – and this is where Flexbox — and of course Patchwork — excel!

As an example, consider the following markup which positions two elements adjacent to one another with equal widths:

<section class="patchwork">

    <section class="column first" data-patchwork="large-size: 1">
        First
    </section>

    <section class="column second" data-patchwork="large-size: 1">
        Second
    </section>

</section>

When viewing on a tablet you may well be asked to place the second section above the first section; in days gone by this would have required a little JavaScript, but with Flexbox — and Patchwork — you can simply apply the following:

<section class="patchwork">

    <section class="column first" data-patchwork="large-size: 1">
        First
    </section>

    <section class="column second" data-patchwork="large-size: 1, medium-order: -1">
        Second
    </section>

</section>

Width Enforcement

Consider the following HTML markup:

<section class="patchwork">

    <section class="column first" data-patchwork="large-size: 1">
        First
    </section>

    <section class="column second" data-patchwork="large-size: 11">
        Second
    </section>

    <section class="column third" data-patchwork="large-size: 12">
        Third
    </section>

</section>

In cases like this, due to the nature of the Flexbox implementation, the third column will attempt to be squeezed into the remaining space. However, there are times when you want the third column to take up another column in a 12 column layout – for this you can append an exclamation symbol to the large-size property – this will cause the third column to wrap onto the next line:

<section class="patchwork">

    /* ... */

    <section class="column third" data-patchwork="large-size: 12!">
        Third
    </section>

</section>

Element Break

With Flexbox it's not easy to force a break in the content – that is why Patchwork provides a convenient method for doing so. Simply add an element to your HTML with large-size: break and/or medium-size: break — the element itself won't be displayed, but it will wrap your content:

<section class="column" data-patchwork="large-size: break, medium-size: break">

</section>

If you would like to break when large and not break when medium, then simply use the value none: large-size: break, medium-size: none

Alternative

An alternative approach to the break uses the custom HTML element patchwork-break which accepts a for attribute which determines at which sizes it breaks the content:

<patchwork-break for="large medium"></patchwork-break>

By removing the medium label, the break would not occur when the container is in its medium dimension.

Custom Build

By default Patchwork uses 16 columns with a maximum width of 960px – you can modify these defaults by opening up Options.scss and changing the necessary variables – afterwards invoke gulp build --custom to initiate a custom build that will output to dist/custom.