Giter Club home page Giter Club logo

styleguide's Introduction

Auth0 Styleguide

Auth0 Product Style Guide. This is for internal use by Auth0 only.

Usage

We encourage you to use our CDN resource, but if you want to extend you can either use Component(1) or Bower for that. Instructions on the build process are detailed below.

CDN

Using our CDN is the simplest solution. Just add the following line in your project's HTML head and you are done.

<link href="https://cdn.auth0.com/styleguide/latest/index.css" rel="stylesheet" />

If you require any other asset listed under the lib folder, you can follow a simple rule: https://cdn.auth0.com/styleguide/latest/<path-to-asset-under-lib>

For example, if you want to retrieve our logo:

<!-- Retrieving the logo at `lib/logos/img/badge.png` -->
<img src="https://cdn.auth0.com/styleguide/latest/lib/logos/img/badge.png">

Run locally

  npm i
  grunt dev

Bower

Bower usage is only recomended when you plan to extend the styleguide from build. If that's not the case just use our CDN as described above.

Install

bower install auth0/styleguide
{
  "dependencies": {
    "auth0-styleguide": "auth0/styleguide"
  }
}

Build

Since we use stylus for compiling our assets. So you should translate this build tasks to your own build process:

stylus --include-css --include bower_components --resolve-url --out <your_dest_path> your_index.styl
cp -R lib/**/* <your_dest_path>

You may use bower or gulp or any task/build helper of your preference. Just make sure the final folder structure looks like this:

<your_dest_path>/
|- lib/
|  |- ...
| - index.css

Usage

With a build process well defined, you can now include the styleguide from your index.styl

// use all styleguide styles
@include 'bower_components/auth0-styleguide'

// define your own
body.my-custom
  .styles-here
    color: red;

Or perhaps you want to extend just parts of it by:

// use only colors
@include 'bower_components/auth0-styleguide/lib/vars'

// and override color-red
color-red = '#ff0000';

Component(1)

Component usage is only recomended when you plan to extend the styleguide from build. If that's not the case just use our CDN as described above.

The following details on installation and usage are made according to the latest component version. Check Component's guide for more information.

Install

component install auth0/styleguide

{
  "dependencies": {
    "auth0/stylguide": "2.0.0"
  }
}

Build

When using component you will have to build your styles using styleguide with a build step for stylus support.

Basically, you will have to reproduce the line: stylus --include-css --include ./components [files] from Stylus Javascript API.

This is an example for a component-builder plugin setup.

// stylus-plugin.js
var stylus = require('stylus');

module.exports = function stylusPlugin(file, done) {
  if (file.extension !== 'styl') return done();

  file.read(oncontents);

  function oncontents (err, string) {
    if (err) return done(err);

    var renderer = stylus(string, {
      // add `./components/` folder for lookup
      paths: [process.cwd() + '/components']
    });

    // set `--include-css` flag
    renderer.set('includeCSS', true);

    renderer.render(function (err, result) {
      if(err) return done(err);
      file.extension = 'css';
      file.string = result;
      done();
    });
  }
}

// build.js
var stylus = require('./stylus-plugin.js');
var Builder = require('component-builder');

Builder.styles(tree)
  .use('styles', stylus)
  .end(function (err, result) {
    // done
  });

Usage

With a build process well defined, you can now include the styleguide from your index.styl

// use all styleguide styles
@include 'auth0/styleguide/2.0.0'

// define your own
body.my-custom
  .styles-here
    color: red;

Or perhaps you want to extend just parts of it by:

// use only colors
@include 'auth0/styleguide/2.0.0/lib/vars'

// and override color-red
color-red = '#ff0000';

Releasing a new version

Run the command bin/version <patch|minor|major|version-no> inside the root of the repo. This will commit a new version for you.

Example

bin/version patch

License

All the logos and branding are copyright Auth0 and may not be used or reproduced without explicit permission from Auth0 Inc.

The icons are licensed from Budi Harto Tanrim. All other third-party components are subject to their own licenses.

styleguide's People

Contributors

arielger avatar beneliflo avatar cherna avatar cristiandouce avatar jfromaniello avatar jgelsey avatar marianomiguel avatar ntotten avatar ramasilveyra avatar rickyrauch avatar sanntu avatar tehsis avatar vctrfrnndz avatar

Watchers

 avatar  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.