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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@stagyra/flex-layout

v0.1.5

Published

SCSS flexbox layout utilities using responsive data attributes.

Readme

@stagyra/flex-layout

SCSS flexbox utilities using responsive data attributes. It is useful for demos, internal apps, and Angular projects that want the ergonomics of Angular Flex-Layout without runtime directives.

The package is framework-agnostic CSS. Angular is used only for this repository's demo and packaging workflow.

Install

npm install @stagyra/flex-layout

Import

Use the compiled CSS:

@import "@stagyra/flex-layout/styles/flex-layout.css";

Or import and configure the SCSS source:

@import "@stagyra/flex-layout/styles/flex-layout";
@use "@stagyra/flex-layout/styles/flex-layout" with (
  $fl-pixel-sizes: 0, 8, 16, 24, 32, 64, 128, 256, 512,
  $fl-responsive-pixel-sizes: 0, 8, 16, 24, 32, 64, 128, 256, 512,
  $fl-gap-sizes: 1, 2, 4, 8, 12, 16, 20
);

Layout

<div data-layout="row wrap center p-stretch" data-gap="16px">
  <div data-flex="w50%" data-flex-xs="w100%">Left</div>
  <div data-flex="w50%" data-flex-xs="w100%">Right</div>
</div>

Attribute API

| Attribute | Example | Description | | --- | --- | --- | | data-layout | row wrap center p-center | Enables flex layout, direction, wrap, main-axis, and cross-axis alignment. | | data-layout-{breakpoint} | data-layout-xs="column" | Overrides layout on a responsive breakpoint. | | data-layout-align | space-between p-stretch | Applies alignment without changing direction. | | data-flex | w50%, w320px, auto, basis | Controls an item basis, width, height, growth, shrink, or self alignment. | | data-flex-{breakpoint} | data-flex-lt-md="w100%" | Overrides flex item behavior by breakpoint. | | data-gap | 16px, custom | Applies native flex gap. Use custom with --fl-gap. | | data-offset | w25%, w24px | Applies margin-left. | | data-fill | empty attribute | Sets width and height to 100%. | | data-hide | empty, true, false | Hides when present unless value is explicitly false. | | data-hide-{breakpoint} | data-hide-lt-md | Hides only inside a breakpoint. |

Directions

  • row
  • row-reverse
  • column
  • column-reverse

Main-Axis Alignment

  • start
  • center
  • end
  • space-between
  • space-around
  • space-evenly

Cross-Axis Alignment

Prefix cross-axis values with p-:

  • p-start
  • p-center
  • p-end
  • p-stretch
  • p-baseline
  • p-space-between
  • p-space-around
  • p-space-evenly

Wrap

  • wrap
  • nowrap
  • wrap-reverse

Breakpoints

| Suffix | Media query | | --- | --- | | xs | max-width: 599.98px | | sm | 600px - 959.98px | | md | 960px - 1279.98px | | lg | 1280px - 1919.98px | | xl | min-width: 1920px | | gt-xs | min-width: 600px | | gt-sm | min-width: 960px | | gt-md | min-width: 1280px | | gt-lg | min-width: 1920px | | lt-sm | max-width: 599.98px | | lt-md | max-width: 959.98px | | lt-lg | max-width: 1279.98px | | lt-xl | max-width: 1919.98px |

Size Scale

Percentage utilities include common layout sizes from w5% to w100%, including thirds (w33%, w34%, w66%, w67%).

Pixel utilities for data-flex and data-offset include even pixel values from 0px through 1024px, then every 10px from 1030px through 1920px. The responsive suffixes use the same pixel scale, so values such as data-flex-gt-md="w1440px" are generated.

Gap utilities support only 1px through 20px, plus custom.

Summary of generated size values:

| Utility | Generated values | | --- | --- | | Percent data-flex and data-offset | 5%, 10%, 15%, 20%, 25%, 30%, 33%, 34%, 40%, 45%, 50%, 55%, 60%, 65%, 66%, 67%, 70%, 75%, 80%, 85%, 90%, 95%, 100% | | Pixel data-flex and data-offset | Even values from 0px through 1024px, then every 10px from 1030px through 1920px | | Gap data-gap | Every pixel from 1px through 20px, plus custom |

For values outside the generated scale, or values that should not be generated globally, use CSS custom properties:

<div data-layout="row" data-gap="custom" style="--fl-gap: 18px">
  <aside data-flex="basis" style="--fl-basis: 340px">Filters</aside>
  <main data-flex>Results</main>
</div>

--fl-basis accepts any valid CSS size value, including 520px, 32rem, 45%, calc(100% - 280px), and clamp(280px, 32vw, 520px).

Use breakpoint-specific variables when basis is active in a responsive data-flex-* attribute:

<aside
  data-flex="basis"
  data-flex-xs="basis"
  style="--fl-basis: 320px; --fl-basis-xs: 100%"
>
  Filters
</aside>

Supported variable suffixes match the breakpoint names: --fl-basis-xs, --fl-basis-sm, --fl-basis-md, --fl-basis-lg, --fl-basis-xl, --fl-basis-gt-xs, --fl-basis-gt-sm, --fl-basis-gt-md, --fl-basis-gt-lg, --fl-basis-lt-sm, --fl-basis-lt-md, --fl-basis-lt-lg, and --fl-basis-lt-xl.

Each breakpoint variable falls back to --fl-basis, then to auto.

Reducing CSS in Consumer Apps

Do not run PurgeCSS while building this package, because the package cannot know which utilities a consuming application will use. Run PurgeCSS in the final application build instead, scanning that application's templates and TypeScript files.

Example PurgeCSS configuration:

import { PurgeCSS } from 'purgecss';

const results = await new PurgeCSS().purge({
  content: [
    './src/**/*.{html,ts}',
    './projects/**/*.{html,ts}',
  ],
  css: [
    './node_modules/@stagyra/flex-layout/styles/flex-layout.css',
  ],
  defaultExtractor: (content) =>
    content.match(/[A-Za-z0-9_:%./#()[\]-]+/g) || [],
});

If your app builds attribute values dynamically, safelist the generated patterns that cannot be found as literal strings:

safelist: {
  greedy: [
    /data-layout/,
    /data-flex/,
    /data-gap/,
    /data-offset/,
    /data-hide/,
  ],
}

For best results, prefer literal template values such as data-flex-gt-md="w1440px" when possible. Literal values let PurgeCSS keep only the utilities actually used by the application.

Publish

Build first:

npm run build:lib

Publish manually from the generated package:

cd dist/flex-layout
npm publish --access public