Skip to content

Optics, a RoleModel Design System is a CSS package that provides base styles and components that can be integrated and customized in a variety of projects.

License

Notifications You must be signed in to change notification settings

RoleModel/optics

Repository files navigation

Optics, a RoleModel Design System

Code

License

npm

Linting CI

Optics is a css package that provides base styles and components that can be integrated and customized in a variety of projects.

Installation

NPM

npm install @rolemodel/optics

Yarn

yarn add @rolemodel/optics

Importing with a compiler

You can add this import to the top of your root level css file.

@import '@rolemodel/optics'; /* Using webpack to compile */
/* Or */
@import '@rolemodel/optics/dist/css/optics'; /* Using a different compiler */
/* Or */
@import '@rolemodel/optics/dist/css/optics.min.css'; /* If you want a single file with all the styles in it. */

Importing without a compiler

To use Optics without compilation, use a CDN like jsDelivr or unpkg. Add a link in your HTML head or an @import to the top of your root level css file.

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@rolemodel/optics@[desired version]/dist/css/optics.min.css"
/>
@import 'https://cdn.jsdelivr.net/npm/@rolemodel/optics@[desired version]/dist/css/optics.min.css';

Note: You can use this method to use Optics with CodePen. In a CodePen project, go to Settings > CSS, find the section for adding external stylesheets, and add the CDN link as a resource.

Documentation

We use Storybook as a way to provide informative and interactive documentation.

It can be found here Optics Documentation

Token Documentation

We use the Storybook Design Token for showing design tokens in the documentation. This allows us to tag groups of tokens with a category and a presenter.

Available Presenters

Add the following above a group to categorize the tokens.

/**
* @tokens Basic Colors
* @presenter Color
*/

Component Documentation

For instructions on how to create a new component, see Process for Creating New Components

Additional stories can be added using the following command, or copying an existing story.

npm run generate

The visual graphic found on the Selective Imports page in the documentation is generated from the tools/generate-graph.dot file. You can preview and export a newer svg version of the graphic by using the tintinweb.graphviz-interactive-preview VSCode extension.

License

MIT

About

Optics, a RoleModel Design System is a CSS package that provides base styles and components that can be integrated and customized in a variety of projects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 13