How to Create Cards in Oxygen Properly (Updated & Accessible!)

Sdílet
Vložit
  • čas přidán 28. 07. 2024
  • This is an advanced tutorial, but if you follow it you'll be able to create structurally organized and accessible card components better than 90% of web developers.
    This is the type of tutorial I'd normally publish in my Inner Circle, but because it's an update of a previous tutorial I published, I'm making it free to everyone.
    You can get more info and join the Inner Circle here: digitalambition.co/inner-circle/
    You can purchase Automatic.css here: automaticcss.com
    You can purchase WPCodeBox here: geni.us/uu8jqqf
    In this tutorial:
    0:00 Intro
    01:04 Example Cards
    02:07 Creating a Grid for the Cards
    03:38 Article Tags vs List Items
    09:08 Planning the Card Structure
    10:23 Creating the General Card Structure
    23:42 How to Use CSS Custom Properties
    30:11 Controlling Aspect Ratio of Media
    36:28 Proper DOM Structure for Media Placement
    39:06 Accessible Icon Links
    49:38 How to Link Cards Properly
    55:55 Adding a Hover Style to the Card
    58:42 Setting Keyboard Focus Properly
    01:04:25 Testing With Apple Voiceover
    01:05:08 Setting Equal Heights Properly
    01:09:30 Review

Komentáře • 126

  • @eucalyptech
    @eucalyptech Před 2 lety +1

    Impressive ! So many golden nuggets in a 72 minutes tutorial ! Thank you Kevin !

  • @FernandoArbex
    @FernandoArbex Před 2 lety +3

    Outstanding. This is just those kind of tutorial that elevates our work.
    Thank you a lot Kevin.

    • @slddive9025
      @slddive9025 Před měsícem

      Elevates and boosts our work in this realm?

  • @interculturalcommunication3889

    Great tutorial from the man teaching Oxygen WebDevs to build accessible websites.
    Thanks Kevin!

  • @winwinis3483
    @winwinis3483 Před 2 lety +1

    fantastic tutorial. Thanks. Got to do some work on my cards now.

  • @craiggrella
    @craiggrella Před 2 lety

    This tutorial has everything I was wanting from the first one you did. And I can see how the code box with sass makes this much easier to get right.

  • @andrew.schaeffer4032
    @andrew.schaeffer4032 Před 2 lety

    Wonderful thank you. Great timing too, as I'm building some cards right now

  • @TinyTechTalks
    @TinyTechTalks Před 2 lety

    Great video as always! Definitely a great motivator as well to dive deeper into accesibility.

  • @IssaKhlief
    @IssaKhlief Před 9 měsíci

    Kiven, it doesn't matter how many of the tutorials you created I watch. I am always amazed how many details you pay attention for, and on the new information I get ❤

  • @bluefuzecom
    @bluefuzecom Před rokem

    This is top notch. Nice work!

  • @sumerianbrother
    @sumerianbrother Před 2 lety

    Geezz... so many GEMS in here! TYTYTY Absolutely amazing stuff! Thnks Kevin, your work is most appreciated. Cheers.

  • @brusbezerra
    @brusbezerra Před 2 lety

    Incredibly valuable content!

  • @brucetunkel
    @brucetunkel Před 2 lety

    Excellent tutorial!

  • @zdenekholy2634
    @zdenekholy2634 Před rokem

    Very nice & informative video. Thank you for unveiling all the new CSS that I had no clue that exists :) ... thanks a lot.

  • @daansitters3531
    @daansitters3531 Před 2 lety

    Excellent tutorial, thank you! Greetings from the Netherlands

  • @rubengarciajr
    @rubengarciajr Před rokem

    i never knew cards were so complicated. so good, about to follow along to improve my skills!.

  • @hakira-shymuy
    @hakira-shymuy Před 2 lety

    GJ Kevin
    keep them coming,

  • @sadhonkumar8313
    @sadhonkumar8313 Před 2 lety

    Outstanding....

  • @thorsten-roever
    @thorsten-roever Před 2 lety

    Thanks

  • @omerta3393
    @omerta3393 Před rokem

    Great Great stuff thank you for sharing

  • @franciscojuan3056
    @franciscojuan3056 Před 2 lety +5

    Informatief. Het is triest dat veel mensen hun kapitaal verliezen door gebrek aan kennis van het vak of gebrek aan discipline. Dit was mijn geval totdat ik de heer Gerard stuks vorig jaar op een conferentie ontmoette, het is nooit te laat om te beginnen.

    • @sofiaelena7816
      @sofiaelena7816 Před 2 lety +5

      Het is mogelijk om winst te maken met handelen en beleggen als je de juiste bron volgt en een mentor hebt om je te adviseren over de te nemen stappen en acties. Ik doe ook mijn investeringen via het Gerard's platform en het is zeer gunstig voor mij geweest.

    • @paulalaura5615
      @paulalaura5615 Před 2 lety +4

      Ik besloot toen ik veel getuigenissen van verschillende investeerders over Gerard stuks begon te zien, ik besloot hem eens te proberen en zie, hij was degene naar wie ik al die tijd op zoek was, handelen met hem was zo lucratief, leerzaam en winstgevend.

    • @lolajulia6862
      @lolajulia6862 Před 2 lety +3

      Kun je me de contactgegevens van Gerard geven?

    • @franciscojuan3056
      @franciscojuan3056 Před 2 lety +2

      Hij is actief op Telegram.

    • @franciscojuan3056
      @franciscojuan3056 Před 2 lety +2

      Gerardstukes is zijn actieve tag

  • @martinboisclair4104
    @martinboisclair4104 Před 2 lety

    Like it a lot very great lessons Kevin :)

  • @michelecardinali2988
    @michelecardinali2988 Před 2 lety +1

    Congratulations Kevin! Very interesting and a good cue to take over some sites to make them more accessible. The class you use to hide the social text, what parameters does it have? Just to apply it on some sites. Thanks

  • @DesignwithCracka
    @DesignwithCracka Před 2 lety +6

    Great lessons Kevin. How would you differentiate between adding a hidden text to the icon and adding aria label, which will also be read out on focus? One way I think your method of adding a hidden text is better is the use of dynamic data for the text, because Oxygen's Attributes doesn't allow prepending or appending text to dynamic values.

    • @Gearyco
      @Gearyco  Před 2 lety +7

      Aria labels aren’t always read consistently and they don’t have support for translation. Hidden text is almost always preferable.

    • @DesignwithCracka
      @DesignwithCracka Před 2 lety

      @@Gearyco great point especially for translation!

  • @christophepasquier9939

    So instructive! When I set the image to order:-1 it messes with the owl spacing of the parent element, so I had to manually set gap instead like in the tutorial.

  • @dahunsi
    @dahunsi Před 2 lety +1

    Another great tutorial Kevin. I think you missed the fact that you can add all the 'alt text' for the 'media' in the media library. They will display in O2 and other builders without having to use the attributes tag.

    • @dahunsi
      @dahunsi Před 2 lety

      I believe this can also be used for dynamic data. That will take out the steps of having to copy names for accessibilty.

    • @Gearyco
      @Gearyco  Před 2 lety +3

      Yeah, the problem with that, though, is that sometimes we use the same image on different pages, but we alter the alt text for SEO purposes. If the alt is pulled from a single global field, that's a big limitation.

  • @karolmot7099
    @karolmot7099 Před 2 lety

    I would see Kevin's review of Breakdance with the enigmatic / mysterious title "Breakdance - He bet not on this card" :)

  • @TheTrentmoller
    @TheTrentmoller Před 2 lety

    As usual a great thanks, I improved so fast from you @kevin. I have a question amore bout accessibility.
    If we used for card tag is it a good accessibility practice to add a and a (using custom tag) ?
    Best regards

  • @emadhosen
    @emadhosen Před rokem

    Thank you Kevin for this tutorial. I have watched a most recent tutorial of you (I guess it was the BEM video) and I think you gave the job title an HTML tag of but in this video (which is more detailed) you gave the job title a tag. So which one is the best practice then? TIA

    • @Gearyco
      @Gearyco  Před rokem

      It should ideally be a paragraph tag.

  • @zac8670
    @zac8670 Před 2 lety

    With contained elements like cards, I tend to set everything to "em". This way, the entire card design scales based on the font size of the entire card, whether set or inherited.
    The ratio between the font size of the heading to the tagline is then set and consistent.

    • @Gearyco
      @Gearyco  Před 2 lety +2

      Whatever works for you. Em for fonts can sometimes provide unintended results.

  • @Kal-el23
    @Kal-el23 Před 2 lety

    I feel like I’m looking at myself from another universe lol. You and I actually look a lot alike and watching this video it’s funny you mention you used to be a photographer, as was I and then began focusing on the web development/design. Small world.

  • @kappesante
    @kappesante Před 2 lety

    love

  • @BradtheWest
    @BradtheWest Před 2 lety

    Thanks for your work, excellent as always. A question: won't it be confusing editing the css in both oxygen and in wpcodebox? If you want to edit the value later, you won't know whether you check oxygen editor or wpcodebox (or even automaticcss).

    • @Gearyco
      @Gearyco  Před 2 lety +1

      If you look at the CSS I wrote, it's not possible to do with the Oxygen builder. I only write CSS when it's not possible or practical to add the styling in Oxygen.

  • @vasko456
    @vasko456 Před rokem

    Wow. This is a game changer. Great video Kevin. Is there any way you can post a snippet of the codes you wrote or make a video on how do I find these codes? I'm totaly beginner in this field.

    • @Gearyco
      @Gearyco  Před rokem +1

      I'm going to do a blog post write-up for easy reference.

    • @vasko456
      @vasko456 Před rokem

      @@Gearyco Thanks, Kevin. I will keep an eye on that blog post and your upcoming videos.

  • @abdullazubair
    @abdullazubair Před 2 lety

    Thanks this is great. Any tips on how can I make an oxygen repeater element to "ul"? As when I select repeater there is no option for custom tag.

  • @badinpattamasirikul1287

    Thank you Geary for another very good video tutorial. I'm interested in start learning about Accessibility. Any suggestion where to start?

  • @mannytovar2343
    @mannytovar2343 Před 2 lety

    Hey Kevin, great tutorial!
    Is the hide--accessible class already available on ACSS? I'm not seeing it on my version.

    • @Gearyco
      @Gearyco  Před 2 lety +1

      No, it’s in the version that comes out this month.

    • @emanuelt6333
      @emanuelt6333 Před 2 lety

      @@Gearyco Gotcha. Keep up the great work.

  • @mikesam7258
    @mikesam7258 Před 2 lety

    I found out WPCodeBox place custom css file before Oxygens css files in so there is a problem with specificity when I want to edit default oxy css styles. How do you fight with that?

    • @Gearyco
      @Gearyco  Před 2 lety

      What styles are you trying to override with codebox that are already in oxygen?

  • @davidvanaarle4253
    @davidvanaarle4253 Před 2 lety

    Another great tutorial, thank again. Regarding the aspect-ratio. On mobile (tested version iOS 14.8.1) it doesn't work. The image returns in the browser with it's original aspect ratio. At least in b mobile browser - Brave, Firefox, Chrome and Safari. Just curious how do you guys handle this? Ignore, or make the image the correct aspect-ratio on forehand? Ignoring is not an option for me. Or do you have another option?

    • @Gearyco
      @Gearyco  Před 2 lety +1

      If you're on a device/browser that doesn't support aspect ratio then you'll want to implement a fallback or a different method. I just checked it on iOS Brave and it's working, though.

    • @davidvanaarle4253
      @davidvanaarle4253 Před 2 lety

      @@Gearyco thnx for looking into this. After updating from 14.8.1 to 15.5 it works on all browser which I had tested before.

  • @simonepagnini6735
    @simonepagnini6735 Před rokem

    Great tutorial! Thanx! I cannot understand what you're writing for the image the code is %__headshot, right? I am trying to make this card to show blog posts in home page but the aspect ratio it's not working (I used others class names but it seems to be ok)

  • @AndreDaniel_DTC
    @AndreDaniel_DTC Před 2 lety

    When I assigned the " li" tag to the team card, there was a dot that appeared and messed with the layout.

    • @Gearyco
      @Gearyco  Před 2 lety

      You just have to set list-style to none.

  • @DudeWithADrone
    @DudeWithADrone Před 2 lety +1

    This is awesome Kevin. However I must have missed something as I'm getting the bullet between my cards that you usually get with a list item in an unordered list. You didn't seem to get one when you did it. Any ideas Kevin?

  • @gdseosydneysolutions
    @gdseosydneysolutions Před 2 lety +1

    All of this is awesome. Thanks. However, just wondering what you do when using Repeaters to display Lists? I mean I understand how to change the Tag of each item in the repeater from "div" to "li", but how do I change the Tag of the Repeater component itself? As far as I can tell it cannot be changed from a "div" to a "ul". So, do I wrap the repeater component in a div, then change the Tag to "ul"? If so, the repeater is still tagged as div. Makes me feel like tagging as a List is not possible right now? Unless I just have a list of "li" components that are not wrapped in a "ul"? I feel that is not semantically correct?

    • @Gearyco
      @Gearyco  Před 2 lety +5

      Good question. I'm going to need to follow up with Elijah about this. You should definitely be able to change the html tag of the repeater wrapper.

    • @eightysevenweb
      @eightysevenweb Před 2 lety

      I was wondering the same thing! I built some cards on a client site with a repeater and just have them as “articles” right now until I can figure out how to change the repeater to a “ul”.

    • @uncannyrobot
      @uncannyrobot Před rokem

      @@Gearyco Did you ever find the answer?

    • @Gearyco
      @Gearyco  Před rokem +1

      @@uncannyrobot filed a bug report. Still an issue last time I checked.

  • @digwillhachi
    @digwillhachi Před 2 lety +1

    I drop a like before I even hit play 😆

  • @udithawishvajith9334
    @udithawishvajith9334 Před rokem

    How can we use that ul>li technique with Oxygen repeater? Oxygen doesn't allow us to change repeater element tag. Is there any possibe way of changing it without using java script? I came loong hhere just see again clickable parent technique and I found this issue now

    • @Gearyco
      @Gearyco  Před rokem

      Not possible with oxygen repeater. Another reason why bricks is better 😜

  • @EduwareIzekor
    @EduwareIzekor Před 2 lety

    Hey Kevin, Can you point us to the code used for the hidden accessibility? Or a good resource to read about it.

    • @Gearyco
      @Gearyco  Před 2 lety

      Aria hidden doesn’t hide from sighted users.

    • @Gearyco
      @Gearyco  Před 2 lety

      I’ll DM you the code. It’s in next version of ACSS.

    • @EduwareIzekor
      @EduwareIzekor Před 2 lety

      @@Gearyco its just to study the code. Since I've been watching your videos I've had the urge to dive back into css and really understand it. This vid of your was truly educational.
      Thanks again for sharing.

    • @EduwareIzekor
      @EduwareIzekor Před 2 lety +2

      @@Gearyco I also plan on running through the whole Oxymaven blocks and rewriting them. Better structure and accessible where needed.

  • @christianmagill3829
    @christianmagill3829 Před rokem

    I'm curious, wouldn't this mean that the link would be announced as the name upfront, and then not again after the context for the person's identity is provided? I'm guessing some backtracking would be needed to take action on what was just read. Is that a pretty typical accessibility workflow?

    • @Gearyco
      @Gearyco  Před rokem

      The exact link text gets announced so it would announce their name.

  • @jamesl.223
    @jamesl.223 Před 2 lety

    I totally agree with using wpcode and writing your own CSS but either do one or the other, the idea that some CSS is put in via oxygen and some is in your extra CSS file seems like a nightmare when put through your 6 month rule and trying to figure if the rule is coming from inside oxygen or from external source. I am new to oxy BUT have been very impressed with the glow feature to tell me there is rules there, so if you dont know css cool use oxy but if you do know css or want to do short term pain for long term gain go the SCSS route and learn to code css, very shortly you will be quicker to write than to menu dive in oxygen to make rules IMHO.

    • @Gearyco
      @Gearyco  Před 2 lety

      I mentioned in my codebox video that all CSS should go in one place. I no longer put CSS in oxygen.

    • @dahunsi
      @dahunsi Před 2 lety

      @@Gearyco You definitely get me to invest in useful tools, but this can be quite restrictive. Especially for those of us in developing countries.

    • @Gearyco
      @Gearyco  Před 2 lety

      @@dahunsi For sure. Just do what you can do!

  • @amitjangra6454
    @amitjangra6454 Před 2 lety

    Hi Kevin, Great Video. A small request, can you please make a separate tutorial on semantic HTML? There is a lot to learn from you.

    • @Gearyco
      @Gearyco  Před 2 lety +1

      It’ll be taught in segments throughout future tutorials. Hard to do a comprehensive video on it

  • @OneKingArthur
    @OneKingArthur Před 5 měsíci

    Hi Kevin, you are my source of truth.
    I noticed that when applying the ul tag to the team members grid, with MS Edge, each card is preceded by a dot (bullet dot). Can you give me simple newbie instructions for eliminating the bullet dot?

    • @Gearyco
      @Gearyco  Před 5 měsíci

      on the list custom css add list-style: none;

  • @mihaiandrei97
    @mihaiandrei97 Před 2 lety

    I needed the card link trick so badly. Should service cards and review cards be tagged as articles? Should all article cards have header and footer?
    Unrelated, but: I created dropdown filter facets for reviews, faqs, etc. For now, I'm using a custom taxonomy (each service turned into a category) for the facets. It's pretty much like checking "related service" for each faq, review, etc. Is there a way of using bi-directional relationships for my facets, instead of this custom taxonomy? Would be a lot cleaner that way. I might have OCD.
    Also unrelated, but: My custom icons are all black after creating a pack using icomoon. No idea why. Made in figma, expanded in Affinity Designer, packed with icomoon, but they're completely black. The options I have left are code block (svg code), image svg, background-image svg. I've been using background-image, because I found it to be the most scalable way, many icons being used in pair with a short paragraph. Is this method bad for accessibility? I've also noticed Safari won't even display my svg background-images. Png url as fallback? Is that even a thing?

    • @Gearyco
      @Gearyco  Před 2 lety +1

      Services and review are also list items when presented as such (“here’s a list of our services” and “here’s a list of reviews.”
      A single review card like for a featured review would be an article.

    • @mihaiandrei97
      @mihaiandrei97 Před 2 lety

      @@Gearyco Thanks a lot! What about the facets problem? Is it possible to use bi-directional relationships for facets, instead of a taxonomy?

    • @Gearyco
      @Gearyco  Před 2 lety +1

      @@mihaiandrei97 certain facets yeah. I’d have to see the entire setup mapped out

  • @rajibhosen9970
    @rajibhosen9970 Před 2 lety

    Hello sir Love you

  • @silentphil77
    @silentphil77 Před 2 lety

    stupid question here... but should we build repeaters like this? example product grids?

    • @Gearyco
      @Gearyco  Před 2 lety +1

      Yes, but there's a limitation with repeaters currently.

    • @silentphil77
      @silentphil77 Před 2 lety

      @@Gearyco Awesome thankyou!... btw loving ACSS

  • @kareem2928
    @kareem2928 Před 2 lety

    WOW! amazing! Thank you ♥
    May I ask you, In case I'm using Automatic.css/ACSS, I should use custom CSS as well for cards...etcetera!
    Or just count on the ACSS classes as you used only for the grid! but I want to use all the ACSS..
    Example: Font size, spaces...etcetera!
    Please advise!

    • @Gearyco
      @Gearyco  Před 2 lety

      I'm doing a video on custom classes vs utility classes and when to use them.

    • @kareem2928
      @kareem2928 Před 2 lety

      @@Gearyco Oh, thank GOD! I'm waiting for this Kevin...
      Looking forward...
      Thank you!

  • @BjarneOldrup
    @BjarneOldrup Před 2 lety

    So great that you focus on accessibility, including keyboard navigation and screen readers. Having that worked out, goes a long way. To all Windows users - you've got Windows Narrator as a built-in alternative to Apples Voice Over. NVDA is a free full-blown tool with a learning curve, and JAWS is a premium alternative with a 40 minute/reboot trial.
    Nice touch, remembering the order in the DOM. Flexbox and Grid gives us so many options to move things around while retaining a sensible content order.

    • @zac8670
      @zac8670 Před 2 lety

      If only JAWS had a free testing option for devs. Though, NVDA works, and there are accessibility checking extensions for browsers.
      Accessibility is part of why I tend to build from scratch. A lot of purchased elements (like accordion toggles) aren't built with accessibility standards. It's more versatile to just have these pre-built to reuse.
      There's also "AI" add-ons like UserWay, worth checking out for larger clients.

  • @AnthonyDeCrescenzo
    @AnthonyDeCrescenzo Před 2 lety

    I looked and didn't see this mentioned, so here goes…
    At 47:15 you abandoned the outline-on-hover effect that you wanted because the appearance of the borders, on hover, shifted the space occupied by the icons by the width of the border.
    The fix is to add the same border to the non-hover/original state, and just make the color transparent. No shifting, border on hover. Easy peasy.
    FYI. 😉

    • @Gearyco
      @Gearyco  Před 2 lety

      It’s a better practice to use a style that isn’t so dependent. Like “magic numbers,” transparent borders are like “magic borders.” Best to avoid that for future proofing.

    • @AnthonyDeCrescenzo
      @AnthonyDeCrescenzo Před 2 lety

      @@Gearyco I completely agree about future-proofing designs. I completely disagree this is an example of its need. I keep these rules right next to each other in the SCSS. It's both simple and effective. Different strokes.
      (See what I did there? 😉)

  • @martinkarpowski8365
    @martinkarpowski8365 Před 2 lety

    35:00 Isn't the alt tag pulled from the media library alt? Makes perfect sense ;)

    • @Gearyco
      @Gearyco  Před 2 lety +1

      Yeah, the problem with that, though, is that sometimes we use the same image on different pages, but we alter the alt text for SEO purposes. If the alt is pulled from a single global field, that's a big limitation.

  • @rhcreativebz
    @rhcreativebz Před rokem

    Hey Kevin, another great tut! never would have thought a card needed this much thought and input.
    just wondering, is this also recommended for repeaters? or does it work best as you stated on this video: czcams.com/video/2pBuoDWB-u0/video.html - thanks

    • @Gearyco
      @Gearyco  Před rokem +1

      Yes the only issue is that the repeater in oxygen can’t support proper list structure

    • @rhcreativebz
      @rhcreativebz Před rokem

      @@Gearyco thanks Kevin - I was wondering why I was trying to do it and it wouldn't work out of the box.
      I tried making the main div of the repeater a custom and the card the but somehow didn't get it to work.

    • @Gearyco
      @Gearyco  Před rokem

      @@rhcreativebz yep, it puts divs in your list which is invalid markup. 😢

  • @nocodecreative
    @nocodecreative Před rokem

    ok well I'm new to this and can't follow along as you added a bunch of css classes without giving any details on them.

    • @Gearyco
      @Gearyco  Před rokem +1

      I explained each class I added unless they were grid utility classes that didn’t have anything to do with the video topic. I’ve explained those in previous videos.

    • @nocodecreative
      @nocodecreative Před rokem

      @@Gearyco I think is was the grid ones at the start. I haven't seen many of your previous videos so none the wiser! Newbie. Which video should I look at for reference?

    • @Gearyco
      @Gearyco  Před rokem +1

      @@nocodecreative I use those same classes in pretty much every video. You can also watch this: czcams.com/video/jEizAXhL2JE/video.html

  • @jamesl.223
    @jamesl.223 Před 2 lety

    Normally love your videos, and this one is good as also. That said this one I feel is overkill. I have been a web developer for decades and VERY few clients have ever been concerned about accessibility, in fact other than non-profits it has never been brought up. I get that you are trying to show best practices but I personally feel using a unordered list for cards like this adds too much confusion and extra headaches for a VERY slight improvement for those using screen readers.

    • @Gearyco
      @Gearyco  Před 2 lety +1

      It’s becoming more and more important and you can’t wait for clients to bring it up. It’s our jobs to advise clients on it and why it’s important. And you can generate more revenue from it. Accessibility is something we should be pushing, not waiting around on.

    • @Gearyco
      @Gearyco  Před 2 lety

      It’s also going to become an SEO signal in the near future.