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

ember-stylish-buttons

v2.0.3

Published

Some fresh styles & hover effects for the modern Ember button.

Downloads

11

Readme

ember-stylish-buttons

Build and Deploy Coverage Status semantic-release npm version EmberObserver

Some fresh styles & hover effects for the modern Ember button.

A collection of fresh button styles and effects for your Ember buttons. We use CSS transitions and pseudo-elements for most of the effects.

Drawing a great amount of inspiration from this Codrops article

Demo

Demo

Play with different options for the component and customize and get the template code to use in your application. Playground

Installation

ember install ember-stylish-buttons

Usage

<StylishButton @type="winona" @border="thin" @shape="round-s" @text="Open Project" />

<StylishButton @type="wayra" @border="thick" @upperCase={{true}} @size="s">Remove</StylishButton>

<StylishButton @type="isi" @textWidth="thick" @upperCase={{true}} @size="s">
  <i class="button__icon icon icon-box"></i><span>Archive</span>
</StylishButton>

Adding click events

To attach an event handler to the StylishButton component, we can use the on modifier. Since Modifiers can also be applied to components, they are also passed forward and applied to the button element with ...attributes as mentioned in the guides.

<StylishButton @type="winona" @border="thin" @shape="round-s" @text="Open Project" {{on "click" this.updateValue }}/>

Properties

The stylish-button component takes the following list of properties to modify the styles and apperance of the button.

type [String]

This parameter controls the overall style of the buttons. Please find below the list of values it can take from the Styles section.

<StylishButton @type="winona" @border="thin" @shape="round-s" @text="Open Project" />

action [Closure Action]

This parameter performs the click action with whatever action is passed along with parameters. This is where you need to send your actions for the buttons.

<StylishButton @type="winona" @border="thin" @shape="round-s" @action={{action "buttonAction"}} @text="Open Project" />
<StylishButton @type="winona" @border="thin" @shape="round-s" @action={{action "buttonAction" "Hello" "World"}} @text="Open Project" />

size [String]

This parameter controls the size of the button. Possible values include:

  • s => small
  • m => medium
  • l => large
<StylishButton @type="wayra" @border="thick" @upperCase={{true}} @size="s">Remove</StylishButton>

textWidth [String]

This parameter controls the bold property of the text in the button. Possible values include:

  • thin
  • thick
  • medium
<StylishButton @type="isi" @textWidth="thick" @upperCase={{true}} @size="s">
  <i class="button__icon icon icon-box"></i><span>Archive</span>
</StylishButton>

border [String]

This parameter controls the border thickness of the button. Possible values include:

  • thin
  • thick
<StylishButton @type="ujarak" @border="thin" @textWidth="thick" @text="Publish" />

upperCase [Boolean]

This parameter transforms the button text to uppercase. Default value is false

<StylishButton @type="ujarak" @border="thick" @upperCase={{true}} @size="s" @inverted={{true}} @textWidth="thick" @text="Publish" />

shape [String]

This parameter transforms the button to a pill shape with various border-radius dimensions. Possible values include:

  • round-s
  • round-l
  • round-m
<StylishButton @type="winona" @border="thick" @shape="round-l" @size="s" @upperCase={{true}} @textWidth="thick" @text="Open Project" />

customClasses [String(s)]

This parameter adds your custom classnames to the component class list. It is useful to override the styles with your own classnames.

<StylishButton @type="winona" @border="thin" @shape="round-s" @text="Primary" @customClasses="btn-primary" />
<StylishButton @type="winona" @border="thin" @shape="round-s" @text="Success" @customClasses="btn-success" />
<StylishButton @type="winona" @border="thin" @shape="round-s" @text="Info" @customClasses="btn-info" />
<StylishButton @type="winona" @border="thin" @shape="round-s" @text="Warning" @customClasses="btn-warning" />
<StylishButton @type="winona" @border="thin" @shape="round-s" @text="Danger" @customClasses="btn-danger" />

Styles

Ember stylish buttons come with about 18 different styles for button. Just give any one of the following values for the type attribute of the component.

  • winona (default)
  • ujarak
  • wayra
  • tamaya
  • rayen
  • pipaluk
  • moema
  • isi
  • aylen
  • saqui
  • wapasha
  • nuka
  • antiman
  • itzel
  • naira
  • quidel
  • sacnite
  • shikoba

Configuring

Add a configuration for ember-stylish-buttons to include only the themes that you will use.

ENV['ember-stylish-buttons'] = {
  includedThemes: ['winona', 'ujarak', 'shikoba'],
  excludedThemes: ['wapasha'],
  excludeBaseStyles: false, // defaults to false
  defaultTheme: 'winona',    // defaults to 'winona'
};

To exclude or not include a theme, means that it's css styles will not be bundled with your application, thus not polluting your app.

Note: including a blank array e.g. includeThemes: [] will not include any themes, leaving you to define your own theme styles. See the vendor/ember-stylish-buttons/themes directory for reference.

Note: you may also want to set excludeBaseStyles: true so that this addon doesn't include the styles used by all the themes.

A big Thanks to Ilya Radchenko for making this configuration possible to have a small memory footprint of css in your app when you are using the addon.

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.

Credits