I should have named it <icon-spring>
Also posted to Bluesky.
7 replies
const date = new Date();
const month = date.getMonth();
let name = 'icon-confusion';
if (month > 2 && month < 6) {
name = 'icon-spring';
} else if (month > 8) {
name = 'icon-fall';
}
customElements.define(name, definition);Problem solved??
@westbrook I like seasonally appropriate component names!
@westbrook @zachleat does this mean the site breaks every couple of months because the tag name changes? It's like a forced acknowledgement.
@stuffbreaker @zachleat “Breaks”? The tag either upgrades or it doesn’t. Breaks is for weaker, less capable client side APIs the need far less frequent version management work.
But, with different names you could put different ones in different places and get seasonally different experiences. Maybe the confusion season includes A LOT more. Maybe fall and spring deserve different icons. Maybe I’m not pushing hard enough?
The power is yours!
@westbrook @stuffbreaker look, I’ve thought about adding a on:time condition to `<is-land>` so maybe on:season makes sense too
@zachleat
It would presumably be based on the author's hemisphere, you don't want to request the user's location just to get their hemisphere.
@westbrook @stuffbreaker@cwilcox808 @zachleat @stuffbreaker
We'll definitely need to get TC39 onto adding this to Temporal so it can be localized, accessible, and secure!