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

@elemental-ui-alpha/theme

v0.0.0

Published

The theme is used to share global theme settings throughout the hierarchy of your application. The theme provider is included by the Core component.

Downloads

6

Readme

Theme

import { makeTheme, useElementalTheme } from '@elemental-ui-alpha/theme';

Color

Background

const { background, foreground } = useElementalTheme();
return (
  <Stack gap="small">
    {Object.entries(background).map(([key, value]) => (
      <Card padding="small">
        <Flex key={key} align="center" direction="horizontal">
          <Box
            height="2.2em"
            width="2.2em"
            marginRight="medium"
            style={{
              backgroundColor: value,
              border: `1px solid ${foreground.border}`,
            }}
          />
          <Text marginRight="small">{key}</Text>
          <Text foreground="dim">({value})</Text>
        </Flex>
      </Card>
    ))}
  </Stack>
);

Foreground

const { foreground } = useElementalTheme();
return (
  <Stack gap="small">
    {Object.entries(foreground).map(([key, value]) => (
      <Card padding="small">
        <Flex key={key} align="center" direction="horizontal">
          <Box
            height="2.2em"
            width="2.2em"
            marginRight="medium"
            style={{
              backgroundColor: value,
              border: `1px solid ${foreground.border}`,
            }}
          />
          <Text marginRight="small">{key}</Text>
          <Text foreground="dim">({value})</Text>
        </Flex>
      </Card>
    ))}
  </Stack>
);

Spacing

Using a base unit of 4px, doubling each increment for harmonious layout, there are six named spacing options:

const { color, spacing } = useElementalTheme();
return (
  <Cluster gap="small">
    {Object.entries(spacing).map(([key, val]) => (
      <Box
        key={key}
        height="1em"
        width={val}
        title={key}
        style={{ background: color.B400 }}
      />
    ))}
  </Cluster>
);

Shape

The shape of an Elemental theme:

type ElementalNamedTheme = {
  name: string;
  foreground: {
    accent: string;
    action: string;
    border: string;
    dim: string;
    focusRing: string;
    heading: string;
    muted: string;
    text: string;

    // tones
    critical: string;
    neutral: string;
    info: string;
    positive: string;
  };
  background: {
    base: string;
    muted: string;
    shade: string;
    dim: string;
  };

  breakpoints: {
    small: number | string;
    medium: number | string;
    large: number | string;
    xlarge: number | string;
  };
  color: Object;
  elevation: {
    E100: number;
    E200: number;
    E300: number;
    E400: number;
    E500: number;
  };
  spacing: {
    none: number | string;
    xxsmall: number | string;
    xsmall: number | string;
    small: number | string;
    medium: number | string;
    large: number | string;
    xlarge: number | string;
    xxlarge: number | string;
  };
  fontFamily: {
    monospace: string;
    body: string;
    heading: string;
  };
  fontSize: {
    xsmall: number | string;
    small: number | string;
    medium: number | string;
    large: number | string;
    xlarge: number | string;
    xxlarge: number | string;
    xxxlarge: number | string;
  };
  radii: {
    none: number | string;
    small: number | string;
    medium: number | string;
    large: number | string;
  };
};

Customize

Customize the theme consumed by Elemental components.

import { makeTheme } from '@elemental-ui-alpha/theme';

const customTheme = makeTheme('Custom Theme', {
  foreground: {
    action: 'DodgerBlue',
  },
});

function App() {
  return <Core theme={customTheme} />;
}