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

flexya

v1.10.2

Published

Flexya is a super simple CSS grid system based on flex and heavily inspired by Bootstrap's grid system.

Downloads

14

Readme

Flexya

Flexya is a super simple CSS grid system based on flex and heavily inspired by Bootstrap's grid system.

It features a configurable amount of columns, a configurable grid-based implementation and easy-to-modify breakpoints.

Installation

npm i flexya

Usage

To include Flexya, just import the flexya.scss file in your SCSS.

@import "variables";
@import "~flexya/src/flexya.scss";

Helpers

Flexya ships with some helpful mixins to help keep your code maintainable.

breakpoint-up($breakpoint)

A mixin media query that applies for the given breakpoint and above.

@include breakpoint-up("desktop") {
    .row {
        color: red;
    }
}

Translates into:

@media (min-width: 1200px) {
    .row {
        color: red;
    }
}

breakpoint-down($breakpoint)

A mixin media query that applies for the given breakpoint and below.

@include breakpoint-down("desktop") {
    .row {
        color: red;
    }
}

Translates into:

@media (max-width: 1199.99px) {
    .row {
        color: red;
    }
}

breakpoint-only($breakpoint)

A mixin media query that applies only for the given breakpoint.

@include breakpoint-only("desktop") {
    .row {
        color: red;
    }
}

Translates into:

@media (min-width: 1200px) and (max-width: 1399.99px) {
    .row {
        color: red;
    }
}

breakpoint-between($lowerBreakpoint, $upperBreakpoint)

A mixin media query that applies only between the two given breakpoints.

@include breakpoint-between("tablet", "desktop") {
    .row {
        color: red;
    }
}

Translates into:

@media (min-width: 768px) and (max-width: 1199.99px) {
    .row {
        color: red;
    }
}

Breakpoint Modes

All of the breakpoints above support a mode argument as the second (or third in the case of breakpoint-between) argument which allows you to define if rules should only apply for touch enabled or non-touch enabled devices. If this argument is omitted, default styling will apply.

@include breakpoint-up("desktop", "touch") {
    .row {
        color: red;
    }
}
@include breakpoint-up("desktop", "notouch") {
    .row {
        color: blue;
    }
}

Translates into:

@media (min-width: 1200px) and (hover: none) and (pointer: coarse) {
    .row {
        color: red;
    }
}
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) {
    .row {
        color: blue;
    }
}

Customization

Changing the breakpoints

You can alter any of the breakpoints used by Flexya as well as the class names generated by adding the following to your SCSS file before importing Flexya:

// Breakpoints
$breakpoints: (
    "mobile":           ("min-width": 0,      "prefix": false),
    "large-mobile":     ("min-width": 576px,  "prefix": "lm"),
    "tablet":           ("min-width": 768px,  "prefix": "t"),
    "landscape-tablet": ("min-width": 992px,  "prefix": "lt"),
    "desktop":          ("min-width": 1200px, "prefix": "d"),
    "large-desktop":    ("min-width": 1400px, "prefix": "ld")
);

// Base column class name
$columnClass: "col";

// Base offset class name
$offsetClass: "offset";

You are welcome to rename any of the breakpoints, as well as the prefixes as these will correctly update the next time you build your CSS. You can also add or remove breakpoints as you see fit!

Changing the column count

Need more columns, or want to remove some to reduce file size? Simply include the following above where you import Flexya.

// How many columns to put into .row and .grid
$columnCount: 12;

Enable CSS Grid

Want to use the CSS grid? Enable it with the following:

// Enable grid class generation
$enableGrid: true;

Note that CSS grid is disabled by default.

Utilities

Utilities are useful classes that you can generate to provide you with handy, breakpoint specific layout functions throughout your project. You can add a utility by modifying the $utilities map before including flexya:

$utilities: (
    "text-align": (
        property: text-align,
        class: text,
        values: (
            start:  left,
            end:    right,
            center: center
        )
    )
);

This utility system replaces the one that was previously present in v1.6.0 and below.