question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Same style gets applied when two components have the same name

See original GitHub issue

Hey all! First off great work with the addon. 👍

I’m using ember-component-css together with ember-engines, where both the consuming application and the consumed engine have a component of the same name (let’s say it’s called test-component). So as mentioned in #46, I place my addon styles inside the addon’s app directory:

// inside consuming application (aka parent app)
app/
  components/
    test-component/
      component.js
      styles.scss
      template.hbs

// inside consumed engine (aka in repo engine)
lib/
  test-engine/
    addon/
      components/
        test-component/
          component.js
          template.hbs
    app/
      components/
        hello-world/
          styles.scss

However, it seems like ember-component-css generates the same class name for both components (the test-component in my app, and the test-component in my addon). In this case, it seems like the app’s test-component style takes precedence, and the addon’s test-component style is omitted from the output CSS.

I can namespace my addon components for now by placing them in a directory, but would it be possible for ember-component-css to output two distinct class names in this case? I would love to look into this but my Broccoli-foo is lacking. D:

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
perluncommented, Jul 13, 2017

Cool @mriska, then I think this issue could be closed. @nucleartide, can you do it?

0reactions
webarkcommented, Jul 13, 2017

thanks!! sorry for being kind of MIA on this one recently.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS is generated differently for the same code, but ... - GitHub
The problem Different styles are generated for the exactly same code added to two components with just different name of component.
Read more >
How to use the same name classes but in separate styles
The name of the classes are the same. But they are in two separate styles. How can I use the two styles as...
Read more >
Specificity - CSS: Cascading Style Sheets - MDN Web Docs
Specificity only applies when the same element is targeted by multiple declarations in the same cascade layer or origin. · When two selectors...
Read more >
Name and organize components - Figma Help Center
How you have arranged the Component in the origin file. e.g. We treat all Components within the same frame as Related Components.
Read more >
Copy and paste between projects - Webflow University
Copy and paste between projects to reuse elements, layouts, styles, interactions, and other content — build sites faster.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found