Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,130 --> 00:00:09,890
The material UI grid system is how we are going to control the layout of the content on our screen as
2
00:00:09,920 --> 00:00:19,190
well as how it responds to different screen sizes the grid system is connected to the media query system
3
00:00:19,220 --> 00:00:26,150
that we are already familiar with and we'll use that to determine what size different elements should
4
00:00:26,150 --> 00:00:34,280
be on different devices the grid system will help provide the spacing and alignment for our elements
5
00:00:34,580 --> 00:00:37,570
while also ensuring consistency.
6
00:00:37,610 --> 00:00:45,380
So let's go over to the material UI documentation page and it will start taking a look at the grid components
7
00:00:45,680 --> 00:00:55,390
and how we can use that to implement our responsive layouts and here we are at the documentation page
8
00:00:55,660 --> 00:01:00,480
under components layout and grid.
9
00:01:00,520 --> 00:01:08,800
Here you can see it says that their grid system adapts to screen size and orientation ensuring consistency
10
00:01:08,800 --> 00:01:10,050
across layouts.
11
00:01:10,270 --> 00:01:12,660
So that is exactly what we want.
12
00:01:12,670 --> 00:01:19,210
And similar to what I had just described and down below it starts talking about how this works using
13
00:01:19,210 --> 00:01:22,600
the CSX flex box module.
14
00:01:22,600 --> 00:01:28,940
So if you are new to flex box or you're unfamiliar with it go ahead and click this link right here.
15
00:01:28,940 --> 00:01:36,580
The CSX Trix flex box guide and this is going to go ahead and give you a really good breakdown of all
16
00:01:36,580 --> 00:01:42,490
the different terms and all of the different features of the CSX flex box.
17
00:01:42,490 --> 00:01:49,300
So go check this out if you don't have a ton of flex box experience but the documentation here for the
18
00:01:49,300 --> 00:01:57,030
material UI component I think covers enough of what we need for this definitely still go and read through
19
00:01:57,030 --> 00:02:02,790
that guide though for more in-depth understanding and keep it handy as a reference point in case you
20
00:02:02,790 --> 00:02:06,510
find that you're forgetting what each property does.
21
00:02:06,780 --> 00:02:15,540
It also says here that there are two types of layout grid components there are containers and items.
22
00:02:15,540 --> 00:02:22,380
So this is important to remember and as we go and build out all of our different grid layouts each grid
23
00:02:22,380 --> 00:02:30,000
component that we make is either going to be a container or an item and you'll see how we can use different
24
00:02:30,000 --> 00:02:38,010
combinations of those to create complex and interesting layouts just like in the media query system
25
00:02:38,010 --> 00:02:45,540
that we've used in the grid system we also have these same five breakpoints they are set to these same
26
00:02:45,610 --> 00:02:53,400
breakpoints as our theme if we continue down you'll see the first example they give is how you can set
27
00:02:53,400 --> 00:03:00,660
the different spacing for your grid items and if you see here each of these little white pieces of paper
28
00:03:01,020 --> 00:03:08,100
they are each a grid item but overall they are all in a grid container.
29
00:03:08,100 --> 00:03:15,510
So if we open this up we'll see that they import a grid component and if we scroll down we can see how
30
00:03:15,510 --> 00:03:21,900
they use that by starting off with a wrapping grid component with a container.
31
00:03:21,900 --> 00:03:28,970
Prop that prop is what determines whether or not each grid is a container or an item.
32
00:03:28,970 --> 00:03:35,500
And you can see that the grid nested inside of that is a grid item.
33
00:03:35,530 --> 00:03:43,150
Now you can only set the spacing on grid containers but you can see that with a spacing prop and passing
34
00:03:43,150 --> 00:03:50,590
it a two or any number between 0 and 10 you can change the amount of spacing between the grid items
35
00:03:50,770 --> 00:04:00,150
within that grid container so if we come up and close this now you can see that here we have a list
36
00:04:00,150 --> 00:04:06,210
of options to change what that number of spacing is for this grid container.
37
00:04:06,210 --> 00:04:11,510
So if we go all the way down to zero you can see the grid items are right next to each other.
38
00:04:11,700 --> 00:04:18,740
And at 10:00 they are spaced very far apart the way that this is actually calculated you can see here
39
00:04:19,130 --> 00:04:24,710
is that the grid system uses an eight pixel square grid baseline.
40
00:04:24,860 --> 00:04:32,690
And so when you provide a spacing of two that's going to take your spacing number times the eight pixel
41
00:04:32,690 --> 00:04:36,660
baseline creating a 16 pixel gap.
42
00:04:36,680 --> 00:04:42,800
So when we set a spacing of 10 it multiplies by our 8 pixel baseline.
43
00:04:42,800 --> 00:04:51,180
Giving us a spacing of 80 pixels so we'll be keeping this in mind to use whenever we need to add some
44
00:04:51,180 --> 00:04:59,040
space between our grid items and if we come down here below you'll see the first example of our basic
45
00:04:59,040 --> 00:05:08,870
grid system using the breakpoints the breakpoints here are set using a number scale that goes up to
46
00:05:08,870 --> 00:05:11,140
12 12.
47
00:05:11,140 --> 00:05:20,830
In this case is the full span of the grid so you can see here that this twelve set grid item is taking
48
00:05:20,830 --> 00:05:25,000
up the entire space available to it below.
49
00:05:25,000 --> 00:05:34,600
We have two more grid items but this time each of them are set to six and since six is half of 12 each
50
00:05:34,600 --> 00:05:43,170
of the grid items is receiving half of the available space and similarly the very bottom ones have a
51
00:05:43,320 --> 00:05:48,180
three set and since three is a quarter of 12.
52
00:05:48,540 --> 00:05:56,050
Each one of the grid items is receiving a quarter of the available space or twenty five percent.
53
00:05:56,080 --> 00:06:02,500
Now you can see that these numbers are being set on the extra small property which means that for all
54
00:06:02,500 --> 00:06:09,110
screen sizes of extra small and above it's going to take up this number of columns.
55
00:06:09,130 --> 00:06:17,300
So 12 being the full size six being half and three being a quarter if we are to scroll down below you
56
00:06:17,300 --> 00:06:20,360
can see the here with the other breakpoints.
57
00:06:20,360 --> 00:06:23,990
Now they're setting multiple breakpoints for these grid items.
58
00:06:23,990 --> 00:06:30,700
So an extra small and above that this grid item will take up the full width available to it.
59
00:06:30,830 --> 00:06:37,690
But on the small screens and above it's only going to take up 50 percent because of the size of 6.
60
00:06:37,730 --> 00:06:41,540
And so that is why both of these grid items are sharing the screen.
61
00:06:41,540 --> 00:06:48,740
However if I come and I start shrinking my screen down you'll see that when we get to a small enough
62
00:06:48,800 --> 00:06:52,700
screen size if I come back down to our basic grid.
63
00:06:52,700 --> 00:06:58,250
So here you see we're still taking up 50 percent of this space available because we're still at this
64
00:06:58,250 --> 00:06:58,920
small.
65
00:06:58,970 --> 00:07:03,900
But once we get down to the extra small size scroll up again.
66
00:07:03,950 --> 00:07:10,520
Moving around you can see now though each of them is taking up the full available space because it is
67
00:07:10,520 --> 00:07:16,980
now applying the twelve column layout which takes up the full size of the screen.
68
00:07:17,180 --> 00:07:18,780
You can see if we adjust this.
69
00:07:18,780 --> 00:07:23,920
Now once it gets bigger they break back down into the size of.
70
00:07:24,220 --> 00:07:27,850
Right here they break back down into the size of 50 percent.
71
00:07:28,010 --> 00:07:30,240
And you can see these smaller ones below.
72
00:07:30,260 --> 00:07:32,530
Also each still taking up a quarter.
73
00:07:32,660 --> 00:07:36,320
But once we shrink back down you'll see a jump.
74
00:07:36,320 --> 00:07:43,130
And now each of these is taking up the full size and each of these is using the six set on the extra
75
00:07:43,130 --> 00:07:49,750
small to receive now 50 percent so let's go ahead and I'll make this big again.
76
00:07:49,800 --> 00:07:58,290
And if we come into view the source code for this you can see they were using a set of the great components
77
00:07:58,710 --> 00:08:03,170
setting with a wrapper of container and then a grid item.
78
00:08:03,330 --> 00:08:11,200
And on our grid items were specifying our different breakpoints so we simply pass in the breakpoint
79
00:08:11,210 --> 00:08:18,920
we want to specify and then the number of columns that we want our component to span at that breakpoint.
80
00:08:18,950 --> 00:08:26,720
And so here you can see the 12 for extra small gives us the full size available but these six set here
81
00:08:26,780 --> 00:08:34,480
make sure that a small size and above it's only receiving 50 percent you could set all of the breakpoints
82
00:08:34,580 --> 00:08:40,110
if you wanted to completely customize the layout for any of the breakpoints.
83
00:08:40,160 --> 00:08:43,160
Now you can also not set the breakpoints at all.
84
00:08:43,160 --> 00:08:49,480
If you don't want your grid layout to change for different screen sizes and you just want a fixed look.
85
00:08:50,120 --> 00:08:55,580
And actually that's what we'll be doing for the footer links that we're going to add we won't really
86
00:08:55,580 --> 00:09:00,530
be needing to move them around or change how they look on the different screen sizes.
87
00:09:00,530 --> 00:09:05,870
But once we start adding some actual content to our Web site with the landing page and then the rest
88
00:09:05,870 --> 00:09:12,290
of the pages we will be using these to determine what size different elements should be at our different
89
00:09:12,360 --> 00:09:13,100
breakpoints.
10611
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.