Skip to content

Latest commit

 

History

History
executable file
·
139 lines (79 loc) · 4.68 KB

README-TEMPLATE.md

File metadata and controls

executable file
·
139 lines (79 loc) · 4.68 KB

NAMESPACE-UP Build Status

DESCRIPTION.

Download NAMESPACE-UP / View the demo

Getting Started

Compiled and production-ready code can be found in the dist directory. The src directory contains development code. Unit tests are located in the test directory. It's the same build system that's used by Kraken, so it includes some unnecessary tasks and Sass variables but can be dropped right in to the boilerplate without any configuration.

1. Include NAMESPACE-UP on your site.

<link rel="stylesheet" href="dist/css/NAMESPACE-LOW.css">
<script src="dist/js/classList.js"></script>
<script src="dist/js/NAMESPACE-LOW.js"></script>

NAMESPACE-UP is built with Sass for easy customization. If you don't use Sass, that's ok. The css folder contains compiled vanilla CSS.

The _config.scss and _mixins.scss files are the same ones used in Kraken, so you can drop the _NAMESPACE-LOW.css file right into Kraken without making any updates. Or, adjust the variables to suit your own project.

NAMESPACE-UP also requires classList.js, a polyfill that extends ECMAScript 5 API support to more browsers.

2. Add the markup to your HTML.

Markup here...

Details.

3. Initialize NAMESPACE-UP.

<script>
	NAMESPACE-LOW.init();
</script>

In the footer of your page, after the content, initialize NAMESPACE-UP. And that's it, you're done. Nice work!

Installing with Package Managers

You can install NAMEPSACE-UP with your favorite package manager.

  • NPM: npm install GITHUB-USERNAME/NAMESPACE-LOW
  • Bower: bower install https://github.com/GITHUB-USERNAME/NAMESPACE-LOW.git
  • Component: component install GITHUB-USERNAME/NAMESPACE-LOW

Working with the Source Files

If you would prefer, you can work with the development code in the src directory using the included Gulp build system. This compiles, lints, and minifies code, and runs unit tests. It's the same build system that's used by Kraken, so it includes some unnecessary tasks and Sass variables but can be dropped right in to the boilerplate without any configuration.

Dependencies

Make sure these are installed first.

Quick Start

  1. In bash/terminal/command line, cd into your project directory.
  2. Run npm install to install required files.
  3. When it's done installing, run one of the task runners to get going:
    • gulp manually compiles files.
    • gulp watch automatically compiles files when changes are made and applies changes using LiveReload.
    • gulp test compiles files and runs unit tests.

Options and Settings

NAMESPACE-UP includes smart defaults and works right out of the box. But if you want to customize things, it also has a robust API that provides multiple ways for you to adjust the default options and settings.

Global Settings

You can pass options and callbacks into NAMESPACE-UP through the init() function:

NAMESPACE-LOW.init();

Override settings with data attributes

NAMESPACE-UP also lets you override global settings on a link-by-link basis using the [data-options] data attribute:

// Markup here...

Use NAMESPACE-UP events in your own scripts

You can also call NAMESPACE-UP events in your own scripts.

functionName()

Description

// Functions here...

Example

// Example here...

destroy()

Destroy the current NAMESPACE-LOW.init(). This is called automatically during the init function to remove any existing initializations.

NAMESPACE-LOW.destroy();

Browser Compatibility

NAMESPACE-UP works in all modern browsers, and IE 9 and above.

NAMESPACE-UP is built with modern JavaScript APIs, and uses progressive enhancement. If the JavaScript file fails to load, or if your site is viewed on older and less capable browsers, all content will be displayed by default.

How to Contribute

In lieu of a formal style guide, take care to maintain the existing coding style. Please apply fixes to both the development and production code. Don't forget to update the version number, and when applicable, the documentation.

License

The code is available under the MIT License.