You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ember-component-respo

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-component-respo

Ember addon for enhancing components with dynamic classes based on their actual size

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
6
100%
Maintainers
1
Weekly downloads
 
Created
Source

ember-component-respo

NPM version Build Status

This is an addon that enhances components with dynamic classes based on their actual sizes, regardless of window width.

🚀 Usage

1. Install addon:

ember install ember-component-respo

2. Setup respo breakpoints and classNameBindings:

export default Ember.Component.extend({
  classNames: ['example-box'],
  classNameBindings: ['respoClassNames'],
  respo: [300, 480, 640],
});

Depending on the actual component's size it will add proper class names on top of it, like so:

<div id="ember332" class="example-box gt-300 gte-300 lt-480 lte-480 lt-640 lte-640 ember-view">
  example box
</div>

Default prefixes are: gt, gte, eq, lt, lte. If you want to disable some, use the object form of respo for configuration:

export default Ember.Component.extend({
  classNames: ['example-box'],
  classNameBindings: ['respoClassNames'],
  respo: {
    breakpoints: [300, 480, 640],
    prefixes: ['gt', 'lt'],
  },
});

🔓 License

This library is released under the MIT license.

Keywords

ember-addon

FAQs

Package last updated on 16 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts