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

react-be-blaze

v1.3.0

Published

A tiny React wrapper for Blaze components.

Downloads

3

Readme

react-be-blaze · NPM version · Standard - JavaScript Style Guide · Dependencies · Peer Dependencies Build Status · License: MIT

TL;DR;

react-be-blaze is a tiny React wrapper for BlazeCSS components.

Check out the demo! :warning: UNDER CONSTRUCTION :warning:

Intro

BlazeCSS is, as written on their website at the time of writing, an “ open source modular CSS toolkit providing great structure for building websites quickly ”.

In my opinion, this toolkit — or framework, take your pick — has a great advantage compared to well-known CSS frameworks like Twitter Bootstrap or Zurb Foundation: it won’t handle things for you.

You are the master of your project and you have to make the right choices to fit your needs.

Of course, it’s not a plug-and-play framework, so you’ll actually have to write some code... That’s the power of BlazeCSS!

Why

Each and every experienced web designer/developer know the big problem of CSS: scope.

Because CSS is globally scoped, it is often difficult to apply a class of .active for example. Let’s try to demonstrate this point, consider the following code:

.button {
  border        : 1px solid grey;
  border-radius : 2px;
}

.nav-item {
  background : transparent;
  border     : 1px solid black;
}

Now, you need to have an .active state for your .button. Sounds pretty easy:

.active {
  border-color: blue;
}

Nice! Your .button can now have a class of .active which changes its border-color to blue.

But now, you also need an .active class for your .nav-item! You can’t just use the class we created above, because you don’t want to change the border-color on .active, you want to change the background to red.

Let’s try this!

.active {
  background: red;
}

Problem is, now you have two .active classes… Which one will be applied, then?

Well… that’s all about CSS Specificity!

Let’s take a look at our complete CSS:

.button {
  border        : 1px solid grey;
  border-radius : 2px;
}

.nav-item {
  background : transparent;
  border     : 1px solid black;
}

.active {
  border-color: blue;
}

.active {
  background: red;
}

And consider the following HTML:

<ul class="nav">
  <li class="nav-item">Normal item</li>
  <li class="nav-item active">Active item</li>
</ul>
<main>
  <button class="button active">Just an active button</button>
</main>

The .active .nav-item will have a blue border-color and a red backgroundpretty ugly, right?.

Furthermore, the .active .button will have a blue border-color and a red background too!

That’s the BIG problem about CSS, we can even conclude that with our dummy example... and every web developer will have to pull his air out on it one day or another.

What

We now are aware of this problem, and guess what? It already has been solved! Well, in fact, it has only been virtually solved.

A bunch of high skilled developer has been working on this and created patterns and standards. You might know some, but here we are only going to speak about OOCSS, BEM and ITCSS.

OOCSS

This approach is the most known of three, Twitter Bootstrap and Zurb Foundation entirely rely on it.

Its all about leveraging CSS Specificity by applying multiple classes to elements in order to tweak their appearance or behavior. If you need an example, just take a look at Bootstrap or Foundation docs, you‘ll get my point.

BEM

The BEM pattern is also used in a less knowned CSS framework - but still, it‘s made by Google - : material-design-lite.

BEM principle is pretty simple: all CSS classes follow a nested HTML structure, composed as elements in blocks with the ability to have modifiers expressing their state. Just read BlazeCSS docs to see how it looks!

ITCSS

ITCSS is different from OOCSS and BEM because it‘s more about grouping styles in strictly-ruled categories. If you want to understand how it works, I recommend you to take 5 minutes - really, it worth it - and read these slides about ITCSS by Harry Roberts!

How

OK, here we are... We exposed the problem, we saw there were solutions: let‘s talk about react-be-blaze!

First of all, BlazeCSS is following BEM and ITCSS naming conventions, so it‘s robust and easily scalable :wink: !

So what?

Actually, react-be-blaze is no more than a library providing you ready-to-use components using BlazeCSS styles!

Why would I choose it?

It‘s small, not such as BlazeCSS - which isn‘t included -, but still :

                Asset     Size
react-be-blaze.min.js     83 kB

It‘s easy to install:

$ npm install --save react-be-blaze

It‘s easy to use:

// ESModules — so cool!
import { Button } from 'react-be-blaze'

// ES2015 — meh.
const { Button } = require('react-be-blaze')

// ES5 — really?
var reactBeBlaze = require('react-be-blaze')
var Button = reactBeBlaze.Button

It has a great demo! :warning: UNDER CONSTRUCTION :warning:

I would like to contribute

Oh boy! Thank you a lot :smile: !

This project is open-source, so you are welcome to contribute to it! All you have to do is follow the contribution guide :wink: