noleli,
@noleli@mastodon.social avatar

Ok fam, question for ya. A well-known limitation of ::slotted() is that it only selects direct children. I’m making a component that wraps nested lists and I want to apply styles to all child slotted <ul>s.

Is it reasonable to work around this by having the component have the parent document adopt a stylesheet?

cferdinandi,
@cferdinandi@mastodon.social avatar

@noleli the best way to win the shadow DOM game is to not play 😂

noleli,
@noleli@mastodon.social avatar

@cferdinandi lol, here in Design Systems Land my goal is to make sure Angular developers have to write as little CSS as possible by delivering fully functional and styled components…

westbrook,
@westbrook@mastodon.social avatar

@cferdinandi @noleli Isn't this an "HTML Web Component" question as well?

I have a <custom-element> and my light DOM children should have default styles, for reasons.

Either, require consumers to use both <script> and <link rel="stylesheet"> tags.

Or, do something to injects the styles, e.g. push them into the adoptedStyleSheets of the root element.

Both can go wrong...

Needing a specific level of design control to be "successful" futher alters the paths available to a developer.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • mdbf
  • DreamBathrooms
  • cisconetworking
  • magazineikmin
  • InstantRegret
  • everett
  • thenastyranch
  • Youngstown
  • rosin
  • slotface
  • khanakhh
  • Durango
  • kavyap
  • ethstaker
  • megavids
  • anitta
  • modclub
  • osvaldo12
  • normalnudes
  • ngwrru68w68
  • GTA5RPClips
  • tacticalgear
  • provamag3
  • tester
  • Leos
  • cubers
  • JUstTest
  • lostlight
  • All magazines