DESCRIPTION.
Download NAMESPACE-UP / View the demo
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.
<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.
Markup here...
Details.
<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!
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
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.
Make sure these are installed first.
- In bash/terminal/command line,
cd
into your project directory. - Run
npm install
to install required files. - 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.
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.
You can pass options and callbacks into NAMESPACE-UP through the init()
function:
NAMESPACE-LOW.init();
NAMESPACE-UP also lets you override global settings on a link-by-link basis using the [data-options]
data attribute:
// Markup here...
You can also call NAMESPACE-UP events in your own scripts.
Description
// Functions here...
Example
// Example here...
Destroy the current NAMESPACE-LOW.init()
. This is called automatically during the init function to remove any existing initializations.
NAMESPACE-LOW.destroy();
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.
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.
The code is available under the MIT License.