🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@byteclaw/visage-core

Package Overview
Dependencies
Maintainers
2
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byteclaw/visage-core

CSS-in-js agnostic framework for design system development used by Visage Design System.

latest
Source
npmnpm
Version
1.0.0-alpha.20
Version published
Weekly downloads
4
-60%
Maintainers
2
Weekly downloads
 
Created
Source

@byteclaw/visage-core

@byteclaw/visage-core version License

CSS-in-js agnostic framework for design system development used by Visage Design System.

Installation

npm install @byteclaw/visage
# or
yarn add @byteclaw/visage

Usage

import {
  createComponent,
  createTheme,
  DesignSystem,
  resolveStyleSheets,
} from '@byteclaw/visage-core';

// create component is used to create a system component
const Box = createComponent('div', {
  displayName: 'Box',
  styles: {
    color: 'primary',
  },
});

const theme = createTheme({
  theme: {
    color: {
      primary: 'red',
    },
  },
});

// style generator is responsible for returning props that are used to style a component
// for example this one returns a style prop that is used directly on a component
// @byteclaw/visage uses emotion css-in-js therefore it returns className prop
function styleGenerator(styleSheets, ctx) {
  // stylesheets is an array of stylesheets that should be merged
  // ctx is current design system context, which contains an information about device viewport, theme, etc
  return {
    // deepmerges stylesheets and produces a final styleSheet for a component
    style: resolveStyleSheets(styleSheets, ctx),
  };
}

<DesignSystem theme={theme}>
  <Box />
</DesignSystem>;

Documentation

Please visit https://visage.design.

License

MIT

Keywords

visage

FAQs

Package last updated on 04 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts