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

graphen

v1.10.10

Published

Graphen is a small library, that keeps reusable blocks of UI and helps making application design consistent across multiple projects.

Downloads

323

Readme

Build Status

Graphen UI library

[Documentation] [Tasks board]

About

'graphen' is a small library, that keeps reusable blocks of UI and helps making application design consistent across multiple projects.

Motivation and principles

Motivation for building graphen is to create a small, reusable and customizable UI library that will follow current best practices in the CSS world and allow to create clean and easily maintainable code.

Graphen architecture is driven by:

Namespacing

Every style or variable name are prefixed, so developer will have knowledge where from the style or variable is coming from what is its role. All variables and styles are prefixed with the following pattern: g[b|c|m|x]-<semantic name>.

  • g - responsibility of the first letter is to tells developers what is the origin of the entity (where to look when necessary) and to avoid naming collision (although probability is low)
  • b|c|x|m - the second letter tells developers what is the role of (or how to use) a particular entity
    • b - branding, variables that can be overwritten for custom styling
    • c - component (BEM block), a style that can be applied for markups (along with elements and modifiers)
    • m - BEM mix, that can apply a generic style not related with particular block or element
    • x - mixin, which can extend our custom classes

Few examples:

  • gb-color-success - variable representing a color
  • gc-component gc-component__element gc-component--modifier - few component classes
  • gm-pull-right - a mix class that allows to attach a generic class

Block Element Modifier

As mentioned above, graphen uses BEM naming convention which have two benefits, removing specificity issues and Block Element Modifier principle simplifies how to think about components and it sub-parts.

Object Oriented CSS

The last principle helps to separate component (BEM block) layouting from its skinning (BEM modifier), hence blocks when used (ex. gc-mycomponent) should have added at least default skin (ex gc-mycomponent--default). This principle helps to avoid overwriting CSS properties related with skinning (ex. color, background-color etc.) which is considered a bad practice but also reduces CSS file size.

Installation

  1. Install as npm package: npm i graphen
  2. Import style.scss (or particular components) into your project
  3. In order to build font successfully, set $c-icon-font-url to point from your project root level (ex. ~graphen/src/assets/font)

Development

In order to develop with graphen you'll need to:

  1. Clone graphen repository: git clone https://github.com/coda-it/graphen
  2. Build example app: make example
  3. Run example server in another bash window npm run example-run
  4. After development check integration tests with make integration-test

Customization

Graphen allows to customize branding variables (palette of colors and font) to fit graphical requirements of the project it's used in. In order to customize, checkout src/variables/_brand.scss for particular variables that can be overwritten.

Others

  • Name of colors are taken from here