Pratique du Shadowing: Your AI broke the layout. Now what? - Apprendre l'anglais à l'oral avec la vidéo

Création de la leçon...
1
The most undervalued skill in front-end development right now has nothing to do with prompting, but instead it has to do with identifying and fixing problems,
2
because every now and then AI is going to get things wrong.
3
Now this doesn't happen every time you prompt something, and it's not that all of the errors are catastrophic, though that definitely can happen from time to time,
4
but when these problems do come up there's two kinds of developers that are out there.
5
There's those that can identify the problem in under a minute and go ahead and fix it relatively quickly, And there's others who spend half an hour reprompting the AI trying to understand what's wrong with it
6
and trying to get it to fix the problem that it created in the first place.
7
And being a CSS person, I see this happen with CSS a lot.
8
So we're going to dive in
9
and look at some of the things you can do with CSS to be able to solve the problems
10
that come up and the types of things you want to be looking at and identifying when things happen.
11
And this is actually a challenge that is in my course, CSS Demystify, that we're going to look at and do together where this is what we want.
12
And there's some problems right now.
13
And so let's jump to full screen mode here and I'm just gonna make the font size bigger.
14
So, you know, for recording purposes, you guys can see what's going on and everything looks okay.
15
In terms of the markup, I don't see anything that would be catastrophically problematic there.
16
But when it comes to CSS layout issues, it's really useful to be able to quickly look at things and go red flag right away.
17
This is a very simple example of the types of things that you might be looking for.
18
But we have like our text is too close to the top over here.
19
We obviously have some overflow, which is the easiest problem.
20
And there's a few other smaller things here that can easily pop up.
21
So the very first thing is just fixed widths and heights.
22
Now, LLMs generally don't do this these days, but it is still one of those things that we want to avoid at all costs.
23
And I always say, if you're going to be setting a size on something, you don't want to set a fixed size, you want to set a constraint.
24
So I'm going to set a max width here.
25
And that means, you know, I'm actually able to get smaller than that.
26
And we can see here it's shrinking and growing instead of being locked in at that size.
27
And for a height, again, you could set a constraint if you need the constraint, it would be a min height, which means like if this was bigger,
28
then it would be able to be bigger.
29
And so like most of the time, height is actually a useless declaration.
30
And this isn't the type of useless declaration that an LLM will generally make.
31
It's usually a person will throw that on there.
32
But if we don't set a height, height auto works.
33
It's fantastic.
34
It works with how the browser wants to work as the content has different amounts of space.
35
It can adjust and grow and shrink and do what it needs to do.
36
But the types of useless declarations that LLMs do do every now
37
and then actually does sneak its head and is what's causing the overflow over here.
38
And if I come and take a look, there's a width 100% right here.
39
And this is what the issue is.
40
And if we take this off, you're going to see it fixes itself.
41
Nice, right?
42
Some eagle-eyed people watching this might be going, Kevin, that wasn't the problem.
43
The problem was that you never declared a box sizing border box, but that's not correct.
44
Even if I put that, let's do it really quickly here, it's going to do a border, not border, box sizing of a border box on here.
45
It's fixed it a little bit, but it's still not completely there.
46
And the reason for that is box sizing border box with 100% plus margin, margins are outside of your border box.
47
It's not included in there.
48
Just like height, a lot of the time the auto works fine.
49
Same thing here.
50
The width of auto works fantastically well, and I don't actually need to declare it width there.
51
So we can get rid of that one.
52
Our layout is almost there.
53
We have the major issue I would say right now is, do I even want margin on here?
54
When you have an element inside, you generally don't want to put margins outside.
55
And this is the type of thing that can sneak in sometimes
56
because you're focused on the one thing that you're writing code for and you go, I need space all around it.
57
But this would probably make more sense if I took this margin off completely to begin with, which now I guess that width 100% wouldn't be an issue if you did have your box sizing.
58
But then coming all the way back up to my card, I would replace that with this padding of the 24 pixels here, which adds it all around.
59
And anytime you need more background, we want to come in with some padding.
60
So quick things that we can identify there.
61
And now the main issue is we have extra space here.
62
We had weird spacing.
63
We still have weird spacing there.
64
And the spacing down here at the bottom is also getting kind of weird as well.
65
Once again, margins start rearing their ugly head.
66
We had collapsing margins going on.
67
Now we actually have extra margins happening.
68
So here on the title where I had this margin top because I needed some extra space that wasn't actually doing anything.
69
I can remove that.
70
And not only can I remove it, I actually want to say that the margin top is zero.
71
We can have a CSS reset here that's getting rid of all of our margins.
72
That would probably be a little bit more standard, but we can see we got rid of that weird space at the top there.
73
And then here I would probably want to come down on the content.
74
And it's not even on the content, it's coming from the paragraph here.
75
So maybe my content, you know, this is where maybe you actually have a star of a margin of zero, and then that gets rid of all of the spacing.
76
And then here we can do a display grid
77
and then a gap of whatever space that we want to have to replace the margin with gaps.
78
There's a few different strategies here.
79
I'm not always a fan of this specific one.
80
There's other ones that I do like.
81
And of course, this is all part of my course, CSS Demystified, where I talk a lot about this.
82
This is part of my Making Sense of Layouts module that's here right now.
83
We have strategies with dealing with margins, which is all about bringing in the different amounts of space, coming in with grid, creating structured ones when we want to do a flex box with grid, all the different things like this.
84
And the whole point of the course is to understand CSS better.
85
This specific module about layouts.
86
I'm doing a new module right now called Writing Resilient CSS
87
which is all about writing CSS that can scale and be maintainable.
88
And it's all about getting you to understand CSS better.
89
So whether you're writing it yourself and you just want to be more efficient and not be fighting with the CSS,
90
or if you are using an LLM or some other AI tool to write CSS for you and other front end stuff, but every now and then there are problems that come up or things to debug,
91
you'll be able to identify the problems easily, quickly, and fix them while you're at it.
92
So if you're interested in that, the link is down below.
93
And with that, I want to say a very big thank you to my enabler of awesome, Johnny, as well as all my other patrons and channel members for their continued support.
94
And of course, until next time, don't forget to make your corner of the internet just a little bit more awesome.

Vocabulaire et conseils d’expression pour cette leçon

Cette vidéo contient 94 phrases et 1430 mots à répéter en shadowing. La partie parlée dure 6:08. Le locuteur parle vite, environ 233 mots par minute : attendez-vous à des liaisons et à des sons réduits. 86 % des mots font partie des 3 000 mots les plus courants en anglais ; le reste mérite d’être vu avant de commencer.

Vocabulaire clé de cette vidéo

15 mots de la vidéo à retenir, avec leur prononciation et leur sens :

MotPrononciationSens
margin nom/ˈmɑɹ.d͡ʒɪn/marge
width nom/ˈwɪtθ/grandeur
layout nom/ˈleɪ.aʊt/disposition, schéma
grid nom/ɡɹɪd/grille
declaration nom/ˌdɛk.ləˈɹeɪ.ʃən/déclaration
automobile nom/ˈɔː.tə.məˌbil/voiture, auto
module nom/ˈmɑd͡ʒul/module
declare verbe/dɪˈklɛɚ/déclarer
pad nom/pæd/tampon, coussinet
sneak verbe/sniːk/faucher, piquer
prompt verbe/pɹɑmpt/inciter
gap nom/ɡæp/brèche, écart
element nom/ˈɛləmənt/élément
efficient adjectif/ɪˈfɪʃənt/efficace
skill nom/skɪl/habileté, compétence

Les verbes à particule que vous entendrez

MotPrononciationSens
come up verbese montrer, sortir du bois
go ahead verbe/ˌɡoʊ əˈhɛd/vas-y, allez-y
pop up verbese pointer

Prononciation à surveiller

Le locuteur utilise 28 contractions et formes réduites, comme don't, you're, I'm. Prononcez-les sous leur forme courte, telles que vous les entendez.

  • Les sons « sh » et « zh »: declaration /ˌdɛk.ləˈɹeɪ.ʃən/, efficient /ɪˈfɪʃənt/
  • Mots longs — placez bien l’accent: declaration /ˌdɛk.ləˈɹeɪ.ʃən/, automobile /ˈɔː.tə.məˌbil/, developer /dɪˈvɛləpɚ/, problematic /ˌpɹɑ.bləˈmæt.ɪk/, catastrophic /ˌkætəˈstɹɑfɪk/

Comment s’entraîner avec cette vidéo

  1. Écoutez la vidéo en entier une fois sans parler et notez les mots que vous ne connaissez pas.
  2. Commencez à la vitesse 0,75×, répétez phrase par phrase, puis revenez à la vitesse normale quand cela devient facile.
  3. Enregistrez-vous et comparez avec l’original, en faisant attention à des mots comme margin, width, layout.

La grammaire de cette vidéo

Les structures que le locuteur utilise le plus, avec les mots exacts de la vidéo :

StructureDans la vidéo
Propositions relatives who / which + proposition — une précision sur une personne ou une choseoverflow, which is · height, which means · margins, which is
Voix passive be + participe passé — l’accent est mis sur ce qui arrive, pas sur qui le faitis just fixed · being locked

Qu'est-ce que la technique du Shadowing ?

Le Shadowing est une technique d'apprentissage des langues fondée sur la science, développée à l'origine pour la formation des interprètes professionnels. Le principe est simple mais puissant : vous écoutez de l'anglais natif et le répétez immédiatement à voix haute — comme une ombre suivant le locuteur avec un décalage de 1 à 2 secondes. Les recherches montrent une amélioration significative de la précision de la prononciation, de l'intonation, du rythme, des liaisons, de la compréhension orale et de la fluidité.

Technique du shadowing : lire le guide complet étape par étape →