npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

SkyLabels.js

v0.0.2

Published

Fun, Compact & Accessible Forms

Downloads

5

Readme

SkyLabels.js

Fun, Compact & Accessible Forms

Try out a live demo

Why SkyLabels.js?

  • Customizable through CSS. Changes animations, styles, etc.
  • Accessible (uses a label element).
  • Doesn't require that you change your layout. The labels slide above all other content.
  • Easy to read the labels even when the input is focused.

Getting Started

If you are using Rails, check out sky-labels-rails. Otherwise, read the following.

  1. Download JavaScript & CSS files. Get them from /dist/sky-labels.min.js and /dist/sky-labels.css.
  2. Put JavaScript & CSS files in your CSS and JavaScript directories.
  3. Link to the JavaScript in your <head> tag or near the end of the <body> tag. Be sure to add sky-labels.min.js below jQuery.
  4. Wrap inputs & labels in a <section>, <div> or other block level element with the class sky-label. Be sure the label has a for that matches the input.
  5. Call setupSkyLabels() during the domready event or right after you include the sky-labels.min.js.
  6. Customize the CSS to your liking! You can change how it animates, colors, size, etc.

Example HTML

<!-- Put the stylesheet in the <head> -->
<link rel="stylesheet" type="text/css" href="css/sky-labels.css">
<!-- In your <head> or just before the </body> tag -->
<script src="js/sky-labels.js"></script>
<!-- Setup events for slide labels -->
<script type="text/javascript">
setupSkyLabels();
</script>
<!-- Wrap the input and label in a block element with the class "sky-label" -->
<section class="sky-label">
  <!-- Be sure the for matches the input so that when the label is clicked the
input is focused -->
  <label for="first-name">First name</label>
  <input name="first-name" id="first-name" type="text">
</section>

Check out the example HTML from the SkyLabels.js website

Styling and animating your SkyLabels

SkyLabels.js adds and removes styles from the element with the class sky-label so that you can customize every step of the slide.

The class are applied as follows

  • sky-label-focused when the input has been focused
  • sky-label-has-text when the input has text

You can apply styles and animations based on these two classes. See the example CSS from the SkyLabels.js website.

For Developers

You need node. Then, in your shell:

git clone https://github.com/thoughtbot/sky-labels.git
cd sky-labels
npm install -g grunt-cli
npm install
grunt # This compiles and minifies the JavaScript and Sass into dist/

Using Tests

Sky Labels uses Jasmine for testing. Add new specs to the spec folder.

To run tests: open spec/runner.html