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.

Component subclassing support?

See original GitHub issue

Hi there! Our team just decided to start using ember-component-css (which has been great so far!) and in the process of cramming scss files into our pods, I ran across a situation where we have two components that both subclass a base-widget component. The children widgets share some styling so I was like, “let me try cramming all those shared styles into the base-css pod”!

Unsurprisingly, it didn’t work because the base-widget styles assume anticipate a .base-widget-blah class applied to the component elements, but instead all they have is the .child-widget-blah class.

Right now, I’ve just bailed on using pod-bound styling for the shared styling but I’d love to see this case supported in the future!

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:8
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
webarkcommented, Jul 28, 2017

this is possible to do in the current system, though it is kind of clunky, and would be nice if it was streamlined. You can, however, do something like…

import podNames from "ember-component-css/pod-names"

classNames: [podNames["path/to/base/class"]]

This will add the namespaces class to the component, as well as still having its own generated namespace class.

2reactions
webarkcommented, Mar 18, 2016

ahh… ok cool. no. I get ya. sometimes you would want to use a shared template or something and just override some behavior on the component.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component Subclasses - Oracle Help Center
The Component class allows the value to be any Java object. The subclass must coerce the value to a particular type when it...
Read more >
Deriving Subclasses to Create New Components | ICS MotifZone
This section demonstrates how to use the VkComponent class to create new components. It includes guidelines to follow when creating new components, ...
Read more >
NH-943 - Add Support For Subclassing Of Components #963
Domain wise I can solve this quite simple as I'd want to have an Account class mapped to the account table, with the...
Read more >
How To Extend Classes with Angular Component Inheritance
Learn how to use the power of inheritance to extend your Angular components with common functionality.
Read more >
Name three Component subclasses that support painting.
Name three Component subclasses that support painting. ... The Canvas, Frame, Panel, and Applet classes support painting. 5 5. Surya Bikram ...
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