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

lintel-contrib-buttons

v0.1.4

Published

Buttons for lintel.

Downloads

10

Readme

lintel-contrib-buttons

Buttons for lintel.

npm Bower

Getting Started

This module requires Lintel.

If you haven't used Lintel before, be sure to check out the Getting Started guide, as it explains how to install and use this module. Once you're familiar with that process, you may install this module with this command:

bower install lintel-contrib-buttons --save

Once the module has been installed, you will have to load it in your main SASS file:

@import "bower_components/lintel-contrib-buttons/sass/buttons.scss"

You can use wiredep or grunt-wiredep to automatically inject files in your build process.

Variables

Check the vars file in the sass folder to see the full list of variables you can customize.

$btn-include-inverse

Type: Boolean
Default value: true

Include styles for inverse buttons (light background)?

$btn-include-block-all

Type: Boolean
Default value: true

Include .btn-block-*-max where * is the prefix for each breakpoint max-resolution? (ex. .btn-block-sm-max)

$btn-include-block-all

Type: Boolean
Default value: true

Include .btn-block-sm-max? Assumed true if $btn-include-block-all is true.

Mixins

Check the mixins file in the sass folder to see how you can extend this module.

make-btn($bg[, $border, $text, $bg-inverse, $border-inverse, $text-inverse])

Default $border: darken($bg, 10%)
Default $text: #fff
Default $bg-inverse: $bg
Default $border-inverse: $border
Default $text-inverse: $text

Provide at least:
$bg

If using inverse styles, also include:
$bg-inverse
$border-inverse
$text-inverse

.btn-primary {
  @include make-btn(
    $bg: $btn-primary,
    $bg-inverse: $btn-primary-bg,
    $border-inverse: $btn-primary-border,
    $text-inverse: $btn-primary-text
  );
}

make-btn-block($screen-size, $class)

Create a btn-block-*-max class for a new max-resolution.

@include make-btn-block($screen-sm-max, "sm");

Example Buttons

Default

<button class="btn" type="button">Hello World</button>

Link

Be sure to include role="button" for accessibility if the button does not link to a page.

<a href="#" class="btn" role="button">Hello World</a>

Primary

<button class="btn btn-primary" type="button">Hello World</button>

Inverse Primary

<button class="btn btn-primary inverse" type="button">Hello World</button>

Disabled Button

<button class="btn btn-primary" type="button" disabled>Hello World</button>

Active Button

<button class="btn btn-primary active" type="button">Hello World</button>

Always Block

<button class="btn btn-block" type="button">Hello World</button>

Block on $screen-sm-max and below

<button class="btn btn-block-sm-max" type="button">Hello World</button>

Smaller Button

<button class="btn btn-sm" type="button">Hello World</button>

Example Button Groups

Button Group

<div class="btn-group">
  <button class="btn" type="button">1</button>
  <button class="btn" type="button">2</button>
  <button class="btn" type="button">3</button>
</div>

With Hidden Buttons

Use the .first and .last classes to fix the border-radius where appropriate.

  • .first - first visually visible button that's not :first-child
  • .last - last visually visible button that's not :last-child.
<div class="btn-group">
  <button class="btn" type="button" style="display: none;">1</button>
  <button class="btn first last" type="button">2</button>
  <button class="btn" type="button" style="display: none;">3</button>
</div>

Example Dropdowns

Single Dropdown

<div class="btn-group">
  <button class="btn btn-dropdown-toggle" type="button">
    Dropdown
    <span class="btn-caret" aria-hidden="true"></span>
  </button>
</div>

Open Dropdown

<div class="btn-group open">
  ...
</div>

Split Dropdown

<div class="btn-group">
  <button class="btn" type="button">Split Dropdown</button>
  <button class="btn btn-dropdown-toggle" type="button" aria-label="More Options"><span class="btn-caret" aria-hidden="true"></span></button>
</div>

Nested Button Groups

<div class="btn-group">
  <div class="btn-group">
    <button class="btn" type="button">Split Dropdown</button>
    <button class="btn btn-dropdown-toggle" type="button" aria-label="More Options"><span class="btn-caret" aria-hidden="true"></span></button>
  </div>
  <button class="btn" type="button">Button</button>
  <button class="btn" type="button">Button</button>
</div>

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

License

Copyright (c) 2014 Marius Craciunoiu. Licensed under the MIT license.