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

reta

v0.3.0

Published

Type less, style more

Downloads

6

Readme

reta

A very happy marriage between tachyons-css and react – type less, more style.

Warning this is work on progress and not used in production anywhere, tread carefully!

Why?

Styling with react tends to be quite a strain on a typical keyboard. So many special characters. And a lot of boilerplate-y code. Let's learn from the atomic css movement. tachyons is a great example of how to be very expressive with very little code. An experience that promises a big productivity boost once you've learned its syntax.

reta takes this approach even further. Rather than using classNames to describe the style of your component, simply use attributes. So much leaner in react land!

Example code

/* index.css */
@import '~reta/loader!reta/defaults'
// component.js
import B from reta

const Col = props => <B flex flexColumn {...props}/>

const Media = ({img, children}) => (
  <Col pa3 bgWashedBlue hoverLightBlue flexRowNs>
    <B component="img" src={img} alt="media" w30 mr3/>
    <B flex-auto f5 white80>{children}</B>
  </Col>
)

Features

  • media queries via customisable suffixes: <B pa3 pa5Md/>
  • hover, active, focus states via prefixes: <B blue hoverDarkBlue/>
  • makes it quite easy to combine it with your preferred styling approach
  • support for server side rendering
  • Overwritable defaults for colors, scales, etc
  • Support for camelCase and kebabCase: <B bg-dark-green/> and <B bgDarkGreen/>
  • Extremely performant since all the work is done on compile time. The runtime simply sets class names on your components.

Use your custom colours or scales

mystyle.js

import defaultOpts from 'reta/defaults'
import rulesBuilder from 'reta/rules-builder'
import componentBuilder from 'reta/component-builder'

const opts = {
  ...defaultOpts,
  colors: {
    ...defaultOpts.colors,
    brand: '#aa6633',
    light-brand: '#ffee55',
  },
  mediaQueries: {
    xs: 'screen and (min-width: 0)',
    sm: 'screen and (min-width: 576px)',
    md: 'screen and (min-width: 768px)',
    lg: 'screen and (min-width: 992px)',
    xl: 'screen and (min-width: 1200px)'
  },
}

export default componentBuilder(rulesBuilder(opts)))
import B from './mystyle'

const Component = () => (
  <B pa1Xs pa3Md bgBrand hoverBgLightBrand/>
)

Contribute

  • clone the repo
  • npm install && cd samples && npm install
  • for running the sample project: cd samples && npm run dev and open http://localhost:8080/

License

ISC