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

@tobi2409/layout

v0.5.0

Published

Tiny CSS frame layout using named grid areas and the --align property

Readme

Layout

A small Delphi-like layout system based on CSS Grid.

The idea: a container with .frame defines fixed areas such as top, left, client, or bottom. Child elements are assigned to an area through the CSS custom property --align.

Goal

The system is meant to enable simple, readable user interfaces without scattering many utility classes throughout the HTML.

Example:

<div class="frame">
	<header style="--align: top;">Header</header>
	<nav style="--align: left;">Navigation</nav>
	<main style="--align: client;">Inhalt</main>
	<aside style="--align: right;">Inspector</aside>
	<footer style="--align: bottom;">Footer</footer>
</div>

Usage

Include layout.css:

<link rel="stylesheet" href="layout.css">

Then create a container with .frame and place its direct child elements using --align.

Supported align values

Horizontal / vertical

  • top
  • top-2
  • top-3
  • top-4
  • top-5
  • left
  • left-2
  • left-3
  • left-4
  • left-5
  • client
  • right
  • right-2
  • right-3
  • right-4
  • right-5
  • bottom
  • bottom-2
  • bottom-3
  • bottom-4
  • bottom-5

client is the flexible main area and uses the remaining space.

Basic principle

  • top... and bottom... occupy full rows.
  • left... and right... occupy columns next to the content.
  • client is placed in the center.
  • Multiple .frame containers can be nested.

Nesting example

<div class="frame" style="height: 300px;">
	<header style="--align: top;">Header</header>

	<main class="frame" style="--align: client;">
		<div style="--align: top;">Toolbar</div>
		<section style="--align: client;">Inhalt</section>
		<div style="--align: bottom;">Status</div>
	</main>
</div>

When this works well

Suitable for:

  • app layouts
  • admin interfaces
  • classic desktop-like UI structures
  • clearly separated areas such as header, sidebar, content, and footer

When to combine it with something else

For dynamic lists or freely flowing rows, .frame is not the best level of abstraction. In those cases, a combination is usually better:

  • .frame for the coarse page structure
  • Flexbox for lists, toolbars, or rows
  • position: absolute for overlays or freely positioned elements

Possible future direction

It might be worth considering a switch from CSS Grid to Flexbox as the underlying model:

  • top / bottomflex-direction: column (children stack vertically)
  • left / rightflex-direction: row (children stack horizontally)

This would naturally handle multiple children with the same alignment without overlapping, and without needing levels like top-2 or left-3. Dynamic lists and reordering would also become easier. The trade-off is that the current single-class approach with --align would need to be rethought, since Flexbox distributes all children at once rather than placing them into named areas.

Limitations

  • Multiple elements with exactly the same --align overlap.
  • That is why there are levels such as top-2 or left-3.
  • The number of levels is currently intentionally limited to 5 per direction.

Files