sentience / Kevin Yank

CTO at sitepoint.com, improviser with Impro Melbourne, general know-it-all.

There are no people in sentience’s collective.

Huffduffed (96)

  1. Keeping it simple with CSS that scales - Andy Bell

    This is the written version of my new talk, “Keeping it simple with CSS that scales”, which I first delivered at State of the Browser 2019.It’s a very long read, so I recorded an audio version, too:CSS has a weird place on the web today. There’s a lot of polarisation, with the opinion being seemingly split on “CSS sucks” and “CSS rules, learn it better, fools”.I empathise with the “CSS rules” camp and I’ll explain why: I have a theory as to why the “CSS sucks” camp have the attitude that they do. I think it’s a combination of them over-engineering their CSS, not fully understanding the power of CSS and finally, approaching it like it is a language like JavaScript and expecting it to work in the same way.What I’m going to do in this piece, is tackle the first bit and talk to you all about how we can simplify CSS to give us incredible power, while also being as low-tech as possible. The secret sauce is that most of the content isn’t actually about CSS, but that’ll all become clearer, later.Let’s talk about scale permalinkI absolutely hate it when we use the term, “Scale”. I think we are stuck with it though, just like we are stuck with “JAMstack”, “Serverless” and “performant”.They’re all equally awful words, but one thing they do is create a common, recognisable construct for communication. As much as it pained me, it’s exactly why I named this talk “Keeping it simple with CSS that scales”. You probably knew before I even opened my gob that I’d be talking about working on massive codebases, which at some point in this talk, I’ll get to.One thing that I do get pissed off about with “Scale”, though, is that gets slightly muddied when people use it as an excuse to over-engineer something.Let’s take this common example. It usually gets said by some Bay Area tech bro:We use a CSS-in-JS library because our product needs to scaleLet’s be honest for a moment, folks: most of the tepid guff that these tech bros are making will only scale as far as the bin, so it’s not much of a valid excuse, is it?I’ll also be bold and straight-up say that I don’t think using scale as an excuse for over-engineering stuff—especially CSS—is acceptable, even for huge teams that work on huge products. Keep that in mind, because I hope, by the end of this session, you’re going to be in agreement with me.Four key things permalinkI think we can focus on four key things today, and for the rest of this piece, I’m going to run us through them in detail with a little progress thing, so you know roughly how much longer you have to endure me for.I could package this up as DCCS and really mop up the upvotes on that orange website, right?Anyway, let’s dive in.Don’t panic permalinkOne of my favourite books is The Hitchhiker’s Guide to the Galaxy. It’s about the earth being blown up to make way for a hyperspace highway and our main character, Arthur Dent proceeds to hitchhike around space with his alien guide, Ford Prefect.I know, that’s a proper rubbish synopsis, but you all didn’t come here to read me chatting about this book.The actual Hitchhiker’s Guide to the Galaxy is a sort of interactive encyclopaedia—well, interactive by 1979 standards…The thing that has always resonated with me about the encyclopaedia is on the cover it says: “Don’t Panic”. The phrase is used so many times throughout the story, even when the context very much calls for panic.I find myself really resonating with Ford Prefect, guiding Arthur Dent—a bumbling brit through the understandably mind-boggling adventure in space. Ford always approaches challenges in a calm, pragmatic way, just like the guide tells him to: “Don’t Panic”, and I think that’s a takeaway for us too.In fact, when Arthur first gets the book handed to him, he says:“I like the cover…‘Don’t Panic’. It’s the first helpful or intelligible thing any-body’s said to me all day.“Right, anyway, I digress…“don’t panic”. It’s such good advice because when we panic, we make silly mistakes. Think about it: how many horrendous CSS hacks have you made when you’re up against-it in a project and you just needed to get it done.A lot of people do it and it’s because we’re panicking. The deadline is looming and there’s no time to work out why our CSS is borked, so we throw !important at it until it’s fixed.This is fine: we all do it, but what isn’t fine is technical debt. Often panic goes beyond a little hack here-and-there and escalates into something much more serious, like employing a CSS-in-JS framework, which is the equivalent of taking out a Wonga loan to pay of your house mortgage.Incredibly high interest technical debt, which frustratingly, the developers who took it out, only pay a bit off, because that developer has probably already gone and got a new job. It’s mainly the user who takes the biggest hit, in terms of performance, and this boggles my mind when you consider what we have available to us with modern CSS.The current state of CSS permalinkReally, we’ve never had it better with CSS. We have CSS Grid with 93% support and Flexbox with 98.8% support. Approach using them with a safe progressive enhancement mindset and your layout is sorted. Job done. No worries.We also get CSS Custom Properties which are native CSS variables. They’re incredibly handy for tokenising our CSS. Because they are also affected by the cascade, we can can override them, contextually. This makes them useful for theming, algorithms and display modes, such as dark mode.:root {

    —primary: #8e8e8e;}.box {

    background: var(—primary);}.badge {

    color: var(—primary);}These are just a subset of powerful new features, but you can see how modern CSS is an incredibly powerful, effective styling tool. But it can come up a bit short, especially when you do have lots of CSS. So let’s look at how we can deal with that.Sass for the win! permalinkAll of this native functionality is cool as heck, right? Let’s not forget native nesting too, but who does all of the work when we use that? Yep: the browser!In most cases, that’s fine, although the thought of native CSS terrifies me—especially when we are already kludging up the browser with heavy JavaScript frameworks.Basically, what I’m saying is we don’t have to abandon Sass because native language features are coming. It’s probably better to cautiously pre-compile your CSS and not force the browser to work as hard. It’s already working hard enough, re-rendering the DOM every time one piece of data changes (cough reactive frameworks cough), so why make it work harder just so you can have native nesting? It smells like developer experience over user experience to me.We rush to throw stuff in the bin without thinking about the wider implications. Yeh, we’ll get nesting soon, but how is a low-powered device going to handle 5 levels of nesting with chained selectors? How is a low-powered device going to handle calculating the colour of a Custom Property that has been overridden by the cascade 5 times? It doesn’t matter how good the native tools are because if we keep throwing rubbish code at browsers, the users will suffer for it.The beauty of Sass is that you can have the best of both worlds. You get cool stuff like nesting, but if you do it right, you can get nice, flat selectors. You also get components and if you want, you can set your project up to get multiple bundles. You can also lint your CSS at build time, so you know when stuff is getting out of hand, right in your terminal or GUI.The most important thing is that with Sass—well, SCSS, you’re writing CSS still. SCSS is smart enough to just do what it needs to focus on and leave the rest of your CSS alone. To me, it feels like a pretty perfect setup.Communicate permalinkWe seem to be in an era where tools and methodologies are dreamed up to help avoid communicating with each other.Generated CSS class names is a classic example of this. It’s a very typical problem. Some might at this point start having an existential crisis, or dream of machine-generated classnames, but check this out: we’re going to try this novel thing called talking:Dev #1 - Lucrecia“This component I came up with already exists. Let me have a quick look in git and see who created it. Ah, it was Isabella”Lucrecia to Dev #2, Isabella“Hey, Dev Isabella, is there a reason why this component is called ‘block’?”Isabella to Lucrecia“Ah yeh, this very important reason. How about you call that component ‘box’ instead?”Now this important reason could be anything you dream up:A stakeholder decisionA legacy codebase issueA Design decisionImportantly, Isabella, a professional, who knows how to communicate effectively, comes up with an alternative.Lucrecia“That’s a great idea. Thanks!”How wholesome was that?? It’s amazing what happens when we actually talk to each other.So-called “soft skills” which I prefer to call core skills are shunned in favour of being able to build your own linked-list or do fizz buzz on a whiteboard. This winds me up because to be an effective member of a team, you have to be able to communicate, whereas the only time you ever do fizz buzz in the real world is during that life-draining interview process…Documentation is everythingAnother incredible way to communicate that’s not actual talking is writing. I love writing and you probably noticed, I do a lot of it… In fact, I write almost everything down because I never know when I might need it. It also helps me to commit stuff to memory.There’s a real value in writing everything down—especially in a large team of front-end developers, writing CSS—or any code, really. You can document your thought-process and explain how and why you’ve done things. You can write documentation, so if another developer picks up your code, they know what’s going on.By documentation, I don’t mean that you have to write reams and reams of structured docs: I’m talking goddamn comments in your code.Take this example:.card {

    background-color: #ffffff !important;}If I landed on this I would be like “What the heck is going on here?”How about this, though?.card {/* When this card is used in the legacy app, there is

    a collision between existing styles, so unfortunately we had to go nuclear. It’s certainly a refactor target. */

    background-color: #ffffff !important;}The same goes for most CSS frameworks to be honest. An example that gives me a heart attack is Tailwind CSS generates over 40 thousand lines of CSS by default (source). Bonkers.If you have a solid methodology like BEM, ITSCSS, SMACSS or even C-BEUT, you could sprinkle a bit of a grid system with, y’know GRID, add some layout helpers with flex and you are golden.This is the approach that we took with Every Layout—a book that I co-authored with my good pal, Heydon Pickering.For our layouts, we find the most robust solution by simplifying and distilling our problem. We then hint the browser, using axioms and rudiments, rather than micro-manage it to allow it to call the shots. This results in a very solid layout system that works upwards with progressive enhancement at the forefront.It’s been a really cool project and resonated with a lot of people, so go ahead and check it out.On the subject of progressive enhancement, gather around and take a knee for a moment, everyone.Don’t dismiss modern CSS because you have to support IE11.It’s a ridiculous mindset and it pisses me off whenever someone shares a cool trick on Twitter and a Chad will pop into the comments with “WhAt aboUt IE 11 tHOuGh”.Stop trying to pixel push your designs and instead, use progressive enhancement to create a sensible default that automatically improves where support is available.Take this example: we’ve got a good ol’ three column grid. In times gone by, we’d employ some hacks not just to lay it out, but also make it look like this in every browser.What I propose is that we take a step back, simplify the problem, and find a sensible baseline, and here it is: Good ol’ stacking with space. We can achieve 100% coverage with tiny amounts of CSS now.This is a handy little grid system that uses minmax to distribute columns. It means we get a responsive grid with no media queries..auto-grid {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));

    grid-gap: 1rem;}But, grid still isn’t quite full supported, but thanks to CSS’s nature, it’ll ignore stuff it doesn’t understand and move on, so we can add this below our grid code:.auto-grid > * {

    max-width: 25rem;

    margin-left: auto;

    margin-right: auto;}.auto-grid > * + * {

    margin-top: 1rem;}Now, thanks to @supports, we can reset some of that where there is support. If a browser supports grid, it supports @supports, so job done.It’s 22 lines of CSS, with no hacks and works all the way back to IE9 (and probably beyond).See the Pen Progressively enhanced, media query-free grid by Andy Bell (@andybelldesign) on CodePen.Slow down permalinkThe last point on simplification and really, the last point of this presentation before I wrap up is “slow down”.Seriously, slow down. I know it’s hard when you are working sprint-to-sprint or on a massive project, but trust me, when shit hits the fan, just slow down.I came a cropper to this earlier in the year. I was working on a massive system/pattern library and we were hit with some early complications. What I should have done was stop, stepped back and put some critical thinking in place. But what I did instead was plough on through each sprint, each retro and each planning session until it got to the point where not slowing down had massive negative implications. I was cashing tech debt like I was earning air miles on it.We had two or three grid systems, some fluid type and some utility driven type that conflicted and a card component that was pretty much a website in itself. If I had slowed down and stepped back, I could have seen these problems, but I didn’t. So seriously, slow down and you will save so much time.I’ll leave you with this take-home advice: instead of moving fast and breaking things, move slowly and deliberately instead.You can watch me deliver this talk at State of the Browser 2019, here.You can see the slide deck from that presentation, here.

    https://hankchizljaw.com/wrote/keeping-it-simple-with-css-that-scales/

    —Huffduffed by sentience

  2. Jina Anne, Founder of Clarity Conference, on Crafting a Community for Design Systems

    If you’re engaged in any sort of community surrounding Design Systems, whether it’s the Design Systems Slack, or the Clarity Conference, then you have likely benefited from Jina Anne’s work. A self-styled Design Systems Advocate, Jina has been passionate about creating events, content and resources that bring together communities of people who care about design systems and how they impact product design. In this bonus episode of the Design Better Podcast, we chat with Jina about how she got into Design Systems, what she has learned from building these communities, and how being a hybrid designer-developer influences her understanding of Design Systems.

    Takeaways:

    • How having a Design System affects company culture. • What to consider when deciding to go public with your Design System, or keeping it private. • How Design Systems can be effectively maintained.

    ===
    Original video: https://soundcloud.com/invisionapp/jina-anne-founder-of-clarity
    Downloaded by http://huffduff-video.snarfed.org/ on Wed Dec 18 04:14:34 2019 Available for 30 days after download

    —Huffduffed by sentience

  3. 114: The Business Case for Experimentation with Elm with Dillon Kearns

    Listen to 114: The Business Case For Experimentation With Elm With Dillon Kearns and 126 more episodes by The Frontside Podcast, free! No signup or install needed. Big Ideas & The Future at The Frontside. Transparent Development.

    https://player.fm/series/the-frontside-podcast-1402166/ep-114-the-business-case-for-experimentation-with-elm-with-dillon-kearns

    —Huffduffed by sentience

  4. The Lowdown on Becoming a Foster Carer - Foster Care Week 2019 – Hope 103.2

    Kate Page, a local mum and foster carer, and Sue Madden from Anglicare joined Hope Breakfast to help them understand the importance of Foster Care.

    https://hope1032.com.au/stories/life/news/2019/whats-involved-in-becoming-a-foster-carer/

    —Huffduffed by sentience

  5. Crafting Culture by Turning Insights into Actions: Didier Elzinga

    Didier Elizinga, CEO and Founder of culture analytics platform Culture Amp, joined us on the Creative Confidence Series to talk about applying design thinking mindsets to culture and people operations, turning culture insights into actions, and making change happen from wherever you sit. Learn more about inspiring change in an organization, community, or network through movements, not mandates in our online course Designing for Change: https://ideo.to/OiXZ1q

    ===
    Original video: https://soundcloud.com/ideo_u/crafting-culture-by-turning-insights-into-actions-didier-elzinga
    Downloaded by http://huffduff-video.snarfed.org/ on Fri, 16 Aug 2019 06:43:21 GMT Available for 30 days after download

    —Huffduffed by sentience

  6. Who Cares? Ep# 6 - You Could!

    The final episode in our series of Who Cares? find out why you should become a carer.

    ===
    Original video: https://soundcloud.com/user-67039572/who-cares-ep-6-youcould
    Downloaded by http://huffduff-video.snarfed.org/ on Fri, 02 Aug 2019 02:59:31 GMT Available for 30 days after download

    —Huffduffed by sentience

  7. Who Cares? Ep#5 - Therapeutic Care

    Bonus Episode: What is therapeutic care?

    ===
    Original video: https://soundcloud.com/user-67039572/who-cares-ep5-therapeutic-care
    Downloaded by http://huffduff-video.snarfed.org/ on Fri, 02 Aug 2019 02:59:07 GMT Available for 30 days after download

    —Huffduffed by sentience

  8. Who Cares? Ep#4 - First Placement and Intake

    In episode 4 of Who Cares? we are helping first time foster carers know what to expect of their first placement and how the intake process works.

    ===
    Original video: https://soundcloud.com/user-67039572/who-cares-ep4-first-placement-and-intake
    Downloaded by http://huffduff-video.snarfed.org/ on Fri, 02 Aug 2019 02:58:10 GMT Available for 30 days after download

    —Huffduffed by sentience

  9. Who Cares? Ep#3 - Caring Families

    The third episode in the Who Cares? series for foster carers. How does it work with biological/permanent children?

    ===
    Original video: https://soundcloud.com/user-67039572/who-cares-ep3-caring-families
    Downloaded by http://huffduff-video.snarfed.org/ on Fri, 02 Aug 2019 02:57:50 GMT Available for 30 days after download

    —Huffduffed by sentience

  10. Who Cares? Ep# 2 - Home Truths

    In Episode 2 we will be debunking the myths surrounding foster care.

    ===
    Original video: https://soundcloud.com/user-67039572/who-cares-ep-2-home-truths
    Downloaded by http://huffduff-video.snarfed.org/ on Fri, 02 Aug 2019 02:57:21 GMT Available for 30 days after download

    —Huffduffed by sentience

Page 1 of 10Older