/rua

Pattern library for data.govt.nz

Primary LanguageSCSSMIT LicenseMIT

Rua Pattern Library

Table of Contents

  1. Installation
  2. Development
  3. Usage

Installation

yarn install

@todo Register to npm.js so we can run

yarn install rua-pattern-library

Development

yarn run watch

or

gulp watch

Your default browser should open to localhost:3000 or increment to the next available port.

Note: on first run you may get an error cannot GET /. Try running yarn run build then watch again.

Build

yarn run build

or

gulp

Contributing

To update this repo, create a PR with just the src changes (not dist/ or docs/). Once the changes have been merged, create a commit "Dist and docs" on master and tag with latest version number.

Usage

@import '~rua-pattern-library/src/rua';
// Optionally set window.dataTargetNamespace to a custom value (e.g. 'rua-' would mean you'd use `data-rua-toggle="..."`)

import {
    toggler,
    matchHeight,
    clipboard,
    tooltip,
    backToTop
} from 'rua-pattern-library/src/9-plugins'

$(document).ready(function(){
    matchHeight()
    toggler()
    clipboard()
    tooltip()
    backToTop()
})