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

@biz-storefront/hdt-scheme

v1.1.0

Published

Histogram driven themes style scheme

Downloads

8

Readme

Histogram driven themes - V2

A colour scheme inspired by photography knowledge, to make your styles remarkable, composable, accessible and "themable".

▁▁▁▁▁▂▂▂▂▂▃▃▃▃▃▅▅▅▅▅▇▇▇▇▇

brightnesshighlightmidtoneshadowdarkness + cta


Usage

We recomend to declare your variables in a style html tag inside the <head> of your document, so can be "SSRed" from any serve-side language.

<style>
:root {
    --brightness: #fff;
    --highlight: #f9f9f9;
    --midtone: #666;
    --shadow: #404040;
    --darkness: #2d2d2d;
    --cta: #da2f2f;
    --root-font: 'Lato', sans-serif;
    --root-font-2: 'Open Sans', sans-serif
}
</style>

Them import the hdt-scheme declaration to use with your preprocessor:

@import 'hdt-schemes/build/less/_variables.less'
button {
    background: @shadow;
    color: @highlight;
}

Learn more:

  • What is a histogram?
  • Why not X?

Accessible

You don't have remember to what color each variable is associated, you only have know that a button with background darkness and text color brightness will have a very intense contrast.

In the same manner it's easy to predict that a paragraph with color shadow in a darkness background would be really hard to read.

By reading a code like these, your brain will be able render the visuals, without having to leave your editor. Even a color blind developer, can understand how the visual would work, without worrying about the colour pallet.

Install

npm install hdt-scheme

Why would you use HDT?

There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton

As a project grows you can start to hate yourself when a appropriate color scheme have not being well chosen.

HDT v2 spec recommends the usage of the following abstract css vars, when developing digital products with themable capabilities: brightnesshighlightmidtoneshadowdarkness + cta

Photographers around the world have used cameras built-in and image editing software histograms features, to create visually balanced photos for years. Why not bring these concepts to web design?

What is a histogram?

A histogram can tell if a photo have too much light or too much dark elements, it empower the image producer with data to change the aspec if he wants to. A image histogram is a graph, that shows the tonal distribution in a digital image.

Usally it's represented by blacks, shadows, midtones, highlights, whites. But since we want to keep our variables abstract we have replaced blacks and whites with darkness and brightness.

Brightness and darkness are usually synonyms to white and black, but you must be able to redefine the limit of tone allowed in your theme.

Pure black like #000000 or white like #ffffff, might never be used in one of your current designs so feel free to define something like brown as your darkness and yellow as brigthness.

Why not X?

We consider the following variable naming conventions actually a bad pratices:

Numeral

color1 bg2

Freezed

purple darkBlue

Section based

headerColor footerBackground