Displaying HTML web components

Those HTML web components I made for date inputs are very simple. All they do is slightly extend the behaviour of the existing input elements.

This would be the ideal use-case for the is attribute:

<input is="input-date-future" type="date">

Alas, Apple have gone on record to say that they will never ship support for customized built-in elements.

So instead we have to make HTML web components by wrapping existing elements in new custom elements:

<input-date-future>
  <input type="date">
<input-date-future>

The end result is the same. Mostly.

Because there’s now an additional element in the DOM, there could be unexpected styling implications. Like, suppose the original element was direct child of a flex or grid container. Now that will no longer be true.

So something I’ve started doing with HTML web components like these is adding something like this inside the connectedCallback method:

connectedCallback() {
    this.style.display = 'contents';
  …
}

This tells the browser that, as far as styling is concerned, there’s nothing to see here. Move along.

Or you could (and probably should) do it in your stylesheet instead:

input-date-future {
  display: contents;
}

Just to be clear, you should only use display: contents if your HTML web component is augmenting what’s within it. If you add any behaviours or styling to the custom element itself, then don’t add this style declaration.

It’s a bit of a hack to work around the lack of universal support for the is attribute, but it’ll do.

Responses

akazzop

@adactio for whatever reasons browsers on ios (safari and firefox focus at least) tend to refuse opening the page :-/

# Posted by akazzop on Wednesday, April 17th, 2024 at 10:26am

Ryan Townsend

@adactio I really wish there was an `:custom-element` state selector in CSS so you could default all custom elements to `display: contents` and just override on a case-by-case basis.

(unfortunately `:defined` targets native elements too, otherwise `:defined, :not(:defined)` would work to target custom elements)

sekhmetdesign.thegeekcartel.com

I’mmmmmmmm in vacations! Ohhhhhhhh how relaxing this first week (of two!) was, giving me the chance to just do…nothing. Nothing planned, nothing scheduled, no alarm in the morning. Just simple life, getting up, reading, sipping my coffee/cocktail, chatting with friends, spending some time with my teenager… I needed it! I enjoy these quiet moments of doing nothing, as I think our modern lives are just too busy, running around like hens in the courtyard yapping and screeching because we are too busy with work and trying to have a social life and being responsible adults. Nothing better than a nice staycation, enjoying the pool, my cats and my terrasse in my backyard. Let’s enjoy this!

On last Friday, I watched the Paris Olympics’ Opening Ceremony, and it left me speechless (in a good way!). The entire choreography and planning of this event must have given the organizers a massive headache, but KUDOS to them: they managed to create a breathtaking ceremony that was typically SO FRENCH and creative, giving us a sense of whom the new France is, a pluralistic society opened to La Joie de Vivre. I just enjoyed myself during the long 4 hours of it, and loved how they just trolled the fucking conservatives of the world in a way that is so French 😉 Unfortunately, I watched it on the Radio-Canada TV channel, which had TOO MANY ADS during the ceremony: it was just too much disturbance. But seriously, the next Olympics ceremonies will have a huge challenge to top this one, as it was simply impeccable. I can’t wait to see their Closing Ceremony now!

Now, let’s go with my shares of the week!

Keywords: Cookie Monster; Sesame Street social media strategy; Moral bankruptcy of Silicon Valley; Ozempic and body positivity; Psychiatric labels as Identities; Autocracy; Financial Wellness; Belarus’s journalists and data; Telegram tools; OSINT framework; Favorite Youtubers and music to listen to; Locke & Key; fake balsamic vinegar; yummy recipes; Island of San Seriffe; JavaScript frameworks; HTML web component tip.

TO READ
  • Things I learned: to not dirty up Cookie Monster’s costume, the “cookies” were in fact rice cookies, making it easier to clean up the fur of each puppet. I thought it was chocolate chip cookies, but no!
  • The Moral Bankrupcy of Marc Andreessen and Ben Horowitz: I hate the folks in Silicon Valley making it a hyper-capitalist region, spreading their toxic ideologies across the globe. They entered the American politics scene, getting involved in Donald Trump’s political campaign with huge donations to his political action committees. The decision to support Donald Trump marks the first time these influential Silicon Valley figures have publicly supported Trump, a support motivated by Trump’s stance on cryptocurrency regulation, which aligns with their own interests. Andreessen and Horowitz are concerned about the potential for heavy regulation under other candidates, which could stifle technological innovation and the growth of the cryptocurrency sector – a field in which they have invested heavily. This move has drawn significant attention from the public, and in particular from communities and sectors that have traditionally seen both men as advocates for progressive tech policies, but have, in recent years, turned around and supported more extremist policies affecting the social and economic status of the majority of people in the American society. The Silicon Valley clique has cast its votes, and it’s with Donald Trump. More reasons to tax the ultrarich and stop listening to them, they have become morally corrupted.
  • So Was Body Positivity ‘All a Big Lie’? – All the talk, articles, ads, online content, etc… about the weight loss injectable “solution” like Ozempic, Wegovy, Saxenda (and its likes) enrage me. We had a nice body positivity movement going on for the last couple of years, focusing on health instead of weight, and it all came crashing down like a year ago when the push for weight loss injectables started getting publicity and made the news. This intense push by medical professionals to take this drug is just insane, and the pressure to take it is strong. My own family doctor really insisted for me to try it (by giving me the equivalent of 2 months of medication free as a tester), and for a while, I really did see a nice improvement on my weight (I lost around 10 lbs), cutting my appetite by insane amount (I barely ate). That being said, the more testimonials and stories I was reading online, the more scared I got for my general health, so I stopped after 2 months. Also, its insane price (it wasn’t covered by my health insurance, so it would have been a out-of-pocket medication to pay – 500$ CAD minimum per month) really repulsed me. This crazy obsession of thinness instead of good health really pushed me to be in the camp of “anti-Ozempic” team, and reading this article gave me a lot of sadness: to see people being forced back into being thin as a ultimate “good health” indicator saddens me a lot. The article discusses the tension within the body positivity community as influencers increasingly turn to weight-loss drugs like Ozempic. Some influencers, who initially promoted body positivity, face backlash for using these medications, often for health reasons. The community is divided, with some feeling that the shift to weight loss undermines body positivity’s core values, while others argue for the importance of personal health choices. The controversy highlights the complexities of balancing body positivity with individual health needs
  • Why We’re Turning Psychiatric Labels Into Identities – This article discusses the challenges and implications of psychiatric labelling, particularly in relation to the Diagnostic and Statistical Manual of Mental Disorders (DSM). It explores the concept of “dynamic nominalism,” where labels not only categorize individuals but also shape their self-perception and behavior. It also mentioned 3 books that illustrate how psychiatric classifications influence individuals’ identities and self-understanding. Overall, the article emphasizes the complex relationship between psychiatric labels and personal identities, raising questions about the validity & stability of diagnostic categories, and the potential impact of labeling on individuals’ self-perception and behavior. It concludes by suggesting that any new psychiatric taxonomy must consider the influence of previous classifications, and the dynamic nature of mental illness
  • You would not enjoy living in an autocracy – The possible re-election of Donald Trump in the United States scares me a lot. I simply don’t understand how some people WANT to live in a dictatorial state (well, I do understand: it’s hate of differences from the white cishet straight male figure). In recent weeks, Donald Trump has made several alarming statements and threats, including using the military to deport millions, prosecuting women for abortions, pardoning Capitol insurrectionists, and suggesting he could order political assassinations with impunity. His rhetoric mirrors that of historical fascists (hummm, Hitler!), emphasizing threats from within the country. The article argues that media coverage should focus more on the real-life impacts of a potential Trump autocracy, examining how such governance would affect daily life, as seen in other autocratic regimes like Russia and Hungary.
  • Why I’m Pursuing Financial Wellness Over “Financial Freedom” – Personal finances is a subject that heavily impacts the mental being and health of folks across the world, but especially in our capitalist society. Having good finances helps stabilize our mental state of mind, removing the stress and soothing our mind on basic necessity. This article about financial wellness discusses the difference between financial freedom and financial wellness. Financial freedom is the ability to afford anything you want; financial wellness is about feeling comfortable and secure with your finances. The author writes about how she used to strive for financial freedom, but found it too stressful: she switched her focus to financial wellness and found it to be more beneficial. Financial wellness is a journey that requires ongoing work. It involves making choices that improve your overall well-being, not just your financial situation.
  • How to Investigate When the State Conceals Data: Lessons from Belarus – Interesting article on how Belarussian’s journalists try to uncover data in their country when their own government restrict data access ofor political reasons. Following the 2020 protests and subsequent crackdown, the Belarusian government has actively hidden information on foreign trade, mortality rates, and migration statistics. This is further compounded by Belarus’s oppressive media climate, making it difficult for journalists to access crucial data. Despite these challenges, organizations like the Belarusian Investigative Center (BIC) have found ways to uncover the truth. Overall, the article highlights the resilience and resourcefulness of Belarusian journalists who are committed to exposing the truth despite the obstacles they face.
TO SEE
  • I’ve finished watching the three seasons of Locke & Key with my teenager, and we both loved it a lot! Yes, it’s different from the graphic novels, but it’s still an interesting story to follow for all these seasons. Synopsis: After Rendell Locke is murdered by former student Sam Lesser, his wife Nina decides to move with her three children, Tyler, Kinsey, and Bode, from Seattle to Matheson, Massachusetts, and take residence in Rendell’s family home, Keyhouse. The children soon discover a number of mysterious keys throughout the house that can be used to unlock various doors in magical ways. They soon become aware of a demonic entity that is also searching for the keys for its own malevolent purposes.It’s available on Netflix (for those paying for an account)
RECIPES
  • Thing I learned in cooking: Why your balsamic vinegar is likely fake. Oh wow! 😱Authentic balsamic vinegar is made in Modena and Reggio Emilia (Italy), under strict guidelines and aged for a minimum of 12 years. The balsamic vinegar sold worldwide that we know of is not authentic, often containing caramel colouring and thickeners. The producers in Modena are trying to protect the integrity of their product, and educate consumers about the difference between real and fake balsamic vinegar, creating their own label for a protected designation of origin (PDO) seal, labelled as “Aceto Balsamico Tradizionale”. Guess I’ll be looking out for real balsamic vinegar next time at the grocery!
  • Now, for a different cookie dough: Chickpea Cookie Dough with chocolate chip recipe! Yummy!
  • Last time I went to my local sport bar to take a pint, the owner of the place offered shooters to people sitting at the bar, and I was one of the lucky ones! So I had the chance to taste the Dr. McGillicuddy’s Scottish Caramel spirit, and I fucking loved it! It was soooooooo smooth to drink, I could have emptied the bottle very fast if I didn’t stopped myself…
  • Now for my sober friends, this refreshing Frozen Pineapple Margarita mocktail is simply delicious. A perfect summer drink.
  • I’m a sucker for Indian food recipes, and this one is simple yet yummy: Indian sambar. A quick and easy recipe to make on week nights when you are in a rush, and need to pass all your veggies.
TO HEAR
Quote To stay sane, I need to maintain a faith in humanity and this is hard to do when staring at screens.― Cathy Rentzenbrink, as read in the newsletter “Fairview by Ivaylo Durmonski”
TO FOLLOW
  • I’ve been following all things Punk music/local Montreal punk bands for a while now, and one of my favorite sources of new music and shows happening in town is Sewer Spewer. If you want to know all things Punk music in Montreal, you can follow the guy on a lot of social medias/on their Patreon account. One thing I love is his weekly music podcast available of MixCLoud or PunkRockRadio.ca. I encouraged them by subscribing to their Patreon page, it is worthed the 5$ a month me think!
  • Another New Yorker on YouTube that I like to follow their vlog life: Mohuya Khan. Her honest, down-to-earth, takes on life in New York City is pretty interesting, and she is a creator of intestering Indian-inspired clothes that is pretty and accessible. It gives me the cravving of wanting to live in that big cosmopolitan Metropolis and discover its vibrant cultural vibe and social environment. The only negative thing: it’s in the USA, where I am scared of living now with all their guns obsession and shootings. Oh well, I’m living vicariously through my NYC YouTubers!
DESIGN
  • One of my favourite newsletter/website, The Good Trade, has written an entire article about 99 Best Etsy shops that they loved and want to encourage. I looked at some of them on the list, and I just added so many items to my TO BUY list, it’s crazy! 😂 If you’re looking for original artisan shops that aren’t Chinese/cheap resellers stocks, this list is for you.
  • Ohhhhhh, this one will please my readers whom are fans of Web/Graphic fonts: What do you know about the islands of San Seriffe?
  • Another one about fonts, this one a multi-languages font that is pretty and versatile. You can test it, or buy it for your (web) design projects.
CYBERSECURITY WEB & TECH
  • The Sesame Street Twitter Strategy – not exactly technical, but still tech/web related, as it pertains to social medias uses and creativity, and I really loved it. This article is about the new social media strategy of Sesame Street, and how they made their characters more relatable by giving them more human personalities. The strategy involves The Muppets tweeting about their interests and responding to fans, resulting in a significant increase in engagement and positive media attention. A must-read for anyone working in digital communication, or on social medias.
  • Displaying HTML web components – I’ve played with web components creation before, having to code components that would be easy to implement on partners’ websites (like a custom header). This simple trick would have tremendously helped when I had CSS styling issues with integrating external web components in my website.
  • I’ve worked with all the main JavaScript frameworks in the past: React, Angular, Vue.js and Svelte. I don’t really have a favourite (whom am I kidding? Svelte & Angular FTW! LOL): I think each framework has its purpose depending on the type of project developers work on. Yes, React is the most popular, but I would argue that Vue.js and Svelte are the easiest ones to introduce yourself in this ecosystem. Which is why I love articles like this one: Comparing JavaScript Frameworks part 1: templates. It can give a quick overview of the differences between the framework, easing the developer’s learning curve on the subject, and giving them a basis of knowledge to start from. It discusses template languages, components, and how they are used; it has its own way of defining components and templates that achieve similar results. The author offers opinions on the strengths and weaknesses of each framework. Overall, the focus is on the similarities between the frameworks.
Share this:Like this:Like Loading… Related

# Sunday, July 28th, 2024 at 8:45pm

5 Likes

# Liked by Andrew Maier on Wednesday, April 17th, 2024 at 10:40am

# Liked by Jeff Triplett on Wednesday, April 17th, 2024 at 11:41am

# Liked by Warren Buckley on Wednesday, April 17th, 2024 at 7:36pm

# Liked by Elly Loel ✨🌱 on Wednesday, April 17th, 2024 at 10:29pm

# Liked by Jens Tangermann on Wednesday, April 17th, 2024 at 11:39pm

Related posts

Multi-page web apps

A question via email…

Progressive disclosure with HTML

The `details` element is like the TL;DR of markup.

Three attributes for better web forms

Better UX through better HTML: inputmode, enterkeyhint, and autocomplete.

Today, the distant future

2022 was once unimaginable to some web folks.

Accessibility testing

It’s not just about finding the issues—it’s about finding the issues at the right time.

Related links

Popover API Sliding Nav

Here’s a nifty demo of popover but it’s not for what we’d traditionally consider a modal dialog.

Tagged with

The 11ty International Symposium on Making Web Sites Real Good - YouTube

I wasn’t able to tune into this live (“tune in?” what century is this?) but I’ve enjoyed catching up with the great talks like:

Tagged with

a view source web

As a self-initiated learner, being able to view source brought to mind the experience of a slow walk through someone else’s map.

This ability to “observe” software makes HTML special to work with.

Tagged with

On Container Queries, Responsive Images, and JPEG-XL – Cloud Four

Container queries can’t be used in the sizes attribute for responsive images. Here, Jason breaks down why that is (spoiler: it’s the lookahead pre-parser) and segues into a truly long term solution: a “magical” image format.

If you’ve ever thought it felt weird to put media conditions inside the HTML for responsive images, this will resonate.

Tagged with

How to (not) make a button - Tomas Pustelnik’s personal website

A demonstration of how even reinventing a relatively simple wheel takes way more effort than it’s worth when you could just use what the brower gives you for free.

Tagged with

Previously on this day

4 years ago I wrote Future Sync 2020

Questions and answers from the opening talk of an online conference.

6 years ago I wrote Technical balance

Why I had two technical editors working with me on Going Offline, with opposite levels of experience.

9 years ago I wrote 100 words 026

Day twenty six.

10 years ago I wrote Fragmentions

Deeper linking for deeper thinking.

11 years ago I wrote A dao revisited

Musing on a thirteen year old piece of writing on the web.

11 years ago I wrote Responsive workshopping

A half-day workshop I did at this year’s UX London.

15 years ago I wrote Blast from the past

When rabbit holes become memory holes.

16 years ago I wrote Iteration and You

Liveblogging a presentation by Daniel Burka at The Future of Web Design.

16 years ago I wrote From Design to Deployment

Liveblogging a presentation by Jon Hicks at The Future of Web Design.

16 years ago I wrote Print is the New Web

Liveblogging a talk by Elliot Jay Stocks at The Future of Web Design.

16 years ago I wrote Photoshop Battle

Liveblogging a Photoshop tennis match at the Future of Web Design.

16 years ago I wrote Getting Your Designs Approved

Liveblogging a presentation from Larissa Meek at the Future of Web Design.

16 years ago I wrote Demo hell

The air gets sucked out of the room at The Future of Web Design.

16 years ago I wrote The User Experience Curve

Liveblogging a talk from Andy Budd at The Future of Web Design in London.

16 years ago I wrote User Experience vs. Brand Experience

Liveblogging a session from Steven Pearce and Andy Clarke at the Future of Web Design.

18 years ago I wrote Bedroll

Not a blogroll.

22 years ago I wrote A thousand words

Jeb has posted some pictures of his trip to Europe.