GithubHelp home page GithubHelp logo

kryndex / oui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from innovand/lego

0.0 2.0 0.0 3.59 MB

Optimizely's Component Library.

Home Page: http://design.optimizely.com/docs/oui/

License: Other

JavaScript 57.60% Ruby 0.06% Shell 0.40% CSS 41.95%

oui's Introduction

Build Status codecov Gitter Live Documentation

OUI Component Library

Louis

Meet Louis, the official mascot of OUI.

Introduction

This document contains four parts:

  1. Documentation
  2. Including OUI in your project
  3. Contributing to OUI

Documentation

http://design.optimizely.com/docs/oui/

This “living” style guide is built in React and is automatically updated with each new OUI release.


Including OUI in your project

OUI is published as an npm module called optimizely-oui that contains Sass files and React components.

To install:

npm install optimizely-oui --save

This will save it within your project's node_modules/ folder.

Using OUI Sass files

OUI consists of two parts:

  1. Core OUI Sass
    • Base styles used as the foundation for any site.
    • This code lives in this OUI repository and is loaded before application specific Sass.
  2. Project specific Sass (mobile website, developer site, etc…)
    • Project specific Sass built with OUI code such as variables or mixins.
    • This code lives in the project repo, pulling OUI as a dependency.

For example, if you're building a mobile site, your main SCSS file mobile.scss would contain:

// # Mobile Website
// Root file driving the Mobile Website CSS.

// ## OUI and custom functions
@import '../node_modules/optimizely-oui/src/oui/partials/sass/functions';
@import 'mobile-website/functions';

// ## OUI and custom variables
// The mobile website variables file can contain new variables or overwrite existing variables.
@import '../node_modules/optimizely-oui/src/oui/oui-variables';
@import 'mobile-website/mobile-variables';

// ## OUI and custom partials
// Partials are files that import other components
@import '../node_modules/optimizely-oui/src/oui/oui-partials';
@import 'mobile-website/mobile-partials';

// ## Overrides (helper/utility classes)
// Overrides use `!important` classes for overrides and should always be loaded last.
@import '../node_modules/optimizely-oui/src/overrides/admin';
@import '../node_modules/optimizely-oui/src/overrides/background';
@import '../node_modules/optimizely-oui/src/overrides/borders';
@import '../node_modules/optimizely-oui/src/overrides/layout';
@import '../node_modules/optimizely-oui/src/overrides/margin';
@import '../node_modules/optimizely-oui/src/overrides/padding';
@import '../node_modules/optimizely-oui/src/overrides/type';
@import '../node_modules/optimizely-oui/src/overrides/sizing';

Using OUI React components

OUI comes with React components that can be used instead of copying and pasting HTML from the documentation. You can view these components locally by running npm run docs:watch after cloning the repository and installing dependencies with npm install.

These components can be used in a React codebase by requiring OUI:

import Button from 'optimizely-oui';

We provide React documentation that includes information on our component props and default values.


Contributing to OUI

Want to run OUI locally? Clone this repository and run npm install. The npm run command will list all the available commands.

See CONTRIBUTING.md for more information.

oui's People

Contributors

amy-chiu avatar bhamodi avatar danoc avatar daverau-optimizely avatar ianh-optimizely avatar jeffreychan-optimizely avatar jeffz-optimizely avatar kwalker3690 avatar lindahong avatar nathanjessen avatar spencerwilson-optimizely avatar tscanlin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.