New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-pod-styles

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-cli-pod-styles

Ember addon to help automatically namespace component css.

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

ember-cli-pod-styles

This ember addon makes it easy to write component-namespaced css.

It will automatically namespace each component's style.css and concatenate the results into app.css.

At runtime, when ember inserts elements into the DOM this addon will add style-scope marker classes to ensure the proper specificity for the namespaced styles.

This addon requires postcss

Input:

// my-component/template.hbs
<div class='foo'>
</div>

// my-component/style.css
:host { background: blue; }
.foo { color: red; }

Runtime output:

<my-component>
  <div class='foo style-scope my-component'>
  </div>
</my-component>

my-component { background: blue; }
.foo.my-component { color: red; }

Installation

npm install ember-cli-pod-styles

Usage

Add at least one postcss plugin to podStyleOptions:

// ember-cli-build.js
var app = new EmberApp(defaults, {
  podStyleOptions: {
    plugins: [
      require('postcss-nested'),
      // additional postcss plugins here
    ]
  }
});

In your component's pod directory add a style.css file with styles you want automatically namespaced:

// app/components/foo-bar/style.css
:host {}             // => foo-bar
.baz {}              // => .baz.foo-bar
.baz:nth-child(1) {} // => .baz.foo-bar:nth-child(1)

Make sure to change the tagName for your component:

export default Ember.Component.extend({ tagName: 'foo-bar' });

Keywords

FAQs

Package last updated on 02 Aug 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc