scrwd,
@scrwd@mastodon.social avatar

Just a thought - not necessarily a good one - if I created a custom element <site-layout> and use it to insert blocks of content into specific <slot> elements it could create for quite lean pages - but I guess it would mean using shadow dom too…

I wonder if this something @enhance_dev makes better - I need to take a look again.

&lt;site-layout&gt;  
 &lt;h1 slot="header&gt;Title&lt;/title&gt;  
 &lt;nav slot="sidebar"&gt;…&lt;/nav&gt;  
 &lt;main slot="content"&gt;…&lt;/main&gt;  
&lt;/site-layout&gt;  
tbroyer,
@tbroyer@piaille.fr avatar

@scrwd That's definitely where Enhance or WebC would shine (IIRC, Marko too, probably Astro as well).
You'd "just" be using the custom element syntax for server-side templating though, not a "true" web component, so you could just as well use other server-side templating languages.

scrwd,
@scrwd@mastodon.social avatar

@tbroyer I'm not sure if Astro lets you have more than one slot tho? That's the key bit because a complicated layout can be used quite simply with multiple slots. I know I could use grid and subgrid to sort of create "slots" (similar to the link @macdonst shared - although using multiple slots it just assigns into a CSS grid area in the example) but that only works for some layouts - the more you have nested HTML the harder it is to make it work even with subgrid support.

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