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

bm-palako

v1.0.0

Published

A collection of styled components, uses a combination of BassCss (Import how you like) and JSS to achieve desired styling.

Downloads

1

Readme

Install

Clone the library.

  1. cd [library] and run yarn install

Note the step below requires (sinopia)[https://github.com/rlidwka/sinopia] to be installed and running you can follow the install instructions (here)[https://github.com/rlidwka/sinopia].

  1. npm publish --registry http://localhost:4873/

  2. Create a new project

  3. yarn add local-biomeme-components

Purpose:

Wanted to have a component library for Biomeme that allowed quick building various sections of our site. I based it off of the Rebass (google Rebass) that would basically be a drop in. Rebass uses inline styles in the entire library and I wanted to get away from that because those styles add up per component. At the same time I liked the idea of inline styles from CSSINJSS as well as functionalCSS, so this is my attempt to merge the two which are kind of opposites.

The components of this library use the Theme wrapper to attact one main customizaed sheet and use the styles from that to build it.

*Inline styles used occasionally from dynamic properties

Tradeoffs:

initial render time => No clue not sure how the delay is compared to Rebass itself.. | Components should render fast because most of the time no need to attach a sheet and they are kept light as functional Components

Problems Encounted:

  1. Dynamic style elements: Keep using inline styles for things such as width and height which will depend on the compent props and are not globally available
  2. Passing down style={ someStyleObject }: Detect if style is being passed and merge it with current style
  3. Passing down className=“some class string”: added to the class by using classNames lib
  4. Global conflicts: HOC passes down globalClasses to component, which you can then compose using jss compose
  5. Customization: User passes in global style sheet and merges in own css, inline styles used for width and colors that dont exist

Library Implementation Notes:

*Library uses a slight modification of react-css’s (github.com/cssinjss/react-css) inject sheet method which allows for the user to compose from the global style sheet as opposed to repeating the styles, this is used only when element specific styles do not exist in the global sheet and is used at a limited rate. This is done In order to avoid naming conflicts with the global sheet, when a style sheet is injected that also requires styles from the global sheet, the specific style sheet composes from the global sheet.

Components with inline styles every time (Dynamic properties such as width, and height):

  • Any class depending on colors will first look at global, if not found uses inline
  • Any class that can have a variable width and height: Avatar, Card, DropdownMenu, Drawer,
  • Slight adjustments to make components work together: InlineForm

Components where sheet needs to be injected:

Arrow, Badge, CardImage, ButtonCircle Most input fields: Select, Checkbox, Radio, ===> Need to be refactored to compose ===> Badge, Button Circle

Also noted that the library will attempt to look for height-[scale] and width-[scale] for elements that require them, these are not set by the acecss library.

Todo:

Refactor out some styles that are being used often such as cursor: pointer top: 0, bottom: 0, left: 0, right: 0, ===> Need to be refactored to compose ===> Badge, Button Circle

// Usage Example, importing css requires some css loader
import acecss from 'raw!ace-css-kyle-custom/css/ace.css';
import { App, config } from 'local-biomeme-components';

const addons = {
  // Required for some elements
  'pointer': { cursor: 'pointer'},
  'inline-flex': { display: 'inline-flex' },
  // End Requirement,
  'height-1': { height: 12 },
  'height-2': 12,
  'height-3': 12,
  'height-4': 12,
  'height-5': 12,
  // Override previous classes
  'bg-red': { backgroundColor: '#D3422E' },
  'bg-yellow': { backgroundColor: '#F5BB12' },
  'bg-green': { backgroundColor: '#4BAE16' },
  'bg-blue': { backgroundColor: '#3299CC' },
  'bg-orange': { backgroundColor: '#FFBA60' },
  'bw1': { borderWidth: 1 },
  'bw2': { borderWidth: 2 },
  'bw3': { borderWidth: 4 },
  'bw4': { borderWidth: 8 },
}

const finalStyle = config(acecss, addons);

// Top level of React App
<App sharedSheet={finalStyle}>
</App>