Socket
Book a DemoInstallSign in
Socket

yons

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yons

An atomic CSS library with glamor under the hood

3.1.0
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

YONS

Iestyn's atomic, functional, CSS-in-JS library

Atomic: Each rule defines one (or very few) styles, which you then compose together to create the UI you want. Instead of .button or .my-cool-component or .i__love--bem classnames, you have .fg_white (which sets the foreground to white), or .pam (which sets medium padding on each axis of the element) etc.

Functional: Forget about the cascade, forget about side effects. Yons classnames do what they say on the tin and nothing else.

CSS-in-JS: Uses glamor under the hood, so doesn't have all the issues of inline-styles. Writing a web app without using JavaScript? This library ain't for you.

Example

import React from 'react';
import c from 'classnames';

import y from 'yons';

// React
const FooBar = () => (
  <div className={c(y.bg_black, y.fg_white)}>
    White text on black!
  </div>
);

// Or not
document.body.className = c(y.b,y.ttu,y.f1,y.fg_green)
// now your body tag will be bold, uppercase, massive, and green

Installing

Install with yarn (or npm if that's what you fancy).

You also need to install glamor as it's a peerDependancy of this module (this is because glamor must be used as a singleton).

$ yarn add yons
$ yarn add glamor

What's in the box?

Take a look inside the src folder. It's all pretty self-documenting.

Of particular note are skin.js (for setting colours of stuff) and spacing.js (for setting margins and padding).

FAQs

Package last updated on 20 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.