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

@cenui/config

v0.0.13

Published

The configuration for styled-bootstrap-components

Downloads

1

Readme

CenUI - Config

npm Travis branch Codecov branch storybook lerna

The configuration for CenUI

Usage

This package holds the theme for the styled-bootstrap and related functions. You can use is to customize your components.

Using styled-components

You can change appearance of styled-components as normal.

import styled from 'styled-components';
import { Button } from '@arnat/styled-bootstrap';

const CustomizedButton = styled(Button)`
  border-radius: 0;
  width: 128px;
`;

Using a theme

You can use 'ThemeProvider' from 'styled-components' to modify the components' look. Theme provided to components directly or through provider can contain values that should override default ones.

import React from 'react';
import { ThemeProvider } from 'styled-components';
import { Button } from '@arnat/styled-button';

const App = () => (
  <ThemeProvider
    theme={{
      button: {
        colors: {
          primary: {
            color: '#001919',
          },
        },
      },
    }}
  >
    <Button block primary>
      Themed primary button
    </Button>
  </ThemeProvider>
);

You can change colorScheme object in theme to influence the whole library's look.

const App = () => (
  <ThemeProvider
    theme={{
      colorScheme: {
        primaryLight: '#a1bfff',
        primaryLighter: '#6e9cff',
        primary: '#548bff',
        primaryDarker: '#3b7aff',
        primaryDark: '#2168ff',
        primaryDarkest: '#0757ff',
      },
    }}
  >
    <div>
      <Button block primary mb2>
        Themed primary button
      </Button>
      <Alert block primary mb2>
        Themed primary alert
      </Alert>
      <Container bgPrimary p2>
        Themed primary container
      </Container>
    </div>
  </ThemeProvider>
);

Values in config can be plain strings to use in styles or function that accepts the single argument - function for getting value from the current theme. If the value is function, it's return value will be used in styles.

// Part of default theme demonstrating usage of 'functional' values in the
// configuration. This can be used to reference other values.

const defaultTheme = {
  // ...

  button: {
    colors: {
      primary: {
        color: get => get('colorScheme', 'white'),
        colorOutline: get => get('colorScheme', 'primary'),
        colorOutlineHover: get => get('colorScheme', 'white'),
        backgroundColor: get => get('colorScheme', 'primary'),
        backgroundColorDisabled: get => get('colorScheme', 'primary'),
        backgroundColorHoverFocus: get => get('colorScheme', 'primaryDarker'),
        backgroundColorActive: get => get('colorScheme', 'primaryDark'),
        borderColor: get => get('colorScheme', 'primary'),
        borderColorDisabled: get => get('colorScheme', 'primary'),
        borderColorHoverFocus: get => get('colorScheme', 'primaryDark'),
        borderColorActive: get => get('colorScheme', 'primaryDark'),
        boxShadow: get => get('colorScheme', 'primaryBoxShadow'),
      },
    },
  },

  // ...
};

To see how to modify all the styled-bootstrap-components to create your own UI component library take a look at the theme.