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

@zaydek/sorcery

v0.4.8

Published

Sorcery SCSS is a stack-based CSS framework. Contributions are welcome as issues and or pull requests.

Downloads

4

Readme

@zaydek/sorcery

Sorcery SCSS is a stack-based CSS framework. Contributions are welcome as issues and or pull requests.

To get started, simply run this command:

yarn add @zaydek/sorcery
# or npm i @zaydek/sorcery

Usage:

import "@zaydek/sorcery"

function Component() {
	return (
		<div className="hstack">
			<div className="hstack space-16">
				<div className="w-32 h-32 bg-gray-100 rounded-full" />
				<div className="w-32 h-32 bg-gray-100 rounded-full" />
			</div>
			<div className="spacer" />
			<div className="hstack space-16">
				<div className="w-32 h-32 bg-gray-100 rounded-full" />
				<div className="w-32 h-32 bg-gray-100 rounded-full" />
			</div>
		</div>
	)
}

Usage: (CDN)

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Hello, world!</title>
		<link rel="stylesheet" href="https://unpkg.com/@zaydek/sorcery/dist/index.min.css" />
	</head>
	<body>
		<div class="hstack">
			<div class="hstack space-16">
				<div class="w-32 h-32 bg-gray-100 rounded-full"></div>
				<div class="w-32 h-32 bg-gray-100 rounded-full"></div>
			</div>
			<div class="spacer"></div>
			<div class="hstack space-16">
				<div class="w-32 h-32 bg-gray-100 rounded-full"></div>
				<div class="w-32 h-32 bg-gray-100 rounded-full"></div>
			</div>
		</div>
	</body>
</html>

Table of Contents

Stack-Based Layouts

Stacks are inspired by Swift UI and Jon Q’s talk about implementing Swift UI stacks in CSS.

What are stack-based layouts? Instead of thinking in terms of Flexbox, think in terms of stacks. A stack simply describes a horizontal or vertical axis, and stacks compose a layout. It’s turtles all the way down, for stacks. 🐢🐢

Why stacks? Stacks are a more natural way of thinking about layout. The trouble with Flexbox is that you need to remember display, flex-direction, justify-content, align-items, and flex, and remember how these properties change in the context of flex-direction: row and flex-direction: column. Stacks are a much more simple but powerful primitive for describing layout that is based on Flexbox.

This is a microcosm of how Sorcery works:

.hstack {
	display: flex;
	flex-direction: row;
	justify-content: center;
}
.hstack > * + * {
	margin-top: 0;
	margin-left: var(--space, 0);
}

.vstack {
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.vstack > * + * {
	margin-left: 0;
	margin-top: var(--space, 0);
}

.spacer {
	flex: 1 0 var(--space, 0);
}
  • hstacks implements a horizontal stack. Think flex-direction: row.
  • vstacks implements a vertical stack. Think flex-direction: column.
  • spacers implements direction-agnostic spacers. Think flex: 1.

Stacks in Sorcery are easy to reason about because they manage Flexbox for you. 💡 Furthermore, Sorcery stacks cover edge cases such as every stack resets --space and spacers shrink to --space (unless they are the start or end element). This enables you to think declaratively without worrying about implementation details or corner cases.

Utility-First Classes

TODO

Zero-Configuration

TODO

Introspection

TODO

License

Licensed as MIT.