Best Practice for Creating Custom Elements

It looks like custom elements, and web components in general, are beginning to break through into general developer consciousness, as I see more and more articles and talks discussing what they are, what they are good for, and how to make them.

As they’re not yet being used heavily in development, however, I think there’s a good opportunity to define best practices in the way we use them. In this post I want to propose a best practice method for writing custom elements: I’ll do that by comparing two methods for creating custom elements, along with the advantages and drawbacks of each.

Aside: it strikes me that I haven’t written about custom elements here on my own blog, despite having given a few talks and written a few published articles on the subject. In case you’re not sure what they are, I recommend you read my Detailed Introduction To Custom Elements first.

Read the full article


The Thoughtful Web #9: Teens, Things and TMI

This is the latest of my semi-regular collections of links to the best writing about the web and technology, information, soci­ety, science, and philo­sophy. I also send this out as an email newsletter, a format better suited to the ‘slow web’ ethos I’m trying to support. If you agree, you can subscribe to the newsletter.

The Links

I promise I’ve read every single one of these, and can recommend them all.

The Interface Layer: Where Design Commoditizes Tech
Scott Belsky makes the case that the future of digital services lies in building a simple interface over convenient utilities and services — a reverse of the atomisation of apps and services we’re currently seeing.

Mobile First
No, not that mobile first. This is Ben Thompson’s theory that we’re seeing a shift where products and services — online and physical — are undergoing changes driven by smartphone culture. Based on some speculation about an unannounced product, but pretty sound theory nonetheless.

Technology Has Made Life Different, but Not Necessarily More Stressful
A study indicates that frequent internet and social media users are no more stressed than those who use technology less often, and some women even show a reduction in stress when using digital tools. By Claire Cain Miller. I love seeing data that goes against the general narrative.

The Internet of Things needs a few SMACS
Scott Jenson lays out the requirements for the ThingNet, and it’s more than just the things and a standard protocol.

Europe is Wrong to take a Sledgehammer to Big Google
Search becomes more useful the more it knows about you, and forcing a breakup of Google would make all of its services less useful. Evgeny Morozov argues that what we need is not to hobble big services, but to provide data regulations to allow thousands of smaller companies to compete.

Read the full article


The Elements of a Good Conference Talk

Recently on Twitter a few people, myself included, had a short conversation about what we like to see in conference talks, prompted by Sara Soueidan’s question:

I’ve been wasting a lot of time lately trying to decide which talk topic to do at which conference. Any tips, fellow speakers?

Read the full article


Thoughtful Web #8: The Only Way is Ethics

A special, short, pre-Christmas newsletter / link dump, with a handful of articles on morality and ethics. Concepts for us to mull over with mulled wine; problems to be resolved in our New Year’s resolutions.

Technology and the Moral Dimension
Om Malik on the emerging technology sector’s lack of understanding of moral imperative, and the need to add an emotional and/or moral dimension to the products we make. We disagree on the need for regulation.

Do Artifacts Have Ethics?
Following on from Om’s post above, Michael Sacasas poses some questions we might ask in order to define the moral dimension of products, if one exists.

Collaborative Economy Companies Need To Start Sharing More Value With The People Who Make Them Valuable
That title pretty much says it all. Lisa Gansky on why the ‘sharing economy’ favours the platform owners over the participants.

Socialize Uber
Further to the link above, more discussion of how the ‘sharing economy’ creates a low-wage workforce under the control of tech companies. By Mike Konczal and Bryce Covert.

When data gets creepy: the secrets we don’t realise we’re giving away
Dr Ben Goldacre on the leakiness of our personal data, and the ethics of revealing how much organisations know about you.


Thoughtful Web #7: Identity, Privacy, and Society

For a few months now I’ve been sending a semi-regular email newsletter containing links to some of the most interesting medium-long articles I’ve read, on the subject of society, technology, philosophy, culture, and the web. A few people requested that I also publish it in blog form, so as of now you can choose to read The Thoughtful Web here, or get it in your inbox. Personally, I prefer email, it more closely captures the ‘slow web’ ethic I’m going for; if you agree, why not subscribe?

The Links

I promise I’ve read every single one of these, and can recommend them all.

Hypertext as an agent of change
On the nature of the web, and what its shareable nature means for the future of communication. Transcript of a talk by Mandy Brown.

The Group That Rules the Web
Paul Ford explains how web standards are forged, between the W3C and the WHATWG. Intended for a non-technical audience, it’s also a decent refresher for those of us working in the field.

The Secret Life of Passwords
Fascinating look at why and how we use passwords, and what they say about us. By Ian Urbina. Personally I find passwords a pain in the backside and would like to see them disappear.

Thoughts on Google+
That title really doesn’t do the article justice; it’s more broadly thoughts on privacy, digital identity and reputation, and the undelivered promise of Google+. By Chris Messina.

Who pays for us to browse the web? Be wary of Google’s latest answer
Evgeny Morozov on Google’s experiment to allow users to pay to remove ads, tracking user behaviour to make digital assistants, and the web’s tendency towards neoliberal systems.

The Programmer’s Price
Lizzie Widdicombe on the Hollywood agency that’s representing coders. Part of me thinks this smells funny, as it propogates the ‘rockstar’ paradigm. On the other hand, why shouldn’t key workers be better rewarded?

Beacon, oh Beacon, wherefore art thou Beacon?
One of the architects of Google’s new ‘physical web’ idea, Scott Jenson, talks about maintaining control over privacy in a world of low-cost ubiquitous Bluetooth beacons.

The Best

My favourite article since the last newsletter.

God’s Lonely Programmer
For 10 years, a programmer with schizophrenia has been building an operating system to communicate with his god. Jesse Hicks writes a thoughtful piece on obsession and mental illness.


Please Welcome The Book of CSS3, Second Edition

Today I was very excited to open a package and find fresh-off-the-presses copies of The Book of CSS3, Second Edition. Which inevitably leads me onto this: I’m very pleased to announce the release of The Book of CSS3, Second Edition. Fully revised and updated from the first edition, with two new chapters, many more completely rewritten, new illustrations throughout, and every chapter edited to include the most up to date information on browser support and changes to the spec. It took me as long to write the second edition as it did the first!

The book covers: media queries; selectors; fonts, text and typography; backgrounds and borders; color, opacity and gradients; transformations; transitions and animations; multiple columns; flexbox; grid layout; and new chapters on values and sizing, and blending, filters, masking and clipping.

When I started work on The Book of CSS3 some four and a half years ago(!), support for the various CSS3 properties across browsers was spotty and inconsistent. This meant that it was necessary for the book to detail the many implementation differences and quirks, which had the unfortunate knock-on effect of making the book date faster than it might have otherwise. In the years since, however, support has become much more standardised and consistent, so I could concentrate on making the second edition much more stable and future-proofed.

You can buy The Book of CSS3, Second Edition direct from No Starch Press — every print copy comes with free eBook. Alternatively, you can buy the print copy from Amazon (US or UK), or the print or eBook from O’Reilly.

Update: This weekend (from 7th November) get a 30% discount when you buy direct from No Starch. The eBook and paperback bundle for under $25! Use the code STYLIN at checkout.


Archive by category and date