over 2 years ago Syntax Podcast
Stump'd JS + CSS Interview Questions
3 equal width CSS grid columns
Guest 2
Yep.
Guest 1
It's
Guest 1
And on this.
Guest 2
of the total The value of that property is going to be repeat, the container. Yes. It makes it one equal fraction of the container. Of the container.
Guest 2
and you're going to repeat
Guest 1
each of them? is fractional, but it is a fraction of the
Guest 1
Like literally an image is a big one or a word that does not have a maybe half an hour coming up with some brutal ones,
Guest 2
1 fractions, then they're all equal size, 3 equal size. No. They're not.
Guest 1
FR No. Well, like JavaScript 0 1fr. And what that will do is it will enforce
Guest 2
K.
Guest 1
900 pixels wide, So 3 columns of 300.
Guest 1
available space.
Guest 1
You know, that's why 2 FR to 1 FR would be stuff. 2FRs double the available free space once everything has been divided on each other. So are you saying that it's not correct Because if something is bigger, it will make one of the columns bigger. Is that what you're saying? Exactly.
Guest 1
what what does FR do? the the browser can figure out what it should be doing for best perf, But sometimes you can just explicitly tell it, hey, don't worry about X, Y, or Z,
Guest 2
Fraction
Guest 2
Mhmm.
Guest 1
of content inside of each of those. So I've got 3 columns. 20.
Guest 1
that is so you have 3 columns. Let's say they're
Guest 2
3.
Guest 2
With 20 pixels between each of them. So you have a garbage
Guest 1
So Yeah. If you have something
Guest 1
What what does that mean?
Guest 2
a grid template columns.
Guest 1
line break on it. And so I have a visual tweet
Fake HTML elements
Guest 2
Basically,
Guest 2
Or s e c are not real? BDI,
Guest 1
Oh, okay.
Guest 2
the fact that you knew BDI, BDI is basically the same thing as BDO. It's very close. BDI is bidirectional
Guest 1
I know there is a BDO element,
Guest 2
site
Guest 2
directional.
Guest 2
The bathroom's here. A clean, Is that backwards? Did I didn't die? No. That Oh. So that is
Guest 2
isolate element, you're basically saying the text,
Guest 1
some of them are deprecated.
Guest 2
isolate element
Guest 2
sparkly clean bathroom. Yeah.
Guest 2
bidirectional is, it actually a very interesting property in CSS and one I think we should be Spending some serious time on because I don't know if a lot of people use contain
Guest 2
Yep.
Guest 2
SEC. Definitely SEC. SEC is fake. Correct.
Guest 2
Contains in isolation from its surrounding text and can be by by, Basically,
Guest 2
where,
Guest 2
Let's say if you're on a road trip
Guest 2
sec.
Guest 1
a possible word break tag, and it tells the browser, hey, if you got a break, if you got to break this word,
Guest 2
So b d I I got some really, Interesting. I wanna say I got some curveballs for you. Alright. Why don't you start it off? Alright. Here, is all about rendering performance.
Guest 1
Do it here. Yeah. So if we had, How would I make a grid of 3 equal columns with 20 pixels Look at that new one. Not a funky one. That's that's the, like, thing that gets everybody. Like, oh, yeah. Equal columns, and it works great until you have some weird and you can get better perf out of it. Oh, man, I can't believe I've got that wrong. The other part I was thinking was with Mac's content.
Guest 2
BDO is bidirectional text override element.
Guest 1
HTML tags. However, What everybody does, however, they're going to be learning opportunities. Let's just say that. Stuff. But we have I love it. We chose different categories this time. So we have CSS layouts, JavaScript base, JavaScript DOM, Server JavaScript TypeScript, HTML
Guest 1
something To do a custom container, it was contained. And the idea she said that this was needed and Sentry is going to give you some insights into say, a German last name or an image,
Guest 2
sec.
Guest 1
I don't think there's a BDI make each It was contained It was using to develop.
Guest 2
One of them is an imposter.
Guest 1
element.
Guest 2
K. Sight, s c I t e,
Guest 2
and,
Guest 2
w b r are fake? Which of these MFers
Guest 2
Number 1, b d I.
Equal width CSS grid columns
Guest 1
that every single column is of equal width. Wow.
Guest 2
We're o for 2, and that's fine because, It's, yeah, and there's, like, a nice bathroom, but you know there's a not nice bathroom down the road. You're like, hey. Might as well do it here.
Guest 1
the best way to do it is to
Guest 2
Okay.
Guest 2
I'm about to make it o for 3. Okay, Wes. How about this 1? Okay. Which Of the following, which of these elements it's a very interesting property that Which is not contained, believe it or not. Contain
Guest 1
grid column a min max of between Only 1 of them or or I have to guess 1 of them is not real.
Guest 1
piece of content that Alright.
CSS contain values
Guest 2
regularly
Guest 1
There's a couple of different options, but one of them is you can contain it to
Guest 2
This is I see. This is why this one is going to be tricky because Which is 1 fraction, comma How they're rendered size wise,
Guest 1
the min content or max content,
Guest 1
And then it will still be a block element
Guest 1
but size itself according to the content inside of it.
Guest 2
or correctly or just at all. So contain
Guest 2
So no. You're you're running that list. Right? No.
Guest 2
specifically contained sounds like so many other things that you might you're thinking of container
Guest 2
and container type container, And you can set this To contain layout, contain 1 f r,
Guest 2
like, just in general container,
CSS contain for performance
Guest 1
is was that and have happy customers. Check it out, Sentry. Io. Stuff. Coupon code tasty treat for 2 months free. Alright, Scott. You ready? You ready to get
Guest 1
with CSS. But that was scrapped
Guest 1
and is So it's Then it will say, okay. Well, I had 900 minus 400. Right? And now I've got, If you have something in one of those columns that is wider than 300, I like that. The following I'm going to say it's BDI.
Guest 1
it's interesting. Yeah. Because the contained property is each other. Yeah. You think you think you're stumped by some of your bugs? Let's talk about Sentry. You're going to want to use Sentry in your applications absolutely destroyed? Yeah. Are you ready to get absolutely destroyed? I think I'm gonna get the job. I think at the end, we'll have to tell each other if we would hire each other.
Guest 1
we now have Container.
Guest 1
So The XMP That is what contain is for. I don't think that's right now that I'm saying it. The other thing is just the insights you need to fix your fix your bugs and get on A witch. Which of the lists are deprecated? How many of them will be deprecated? You have to you gotta tell me. That's you're you're part of the interview here. The mark tag I love it.
Guest 2
size, style,
Guest 1
I'm reading an old Miriam blog post. Obviously, yes. Container for container queries,
Guest 2
it tells the browser Stuff. Oh, man. I could have made this a lot harder too. I could have asked you for all the different
Guest 2
to be honest, when I was reviewing this, I was like, I gotta spend The elements' contents are not displayed outside of its bounds. That sounds a lot like overflow hidden. Right? However,
Guest 2
and it might be handy in some situations where performance is critical. There's a lot of little nuance to this. I feel like we did a show on this after we had Miriam on,
Guest 2
Container type is now what's used, where you have size, inline size, and normal. Oh, it's container.
Guest 2
container type.
Guest 2
this is based purely on performance. So it's not there to visually hide things. It's there to say, hey. Just don't even render anything outside of this. Worry about checking for anything outside of Yes. So this thing is all about performance, and it can affect CSS how things are laid out, paint. And these things are really interesting because if you do, let's say, Contain paint.
Guest 1
That's why I thought so, but I have What do we get for being early on these things? Yeah.
Guest 2
ever, Yeah. Okay. I so I have a Well, well, hold on. Let's talk about which ones are actually fake. So site, do you think site is real or fake? I thought you said I thought you said I had to there was only 1 of them. 1 of them is fake, and BDI is not fake.
Guest 2
lot more time with this because I just straight up don't use contain
Guest 1
we have size, layout, paint, and strict in CSS Contained. And the idea was that we would create custom contains the The SAMP tag what happened leading up to your bug, where it happened, who's using it, What type of browsers, that container crews could exist. But yes, I see what you mean. It's like like there's some things in it's Similar same with, like, will change in CSS is that sometimes Elements.
Guest 1
and
Guest 2
that is not it. Man, you just dumped me. Okay. Yeah. I well, the thing is is is and I don't know how tightly related it is to container queries because if you look at the docs for it, and you do a command find for queries or container queries on it, doesn't mention them at all. So, Three columns. You're you how how wide are the columns? Equal. Equal. Okay. So you do
Guest 2
which Of
Guest 2
the, which types of things that it should be even worrying about or rendering.
Guest 1
but it was HTML tags are all valid What you use for container queries. Currently? Oh, maybe not. I'm reading an old
Transcript
Guest 1
Anything goes in CSS accessibility, performance, and deployment. So these are different categories.
Guest 1
We each come up with a single question
Guest 1
For each category, we are going to try and stump
Guest 1
existing interview questions. We did a couple where we had the AI try to stump us. And then this episode here, Scott and I spent Do do you know what WBR is? I thought that was an interesting element. Yeah. I gotta change my question because My question for you is, what's the difference between a b r and a WBR tag? No way. No way. Okay. A WBR tag the actual Contain is part of CSS that will auto Wow.
Guest 1
So there's a couple there's a couple in there that, you put and that's not a good example.
Guest 1
if you're stumped by your bugs. Certainly, I've been stumped many times, you split it up proportionately.
Guest 1
where we are just gonna be surprised. Yours are brutal?
Guest 1
ask each other interview type questions, Okay. So if you have, the rest there. Now I'm going to divide up the available space to you. So 1 FR, 1 FR, 1 FR is not equal columns.
Announcer
Boss, and Scott, El Toro Loco,
Guest 1
And we try to stump each other, and you learn a thing or two about web development along the way. So in the past, we've gone through
Guest 1
Jov Welcome to Syntax. We got us stumped for you today. This is where Scott and I
Announcer
Monday. Monday. Monday. Open wide dev fans. Get ready to stuff your face with JavaScript, CSS, node modules, barbecue tips, get workflows, breakdancing,
Announcer
soft skill, web development, the hastiest, the craziest, the tastiest web development treats. Coming in hot. Here is Wes, Barracuda, Tolinski.
CSS contain property
Guest 1
CSS contain is a way to tell
Guest 2
Okay. Good. Because,
Guest 1
as something that was needed for container queries. Right? Is that what I'm no? Nope. Okay, let me
Guest 1
Watch it on the width layout or the height or both.
Guest 2
contain and why it exists? WBR
Guest 1
set the width of an element.
Guest 2
values for CSS contain and what they do, but I'm just and say, what is contained and why does it exist? CSS contain was added
Guest 1
the stuff. It will first say, alright. Well, that that image needs 400.
Guest 1
a browser. No, there's 2 things I think it might be. I'm going to say both of them and you can tell me. CSS contain is a way to tell the browser to watch ideally
Guest 1
tell you what I think it is.
Guest 2
try to decide how much of a bang I wanna start this off with. Let's start off with a bang here. Alright. Can you explain
Deprecated HTML tags
Guest 1
Mhmm. The TT tag So it was related.
Guest 1
tag
Guest 1
Mhmm. The VAR tag