CSS {de}Coder
CSS {de}Coder
  • 9
  • 21 782
How to build an accessible accordion: easy HTML enhancements for improved keyboard support
Did you know that about 20% of people surfing the web, do so with the help of assistive technology. In any given day that could be roughly 1 billion people! According to the 2024 WebAIM 1 Million survey, an average of 56 a11y errors were found on the homepages sampled. That’s a 13% increase from the 2023 survey. SO it was no surprise to me when I came across this accordion component that was not keyboard accessible. You might be like me and work in a code base where it’s not always possible to alter HTML. So in this video I’ll show you how I updated this accordion to make it accessible, all without altering the HTML. Then I’ll show you how you can cut your coding time in half by using native HTML elements and only 6 lines of JS. So if you’re ready, fire up your favorite editor and let’s code!
WCAG Understanding SC 2.1.1:
www.w3.org/WAI/WCAG22/Understanding/keyboard.html
WCAG Understanding SC 2.5.3: www.w3.org/WAI/WCAG22/Understanding/label-in-name.html
APG Button pattern: www.w3.org/WAI/ARIA/apg/patterns/button/
Timestamps:
00:00 - Intro
00:44 - Enhancing HTML with ARIA
03:05 - Adding keyboard support via JS
05:18 - Improving accessible names
08:32 - Using the details & summary elements instead
Music from #Uppbeat (free for Creators!):
uppbeat.io/t/moire/new-life
License code: SOE1S7L5DZHTBUOJ
Переглядів: 208

Відео

5 useful tips to help you improve your CSS TODAY!!
Переглядів 1,7 тис.4 місяці тому
Writing CSS can be tricky-getting everything to look just right across different browsers and devices is no small feat. But don’t worry, I’ve got you covered! In this video, I’ll share my top 5 tips and techniques to make your CSS cleaner, more efficient, and easier to maintain. Let’s code! 🔗Links & Resources: CSS Nesting: developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting/Using_CSS_nesting c...
Animating between states is SUPER EASY thanks to the View Transition API!
Переглядів 7 тис.5 місяців тому
The View Transition API allows developers to easily create custom transitions between different states and pages. Smooth transitions improve the user experience by reducing the effort needed to navigate, by making pages feel faster and more responsive, and can help users understand where they are within your site. In this video, I’ll demonstrate how to leverage the crossfade provided by the API...
Boost accessibility with progressive enhancements for tabs | HTML, CSS, & JS
Переглядів 4077 місяців тому
Creating accessible tabs can seem a bit daunting. The best approach is to start out with a strong foundation of semantic HTML and layer in progressive enhancements as you go. Building for inclusion ensures your projects provide the best experience to as many people as possible. Links & Resources GitHub repo: github.com/Alliemack77/accessible-tab-interface ARIA APG: www.w3.org/WAI/ARIA/apg/patte...
How to build a responsive layout with HTML, CSS, & JavaScript | Part 3: Article section
Переглядів 7069 місяців тому
Building responsive websites that look beautiful on every screen has never been easier! In this 3 part mini-series, I’ll show you how to build this Frontend Mentor landing page from scratch. In this video, I'll use a flexible grid to build the last section - the list of articles. So if you're ready, fire up your favorite editor, and let’s code! Links & Resources Github repo for Part 3: github.c...
How to build a responsive layout with HTML, CSS, & JavaScript | Part 2: Hero layout with subgrid
Переглядів 4089 місяців тому
Building responsive websites that look beautiful on every screen has never been easier! In this 3 part mini-series, I’ll show you how to build this Frontend Mentor landing page from scratch. In this video, I'll use CSS grid and subgrid to build a flexible hero section. So if you're ready, fire up your favorite editor, and let’s code! Links & Resources Github repo for Part 2: github.com/Alliemac...
How to build a responsive layout with HTML, CSS, & JavaScript | Part I: Accessible navigation menu
Переглядів 2,3 тис.9 місяців тому
Building responsive websites that look beautiful on every screen has never been easier! In this 3 part mini-series, I’ll show you how to build this Frontend Mentor landing page from scratch. In this video, I'll use CSS Grid to build a flexible and accessible navigation menu. So if you're ready, fire up your favorite editor, and let’s code! Links & Resources Github repo for Part 1: github.com/Al...
CSS Only Scroll Animations Are AMAZING!
Переглядів 8 тис.11 місяців тому
CSS-only scroll animations are here! The new CSS animation-timeline properties make it easy to create scroll-linked animations without using Javascript! This CSS tutorial will show you how to use these new properties and how to create a cool 3D transformation! So in the words of the Doctor himself, Allons-y!! Can I use...animation-timeline: caniuse.com/?search=animation-timeline animation-timel...
Build flexible layouts (without wrapper classes) using CSS Grid
Переглядів 855Рік тому
Wrapper classes are great for centering content and controlling width, but what happens if you get a design that requires the content to spill outside the wrapper to the edge of the viewport? In this video tutorial, I recreate the function of a wrapper class using a 4-column grid. Finished code: codepen.io/alliemack/pen/KKEPaKb?editors=1100 GitHub repo: github.com/Alliemack77/alternatives-to-th...

КОМЕНТАРІ

  • @СветланаГруздева-л7ю

    If you click on the content in the panel, the tab closes. Can this be fixed?

  • @sai_charan
    @sai_charan 19 днів тому

    Thank you, Allison!

  • @thanatosofthefuture
    @thanatosofthefuture 23 дні тому

    This is some excellent a11y content. You nailed the what and why in a very compelling structure that is easy to follow and comprehend. What I appreciate the most is that you're using real world examples that tackle most accessibility concepts in a way that can be applied to other component like markup as well. Keep up the good work and I am looking forward to more great content from you.

    • @CSSdeCoder
      @CSSdeCoder 23 дні тому

      Much appreciated! I'm trying to bring more attention to accessibility, glad to hear you found it useful.

  • @SethMitchell-b6m
    @SethMitchell-b6m 24 дні тому

    Very very cool content. Something people have ignored for too long. Great job!

    • @CSSdeCoder
      @CSSdeCoder 24 дні тому

      Thanks! I'm hoping to bring more attention to accessibility.

  • @clevermissfox
    @clevermissfox 26 днів тому

    Love the a11y content ! Would be great to see it built properly from the start , not with everything as divs and then adding roles as needed. When following the recommended pattern on the aria authoring practices guide, I get so confused why it says not to use in production environments. I have seen another pattern since you mentioned JavaScript not loading, where they make the heading and use a link instead of a button that’s set to the panel on question; in case the JavaScript doesn’t load. But then they have to either replace the <a> with a button on the DOM or I guess give the <a> a role of button ? But at least the content is accessible if the JavaScript doesn’t load , it’s not hidden away and it’s still linked to as well as arja-labelledby the heading piece. Luckily we will have support to customize and animate the details/summary soonish!!! Fun to play with on chrome in the meantime !

    • @CSSdeCoder
      @CSSdeCoder 26 днів тому

      Hi @@clevermissfox ! I went back and forth about building an accessible accordion from the start. I work with a legacy codebase where I can't always alter the HTML. I thought it would be more beneficial to document the process of adding enhancements since many people may be in a similar situation. Plus there are already tons of tutorials on how to use the details and summary elements. Anytime you add aria, you should be testing for usability. That was something I didn't mention in the video, and the reason why the APG patterns are only suggestions. They assume you will be testing for usability and therefore may find a better pattern based on your testing. The APG is a great place to start, but ultimately the results of your testing will always be the deciding factor. Thanks for watching!

  • @blokche_dev
    @blokche_dev 26 днів тому

    Great to see some content taking accessibility into account. I would not add the "toggle" at the start of the name of the button however. For users using speech recognition software, it may be difficult to find buttons by their name I think. It needs test, for sure! Oh! and you will be able to use the details element with the same name attribute soon enough to create exclusive accordeons :)

    • @CSSdeCoder
      @CSSdeCoder 26 днів тому

      @@blokche_dev that's a great point and something I forgot to mention in the video is that usability testing is a huge part of building for a11y. Thanks for the suggestion!

  • @vsueiro
    @vsueiro Місяць тому

    Wow, thank you so much! I actually have a practical idea of how to implement it! Google’s video was nice but I couldn’t really follow along

  • @PicSta
    @PicSta 2 місяці тому

    Probably the best tabbed content with accessibility approach. Please more a11y content like this. Thanks for the detailed and well produced tutorial. Liked and subscribed.

  • @PicSta
    @PicSta 2 місяці тому

    Excellent tutorial and straight to the point. Short and practical at same time. The only thing I would improve here, the use of named grid lines rather than column numbers. This why you could define full width, content width and something in between if necessary or a breakout width.

  • @rolobuilds
    @rolobuilds 2 місяці тому

    Excellent explanation!

  • @ozgurNY
    @ozgurNY 3 місяці тому

    Thank you!! Your explanation is great!

  • @AlThePal78
    @AlThePal78 3 місяці тому

    I have a question with clamp, if it is a mim what you want and max why don't it have 2rem, 5rem, 7rem instead of 2rem, 4vw, 5rem that is confusing to me

    • @CSSdeCoder
      @CSSdeCoder 3 місяці тому

      Hi @AlThePal78, great question! I'm using viewport units (vw) to ensure that the font size scales with the viewport - 1vw is roughly 1% of the viewport width. If clamp is set to: clamp(1.5rem, 4vw, 3rem) - in a 400px wide viewport the preferred value evaluates to about 16px or 1rem. Since this is less than the minimum, the minimum will be used. If the viewport is 1440px wide, then the preferred value evaluates to about 58px. Since this is larger than the max, then the max value will be used. Units like rem and em are only relative to their parent element's font size (em) or the font size of the root-em (rem) and won't scale with the viewport. Hope that helps!

  • @DevJasper
    @DevJasper 3 місяці тому

    Your videos are the best! Super clear and helpful, thank you!

  • @OlamideOnabiyi
    @OlamideOnabiyi 3 місяці тому

    This helped me today 😁

  • @CSSdeCoder
    @CSSdeCoder 3 місяці тому

    Forgot to add the final result of the container query enhancement 🤣Find the final code here: codepen.io/alliemack/pen/ExqxEgw

  • @fastechx
    @fastechx 3 місяці тому

    Great video! but i think in container query section you forgot to show the final result of the applied style.

    • @CSSdeCoder
      @CSSdeCoder 3 місяці тому

      Hi @fastechx! Glad you liked the video and thanks for letting me know! Check the pinned comment above, I've added a link to Codepen with the final code!☝

  • @PixelInsight-vu5yd
    @PixelInsight-vu5yd 4 місяці тому

    I just watched most of your videos, great work, great structure in your video's. And yes please, i love this deep dive with accessibility and such, don't shy away from it.

    • @CSSdeCoder
      @CSSdeCoder 4 місяці тому

      Awesome! Good to know that more videos on accessibility would be helpful. Glad you found this useful and thanks for watching!

  • @nickwoodward819
    @nickwoodward819 4 місяці тому

    Not finished the video yet, but I'm 100% sure it's waaay better than google's docs on the topic, so thanks! Just some feedback if it helps - an intro might help your videos feel a bit less... I can't put my finger on it - AI like? Formal? Like the start of an ad? Perhaps it's an issue of it being *too* clean and well presented. I dunno, but it took me to the coding part to think 'oh, this might be her real voice/it's not an AI voiceover'. Don't take it the wrong way, looking forward to the rest of the video!

    • @nickwoodward819
      @nickwoodward819 4 місяці тому

      Finished it. MUCH better than Google's docs, thanks!

    • @CSSdeCoder
      @CSSdeCoder 4 місяці тому

      Thanks for the helpful feedback @nickwoodward819 and so glad you found it useful! I do write my own scripts and record myself reading from them, so I agree it can sound a bit formal sometimes. It's something I'm working on improving. Thanks for watching!

    • @nickwoodward819
      @nickwoodward819 4 місяці тому

      @@CSSdeCoder It was really only the intro that I felt it, the rest was perfect!

  • @corben3348
    @corben3348 4 місяці тому

    very good !

  • @yousefosman8094
    @yousefosman8094 4 місяці тому

    Once this transition is more widely supported, GSAP is gonna take a heavy hit

  • @WPCookie
    @WPCookie 5 місяців тому

    I wish the screen was zoomed in a bit more; it's difficult to see the code you're typing.

    • @CSSdeCoder
      @CSSdeCoder 5 місяців тому

      Hi @WPCookie! Thanks for the feedback, I'll keep that in mind for the next video. In case you missed it, here is the link to the code on GitHub: github.com/Alliemack77/view-transitions-photo-gallery

  • @EduardoRiganelli-h4s
    @EduardoRiganelli-h4s 5 місяців тому

    Thanks for sharing this!!

  • @hakiinep
    @hakiinep 5 місяців тому

    Your teaching style is truly engaging and insightful! I love how you break down complex topics into easy-to-understand concepts.

    • @hakiinep
      @hakiinep 5 місяців тому

      If you could create more projects that explain JavaScript concepts in detail, that would be fantastic!

    • @CSSdeCoder
      @CSSdeCoder 5 місяців тому

      Hey @hakiinep ! So glad these videos are helpful! Breaking down these new features also helps me understand what's going on under the hood. Let me know what concepts you'd be interested in seeing. Thanks for watching!

  • @coder_117
    @coder_117 5 місяців тому

    I don't know what's more impressive your video quality or your clear understanding of the tools that you're using. Excellent video.

    • @CSSdeCoder
      @CSSdeCoder 5 місяців тому

      Thank you so much!! Happy that you found this useful!

    • @clevermissfox
      @clevermissfox 5 місяців тому

      I've been soo excited about this API since I first tried it last fall. Now it can work cross-pages too! When will we get production level support 😭 Firefox I'm looking at you!

    • @CSSdeCoder
      @CSSdeCoder 5 місяців тому

      @@clevermissfox I agree! This API is so much fun to experiment with, I'm only scratching the surface here. It will be great once it's fully supported, but at least we can provide a fallback for Firefox. Thanks for watching!

  • @anon00s
    @anon00s 6 місяців тому

    loved the videos ありがとう!

  • @VirendraBG
    @VirendraBG 6 місяців тому

    You have earned a subscriber. 👍🏻

    • @CSSdeCoder
      @CSSdeCoder 6 місяців тому

      Awesome, thanks! Glad you found the video helpful!

  • @guicercal
    @guicercal 7 місяців тому

    not only CSS but this is really nice!

    • @PicSta
      @PicSta 7 місяців тому

      Exactly, the title is a bit misleading here. Although, with a bit of tweaking to have two states, you could use a checkbox with checked and unchecked status to achieve the same effect without JS.

  • @graham0
    @graham0 7 місяців тому

    Such a high quality video! You deserve more views on this :)

  • @Opama-devlogs
    @Opama-devlogs 7 місяців тому

    How do you only have 450 subs criminally underrated

    • @CSSdeCoder
      @CSSdeCoder 7 місяців тому

      Thanks for watching @opamaah! Hope you found the video useful!

  • @SpoorloosDev
    @SpoorloosDev 8 місяців тому

    Subscribed just because you're a doctor who fan

  • @ab_tech532
    @ab_tech532 8 місяців тому

    Thanks but little bit hard😄😄

  • @blackknight9025
    @blackknight9025 8 місяців тому

    This was great. A lot I didn't know and have to practice. Thank you ❤

  • @blackknight9025
    @blackknight9025 8 місяців тому

    You are great. I didn't plan watch this far at this moment because I have school work to catch up on but these are addictive. You make it look easy.

  • @houssamijjaali2143
    @houssamijjaali2143 8 місяців тому

    thanks 🙏

  • @lowEndAppsAndGames
    @lowEndAppsAndGames 8 місяців тому

    😅 very advance

  • @melodium10
    @melodium10 8 місяців тому

    Somehow, UA-cam recommended this to me and I'm happy it was worth it! This look awesome, and maybe there will be use cases where I may use this!! Thanks for the video :)

    • @CSSdeCoder
      @CSSdeCoder 8 місяців тому

      So glad you found this useful! CSS has so many great features, it's fun to play around with all the new ones like scroll timelines!

  • @MatheusSilva-qm3ph
    @MatheusSilva-qm3ph 9 місяців тому

    Top!

  • @greekplayback
    @greekplayback 9 місяців тому

    Thanks gitlhub url not exists :)

    • @CSSdeCoder
      @CSSdeCoder 9 місяців тому

      Hi @greekplayback! Thanks for catching that - the link should be working now. I forgot to switch the repo to public before publishing the video 🤦‍♀

  • @samsiddique4751
    @samsiddique4751 10 місяців тому

    which theme you are using ?

    • @CSSdeCoder
      @CSSdeCoder 10 місяців тому

      Hi @samsiddique4751! No themes, just HTML and pure CSS!

    • @PicSta
      @PicSta 2 місяці тому

      @@CSSdeCoder I think the VSC code theme is meant.

  • @roblesrt
    @roblesrt 11 місяців тому

    Thanks for sharing! This is what I am looking for. Please keep on going. :)

    • @CSSdeCoder
      @CSSdeCoder 11 місяців тому

      Glad you liked it! More to come...stay tuned!

  • @coder_117
    @coder_117 11 місяців тому

    This is really great. I love the animations in your video. It makes it really easy to follow along & understand what's going on. Definitely subscribing. Can't wait to see future videos.

    • @CSSdeCoder
      @CSSdeCoder 11 місяців тому

      Glad it was helpful!

  • @tomaszdubois9562
    @tomaszdubois9562 11 місяців тому

    Great video. Waiting for more! Love your website 😁

    • @CSSdeCoder
      @CSSdeCoder 11 місяців тому

      Working on it! Stay tuned! 😁

  • @brainlessmilkbag
    @brainlessmilkbag 11 місяців тому

    You said allons-y as if you spoke french that was cute

    • @CSSdeCoder
      @CSSdeCoder 11 місяців тому

      Haha, apologies if you are a native French speaker! I'd like to say "Yes, I do speak French" but that was my nerdy David Tennant, Doctor Who reference. Thanks for watching!

  • @zemonte
    @zemonte 11 місяців тому

    Muito bom. Obrigado

    • @CSSdeCoder
      @CSSdeCoder 11 місяців тому

      Glad you liked it. Thanks for watching!

  • @shohanredwan
    @shohanredwan Рік тому

    Wow. Great and clear instruction. Quite a handy thing for regular CSS crafters.

    • @CSSdeCoder
      @CSSdeCoder Рік тому

      Thanks so much! Grid is such a handy tool to have in your CSS toolbox.