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

trichotomy

v1.0.8

Published

Nested layout composition using a Trichotomy Principle

Downloads

33

Readme

Trichotomy

Nested Layout Composition Using a Trichotomy Principle.

Website (including examples)

Getting Started

This package is to be deployed as a single CSS file. However, if you plan on forking it, or in any other way make changes to it, these instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

No prerequisites required.

Installing

Install like you would any npm module:

npm install trichotomy@latest

Import the trichotomy.css (or trichotomy.min.css) from your node_modules/trichotomy/dist into your project as you'd normally import any of your CSS assets.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the ISC License - see the LICENSE.md file for details

Acknowledgments

  • Mother nature, for providing the model
  • Human nature, for providing the abstraction

The Concept

We often divide things into three parts when we conceptualize about them.

House: Foundation, storeys, roof.

Tree: Roots, trunk, branches.

Arbitrary stretch in space: Front, middle, back; or time: Begining, middle, end.

This conceptual pattern arises even when the three parts are not readily identifiable. For instance, for a window opening we get the upper rail, window panes, and stool. The first and last elements can be easily discarded, conceptually, because the window panes are what really defines a window, but they are there nevertheless, even if mostly hidden.

In UI design, there is the classic trichotomy of the interface:

Header, Center(piece), Footer

Simpler UIs have to use this pattern only once, at the top level: the app's shell, its main layout. But as the UI gets more complex, there arises a need to repeat this pattern, over and over. Think DAW interfaces that can get pretty complex.

Therefore it would be useful to define an implementation of this concept/pattern into web design, using current technologies, based on these principles:

  • Most non-trivial layouts require separation into well-defined regions.
  • Most separation can be achieved by trichotomy (the classic header-body-footer combo).
  • Trichotomies can be composed and merged, giving the concept a fractalic nature, which obliges any possible implementation to remain simple, and gain complexity by repetition, not special cases.

This implementation

It's nothing new. But it brings to the table a few advantages: utmost simplicity while retaining meaning in relation to the underlying concept; scalability; disregard of all else but the underlying concept, including prettiness - that is the concern of the frontend library you may chose for the task.

Any consumer may simply import trichotomy.css and use the container classes (.trichotomy, .vertical, .horizontal) and the .centerpiece class. The rest takes care of itself by the magic of flex. The implementation does not rely on any framework, it's pure HTML5/CSS3. This should make it play nice with all frontend frameworks (Bootstrap, Semantic UI, etc.), the use of which I actually encourage along with this is, in fact, encouraged.

Caveats

Dynamic functionality, some of the actual sizing, obviously the final styling, are all the responsibility of the consumer.

TODO

  • Define and solve horizontal overlays, which would cover the case of dynamic hiding of headers/footers.
  • Offer build and installation instructions.
  • More complex examples.
  • Offer ready-made HTML templates.
  • Complex integrations: Bootstrap 4 and Angular/React as a turnkey solution for fundamental layout needs.