PB101: L19 - Dynamic Styling with Data Attributes & Attribute Selectors
ฝัง
- เผยแพร่เมื่อ 10 ก.ย. 2024
- There are going to be situations where you need to be able to target elements based on specific data associated with those elements. Or, target elements based on specific attributes that they have.
Know what this means? It means all the methods you've previously learned about selecting and styling elements (classes, IDs, programmatic selection with pseudo-classes, etc.) will all fail you in these situations.
So, there's one more technique that you need to learn: data attributes. And along with that, we need to talk about how the attribute selector works. I'll even show you some incredible superpowers that come along with the attribute selector.
That's not all, though. You'll also learn how to display data from data attributes using the attr() function and get a glimpse of how data attributes empower more efficient JS interactions in web design.
It's another packed training session that's going to greatly elevate you above beginner/intermediate level.
Enjoy!
** MY TOOLS **
🔥 AutomaticCSS (ACSS) - automaticcss.com
🔥 Frames - getframes.io
See all my recommended tools here: geary.co/tools/
** INNER CIRCLE **
Step your design/dev game up, make more money, and get the full scoop on scaling your digital agency! When it comes to the Inner Circle, I don't hold back.
⭕ In-depth design & dev trainings
⭕ Business, sales, & marketing trainings
⭕ Agency resources & downloadables
⭕ Vibrant, quality community with zero toxicity
⭕ ...and much more!
Learn more and join here: geary.co/inner...
** SOCIAL **
👉 FB - / marketingkev
👉 LinkedIn - / kevingeary
** CHAPTERS **
Boss mode teaching. Best, most informative, most value packed course out there. ❤
Appreciate that
This course is incredible for anyone wanting to level up their web development. It's not just for beginners.
This is by far the best course I have followed on web development. It's well structured and extremely well explained and illustrated. Very eagerly awaiting Page Building 102, or 201. Thank you tremendously for sharing all this!
Awesome course! I finished it in 4 days 😂. This course is great for any skill level. I learned best practices for things I’ve done wrong for 25 years. Thanks Kevin.
This is one of the best episodes yet. Thanks for creating this video.
This is like striking gold after a long and frustrating search.
You are an incredible teacher, Kevin! I can't believe I learnt all of this for FREE! Thank you. You have earned yourself a supporter. :)
Outstanding lessons. Especially 18-20 were eye openers for me! Thank you very much!!!
Absolute gold! Every PB101 has been value packed. Thank you!
Switched to Bricks not long ago. Currently working on my first website trying to follow the best practices I learned in this course. It's a challenge, I have to admit, but sets the bar for the level I wanna work on. The value you provide with PB101 is awesome. Thank you so much for that
It takes practice. But it will quickly become second nature!
Man , you're at beast mode :D You've taught me really alot on this course , Thank you.
I'm a changed man. Thank you.
Am I in love or just infatuated? Not sure yet, time will tell.
But seriously, I run an SEO agency and always tried to avoid website design because of the monotonous tasks involved with it. But now I think i will start to enjoy website building again and now even look forward to it.
I believe I can charge way more now.
Thank you again.
Left each video with a value of "Like" i. Going back to the beginning for round 2 with more practice executions! I can actually feel my net worth increasing exponentially! TY!
💰get that bag!
Another outstanding tutorial Kevin. A very big thank you for doing all these - unbelievably valuable
I binge-watched this course in the last week and am just blown away that this course is for free. No one gives knowledge away like that for free. This is one of a kind. Am gob-smacked. I shared this course and hopefully, a lot of people will watch it. I am thinking of joining the Inner Circle now.
I appreciate you!
Incredible value in EACH lesson. I can't recommend this course highly enough for anyone wanting to level up their skills.
Ah, ah ... this is what I was craving for. Attributes and custom queries. Till now it was just all black magic to me ... but I see I was wrong :)
Great tutorial Kevin. Can't wait what L20 will bring ... it's getting better & better.
Kevin, I've seen you use data attributes in other videos but wasn't quite sure how everything worked. This PB101 lesson was tremendously helpful. "Elevate Your Game" doesn't even cover the value this lesson provided. Thank you for investing your time and effort into creating this series of videos.
Amazing lesson, Kevin. 50 minutes of net video time. I for one recognize the time needed to just setup the environment. So I am paying with a like, comment and share. This lesson was greatly enjoyed and I appreciate it very much. Cheers, Kevin!
💪🏻
Can’t believe we are almost at the end of this course 😢 With the last couple of lessons, things are getting more advanced and exciting!! Looking forward to next lesson! Thanks Kevin!
Good lesson.
You should consider including in this course giving a lay of the land about PHP, various javascript libraries various CSS frameworks, and the like.
A birds eye view of the front end development landscape. Food for thought.
🤯Kevin. My man. I am sounding like a broken record but I have no words for your tremendous work, effort and knowledge you put out there for all of us, elevating and making us better one lesson at a time. A big big THANK YOU for everything.
🙏
Thanks, Kevin. Awesome content!
As always, it is a masterclass. I need to practice it right away. Thx Kevin for the content and kudos for the innercircle, it is a gold mine!
Getting all this knowledge for free feels illegal! Thanks as always Kevin!
This course has changed my life!
Wonderful course. Cannot find a valuable content like this YT. Thank you Kevin.
The words fail me. So much effing value. Thanks a lot for these. Much love.
I have already been styling with Attributes and still picked up some new tricks with your video.
I didn't know how to thank you for so many teachings, that's why I just joined the inner circle :)
It has been my best decision.
🙌🙌🙌
All Im going to say is these later lessons, especially, make me feel like I've joined the Navy Seals or Delta Force for bricks builder...🤯
🫡
Amazing. This just solved something I needed, and that was the ability to have a bunch of news posts, but to allow a toggle to make it “featured” and when on, to show up first in the loop and look a bit different.
💪🏻
this came in so handy today as I need to have ONE person always first and had to add a custom field for order/position. This is SOOO much easier and cleaner.
This one, and L18 were extremely helpful, and I didn't know about many of this. Thank you Kevin!!!! 🙏🏼
Excellent lesson! I got the pop quiz right too!
Thank you very much for this amazing course! I'm about to start my first Bricks website and for sure I will be rewatching your videos at the same time. Thank you again!
Whole course is incredibly valuable and I’m really shocked that this is free! Thank you Kevin Geary very greatly, you’re the best!
Glad you enjoy it!
This video is awesome! One of the best from the series so far! Thank you @Kevin Geary!!!
Just a quick note- anyone who needs little prompts around selectors, pseudo classes, attributes, etc. WDS have a css selectors cheat sheet that I find very helpful.
Awesome lesson, Thank you
Such a dense and amazing episode thanks ! I always struggled and failed to find easy ways to order cards in certain ways, so the first example you gave in the video is very helpful. Now as you said, gotta open Bricks and start practising to make these new techniques stick to my brain !
Exactly what I was looking for. Thank you 10000 times! ❤
Great video like all the ones you make, the PB101 course video series are great, I am learning a lot and raising my level of knowledge to build websites.
My knowledge of the English language is poor, but thanks to a Google Chrome plugin, it immediately translates the audio into another language, in my case Spanish, so I can better understand the lessons.
Thank you very much Kevin.
This is fantastic ❤ i knew they existed;’data attributes’ but did not know the how or what. Brilliant video!
Would love a few lessons about javascript :)
Thank you so much for the wonderful very well-explained lessons! :)
Men, this is the web developer's bible101.
All these videos, I look and can't stop.
What did you done? You changed me.
💪🏻
Great explanation 👍🏻
Sheeeeeeeeeeesh!!!! The people want more Kevin!! 🔥🔥🔥🔥
Compliment, great tutorial!
This stuff is pure gold.
Great video, I'm watching it on break between projects and I'm about 3/4 through. All stuff I never knew. I wouldn't say the value of the data attribute is 'binary', either. 'Radio', maybe? :)
Maybe the 'i' (for case insensitivity) is for 'insensitive'. Not sure if I'll ever use it but pretty sure that's how I'll remember it.
KMG: Hey, man. How did you end up here?! This is a long way from Rebooted Body. You're still looking good. 🙂
I find a lot of value here!!! Thanks Kevin!
🙌
Incredible value, thank you Kevin !
I took that firehose to the face! Died several times but I made it! Thank you for sharing your knowledge with the world.
💪🏻
Beginner... time to rewatch the series and go check out ACSS and the inner circle... My first web project is gonna be on the same level as 'Reasonable Doubt' lol
💪🏻💪🏻💪🏻
I came to the end, and where is the rest of the series? Great job, Kevin , I appreciate your work and skills.
Thanks Kevin
This stuff is phenomenal. Glad I found it. Thanks I found you on a webcast conversation with Jamie Marsland and really like your style of discussion. You eluded to doing a full landing page and some other things. WIll they be additional segments of this class or a different video series, maybe already available?
Wonderful lesson, Kevin.
thank you
Aching for that next course KG
Inner circle 💪🏻
That was gold! Thank you!
Absolutely amazing episode. This stuff is actually possible??
Kevin hits again 🎉🎉
Doesn't miss.
This is really valuable stuff to know. One quick question, and apologies if I missed it from an earllier lesson. In the profile cards you used the class naming convention of two underlines for __title and __name. I've notted all the other BEM naming conventions but this one is neww to me? And, one more, there was bin-- with the two trailing hyphens.
Lastly. It's been a real pleasure getting to know all the information you have imparted over the 19 videos. I already knew or was awre of some this but now am empowreed with all of it coming together, in a way that will be beneficial to my work in the future. I am just starting to use Bricks and I first encountered you on Jamie Marsland's interview where you were questioning the direction of WordPress and the Gutenberg project. I was hovering on Divi and waiting to see where the block editor was going to go as an alternative but am now more convinced that builders like Bricks are what we need if we are serious about building sites properly.
The __ is the core of the BEM naming convention. "--" denotes a modifier class on a block. So for btn--action it basically means, "this is a button styled with the action styles" vs "btn--black" would denote a black button.
Awesome episode Kevin
So much goodness on this video
Think this is why you have to learn web design the right way, this is a Facebook post from the divi group
Client initially approved the design now 3 months and 50+ pages later, he wants to change the title text. I had initially set this in each module and cloned the page. I do not want to change 20 titles per page times 50 pages, going 1 at a time. None of the css I'm writing is working though. I'm trying to make all h1-h6 alata font (from aldrich).
YEP!
You mentioned a "couple more episodes" full landing page build but I don't see them here?
We decided not to do them because everything that got taught is shown repeatedly in most of the videos I do
I've made it all the way to the end, I've found valuable insights from each and every video, commented and liked every video and kept this playlist saved for future reference. I love it, especially how to work with CSS within the context of a page-builder like Bricks. I'm more used to writing out the code directly, but I haven't worked much with dynamic, or programmatic CSS, like this. Is there a way to work with JavaScript and REST APIs directly within a WordPress page builder like Bricks? For example, creating a component that can be populated with data from an external source rather than the connected WordPress database. Also, are there instances where you would need to be working directly with PHP on the Bricks theme or child theme files? Or is this another area of the WordPress site's code that you work on the PHP? I haven't found a course thoroughly covering this yet.
Anything is possible
Hey Kevin, at 24:21, you show the status badge doesn't have any CSS on it. Yet, on the front end, it says "Status". How can it do that without any CSS? Shouldn't there be an attr function somewhere to make this work? Is it on :before here too? Watching on my tablet in low res so I might be missing something.
Yes, there was an attr() on it already, but that was it. I think I meant no styling CSS.
@@Gearyco Thanks!
Are dynamic attribute workign with ACF repeater in Bricks currently?
As far as I know.
What has happened to the L20? Don't see it. Law suite by Elementor? :)
19 was the final episode.
Thanks for all the helpful content Kev! Can I ask what font name is used for the body text and on the black buttons? Thank you 🙏
Outfit
Can data attributes be utilized in conjunction with membership plugins? For instance, if I create a query loop to show the first 3 cards and blur the remainder for non-members, could this be achieved if the membership plugin supports it?
I suppose it depends on the membership plugin. I'm not sure it would be foolproof, though. People could manipulate the DOM in the inspector and undo any CSS you're using to blur things.
@@Gearyco I use Sure members for a directory website and okay that makes sense. Thank You
So much content here! I was hoping for a way to link a CPT card to an internal URL. As there is only one "real" card in the DOM, how would I link each card to a different URL?
I’d need more context as to what you’re wanting to accomplish. What are the cards for and where do they take people?
I'm using Frames Feature Card Hotel, and have set up dynamic content for the image, heading, and accent text. I'd like each card when clicked to take visitors to a separate dedicated page featuring more information on the topic. I just can't see where I can add the relevant URL. @@Gearyco
@@iainjhamilton sounds like you need a CPT…
I created a CPT in ACF, that's where the frame is drawing content from. But each card needs to link to a separate page and I can't see where I can do that. @@Gearyco
Just create a link and in the url path use dynamic data to link to the post url.@@iainjhamilton
Can we create a thankyou page and able to show the thank you - name. The name will b take from the form first name.. ?
Yes but not with the techniques in this video. It’s a different method.
Oh no, you said Gif wrong. :P
It’s a hill I’m willing to die on 😂
Wow! So much info and power. The beauty of TH-cam is this goldmine of info can be watched again and again. 👍🫡