Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

ember-cli-custom-properties

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-custom-properties

Adds support for CSS custom properties (variables) to components.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
88
104.65%
Maintainers
1
Weekly downloads
 
Created
Source

ember-cli-custom-properties

Adds support for CSS custom properties (variables) to components

Installation

ember install ember-cli-custom-properties

Features

  • Maps component attributes to CSS custom properties
  • Fast, lightweight implementation
  • Only updates CSS custom properties when its bound component value changes
  • Zero configuration design
  • Production ready

Usage

There is no extra installation steps need to use this add-on. It will automatically reopen the Component class an apply the CustomProperties mixin.

You just need to define the customProperties attribute on the target component to declare what properties on the component automatically map to CSS custom properties.

import Component from "@ember/component";

// ...

export default Component.extend ({
  customProperties: ['foo', 'fooBar']
});

In the example above, foo is mapped to --foo and fooBar is mapped to --foo-bar.

Custom Property Bindings

The custom properties defined in customProperties are automatically mapped to CSS custom properties. If you need to control what component property maps to a CSS custom property, define the property in customPropertyBindings.

import Component from "@ember/component";

// ...

export default Component.extend ({
  customPropertyBindings: ['height:--my-component-height']
});

Now, when you set the height property on this component, it will map to the --my-component-height CSS custom property.

Removing a Property

You remove a CSS custom property value by simply setting its bound component property to null or undefined.

Happy Coding!

Keywords

ember-addon

FAQs

Package last updated on 15 Oct 2018

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