Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,280 --> 00:00:07,250
For styling these inputs we're going to take a slightly different approach than we've been using so
2
00:00:07,250 --> 00:00:15,060
far for styling we've really just been applying styles to certain elements except in the case of using
3
00:00:15,060 --> 00:00:22,030
our typography component in which we have the pre styled variants to choose from for the inputs.
4
00:00:22,030 --> 00:00:28,160
However I'm actually wanting to apply a style to every input that I create.
5
00:00:28,300 --> 00:00:31,880
So all the inputs they're all going to have the exact same styles.
6
00:00:31,930 --> 00:00:39,370
So I'd really just like to style the actual input component itself instead of applying styles to individual
7
00:00:39,400 --> 00:00:41,620
instances of that component.
8
00:00:41,740 --> 00:00:49,510
So to do this remember we can go over to our theme J.S. file and we can scroll down and this is going
9
00:00:49,510 --> 00:00:53,190
to be outside of the typography section.
10
00:00:53,190 --> 00:00:53,540
OK.
11
00:00:53,590 --> 00:00:58,750
So outside of the typography wrapper so make sure you come all the way down and add the comma.
12
00:00:58,750 --> 00:01:08,410
And now you can add an overrides section this overrides section will allow us to customize the default
13
00:01:08,410 --> 00:01:15,490
components for our material UI setup here and then any time that component is rendered it will have
14
00:01:15,490 --> 00:01:16,570
these styles.
15
00:01:16,570 --> 00:01:22,870
So this will allow us to set up what we want our input to look like and then all of the input components
16
00:01:23,110 --> 00:01:29,760
will share that same styling automatically to figure out exactly what we need to override though.
17
00:01:29,810 --> 00:01:34,730
Let's go back over to the material UI documentation page real quick.
18
00:01:34,730 --> 00:01:37,100
I'm here at the text fields page again.
19
00:01:37,190 --> 00:01:42,860
And if we scroll all the way down to the bottom of this page just like on the bottom of every page they
20
00:01:42,860 --> 00:01:49,580
have an API section and this tells you all of the components that are used to create the text field
21
00:01:49,580 --> 00:01:50,580
component.
22
00:01:50,720 --> 00:01:55,450
And in this case we're actually going to want to start with the input label component.
23
00:01:55,720 --> 00:01:56,090
OK.
24
00:01:56,120 --> 00:02:02,780
So that's going to allow us to start styling these labels right now so we can come down and we can see
25
00:02:02,780 --> 00:02:11,240
here that it tells us the CSX style sheet name that we need to style this element.
26
00:02:11,290 --> 00:02:19,630
So what we need to do is we can come and copy is m UI input label what's copy that and in our override
27
00:02:19,630 --> 00:02:26,940
section Let's paste that in and then we will add this as a prop. here.
28
00:02:26,960 --> 00:02:30,500
We will now specify the route version of this.
29
00:02:30,530 --> 00:02:33,590
So the style will be applied to the root element.
30
00:02:33,590 --> 00:02:38,750
So we'll select the route version of the IMU I input label.
31
00:02:38,780 --> 00:02:47,610
And here we can change our color to arc blue and then set a font size of 1 Ram.
32
00:02:47,670 --> 00:02:54,560
And if we go ahead and save that we can go back over to our page and you can see that the labels inside
33
00:02:54,560 --> 00:02:59,880
of our text fields have now all been colored with the ARC blues style.
34
00:02:59,890 --> 00:03:02,230
You can see that that is the case.
35
00:03:02,240 --> 00:03:04,600
It still changes when it goes up.
36
00:03:04,600 --> 00:03:14,620
Looks good now I want to come and Inara overrides section adjacent to our M UI input label so it's fine
37
00:03:14,630 --> 00:03:23,810
the closing tag add a comma and let's add the M UI input so this will style just the base input component.
38
00:03:23,810 --> 00:03:29,590
And here is where I can change the styling for the underline of our text input.
39
00:03:30,720 --> 00:03:38,780
However to do this we have to take a couple of things into consideration the underlying actually changes
40
00:03:38,870 --> 00:03:41,140
based on the state of the input.
41
00:03:41,270 --> 00:03:45,650
And so right now the input is in the before state.
42
00:03:45,710 --> 00:03:49,020
So this is before I have clicked on or hovered over it.
43
00:03:49,040 --> 00:03:51,730
This is when it is just a default sitting there.
44
00:03:52,040 --> 00:03:58,100
So if we go ahead and inside emulate input we're going to set the underlying style.
45
00:03:58,160 --> 00:04:02,660
So this is going to be affecting the underline for our emulator why inputs.
46
00:04:02,660 --> 00:04:06,710
And again this is from the material UI documentation.
47
00:04:06,710 --> 00:04:16,550
So if I were to go to the component API and find the input I could then scroll down and find here for
48
00:04:16,550 --> 00:04:21,200
these ISIS classes you can see the underline section.
49
00:04:21,230 --> 00:04:23,240
And so that is where that is coming from.
50
00:04:23,240 --> 00:04:28,120
I can come back to our page and we can set in this underline style.
51
00:04:28,160 --> 00:04:32,260
The quote Ampersand colon before.
52
00:04:32,660 --> 00:04:35,240
And then another colon and we'll open that up.
53
00:04:36,110 --> 00:04:39,830
So this is like I said the styles for the before St..
54
00:04:39,830 --> 00:04:45,160
So before we have clicked on it or hovered over it because you see here on hover it has an effect.
55
00:04:45,260 --> 00:04:50,330
And then once it's clicked on once it's focused you can see that changes color again.
56
00:04:50,420 --> 00:04:58,780
So before we have clicked on or hovered over it let's set a broader bottom and let's use the back ticks
57
00:04:58,790 --> 00:05:06,890
here because we're setting multiple values here starting with the two p x specifying the thickness and
58
00:05:06,890 --> 00:05:14,540
then the words solid to specify the style of the border which can be dashed as well and then do the
59
00:05:14,540 --> 00:05:15,410
dollar sign.
60
00:05:15,410 --> 00:05:18,620
Curly brace to inject arc blue.
61
00:05:18,710 --> 00:05:27,380
And that will set the color of our border let's go ahead and save that now and we'll see the page refresh.
62
00:05:27,490 --> 00:05:33,700
And you can see that all of the borders have now been correctly updated to a style matching that of
63
00:05:33,700 --> 00:05:40,720
the design file however when we hover over it you can see it is still going black going to that other
64
00:05:40,720 --> 00:05:41,410
color.
65
00:05:41,410 --> 00:05:45,040
And when I click on it it is doing a different color still as well.
66
00:05:45,040 --> 00:05:53,530
So let's go ahead and to change that other style let's add underneath the closing bracket for the before
67
00:05:53,620 --> 00:06:01,420
style section and this I actually had to find online since somebody went through and found the implementation
68
00:06:01,420 --> 00:06:07,750
of the input components within material UI and figured out this is how they're setting this style here.
69
00:06:07,750 --> 00:06:16,420
So this is how we will overwrite it and it is with the quote Ampersand colon hover colon not parentheses
70
00:06:16,810 --> 00:06:20,700
dollar sign disabled and then outside the parentheses.
71
00:06:20,710 --> 00:06:24,350
Another colon not parentheses.
72
00:06:24,490 --> 00:06:30,680
Dollar sign focused outside the print the C colon not parentheses.
73
00:06:30,700 --> 00:06:32,550
Dollar sign error.
74
00:06:32,540 --> 00:06:34,300
And then outside the parentheses.
75
00:06:34,390 --> 00:06:41,650
Colon before and now we can go ahead and open this giant style up and let's go ahead and copy these
76
00:06:41,650 --> 00:06:47,500
same border style on in and we can paste that and save the page will refresh.
77
00:06:47,500 --> 00:06:52,810
And now when we click on the input we're still getting a darker version of it which I actually kind
78
00:06:52,810 --> 00:06:55,080
of like because that does show focus.
79
00:06:55,090 --> 00:07:00,940
That does show where you are but you see when we hover over it we're no longer getting that black style.
80
00:07:00,940 --> 00:07:07,800
So this is correctly changing that hover style and making sure that we have the colors that we had wanted.
81
00:07:09,020 --> 00:07:15,920
Let's close out of the theme J.S. file now and we'll actually take a somewhat different approach for
82
00:07:15,920 --> 00:07:22,280
our message input here because we want the border to be going all the way around.
83
00:07:22,310 --> 00:07:28,730
We message input container and we also we're not going to want any styling when we click into it.
84
00:07:28,730 --> 00:07:32,990
I don't think we're going to really want that and you'll see in a minute how that will actually cause
85
00:07:33,050 --> 00:07:34,270
some issues anyway.
86
00:07:34,580 --> 00:07:40,340
So let's go ahead and we'll scroll up to the message text field in here.
87
00:07:40,370 --> 00:07:50,000
Let's add a class name of classes dot message and we'll come up to our styles object and add the message
88
00:07:50,090 --> 00:07:57,110
style and let's paste in that border that we had copied but get rid of the border bottom and we'll read
89
00:07:57,110 --> 00:08:05,080
that as the border for the entire section and then change the arc blue to our theme dot palette dot
90
00:08:05,120 --> 00:08:14,860
common dot blue now let's save that and we'll see the page refresh and you can see now the the border
91
00:08:14,860 --> 00:08:24,400
is going all the way around the input but there are a couple issues first is it's way too close to the
92
00:08:24,430 --> 00:08:28,270
phone input and that's causing almost a double thicker line.
93
00:08:28,270 --> 00:08:28,840
Look.
94
00:08:28,870 --> 00:08:35,300
So let's give it real quick a margin top of 5 m and we can save that.
95
00:08:35,350 --> 00:08:36,420
We'll see that jump.
96
00:08:36,650 --> 00:08:37,000
OK.
97
00:08:37,010 --> 00:08:40,680
And now it's guys own space down here that looks a little better.
98
00:08:40,690 --> 00:08:45,440
Next thing I want to do is go ahead and those corners how they're all sharp.
99
00:08:45,520 --> 00:08:51,100
Let's go ahead and add a border radius of five.
100
00:08:51,110 --> 00:08:52,480
Go ahead and save that.
101
00:08:52,630 --> 00:08:57,480
Those corners are gonna be just slightly rounded and I think that looks a little bit better in my opinion.
102
00:08:57,790 --> 00:09:03,160
But then we have this double thicker line here at the bottom and you can see if we go ahead and click
103
00:09:03,190 --> 00:09:07,490
onto that I guess that changes colors slightly to show the focus.
104
00:09:07,630 --> 00:09:15,230
And that's coming from the underline for the input component since we're setting a border around the
105
00:09:15,230 --> 00:09:17,550
entire input itself.
106
00:09:17,570 --> 00:09:20,980
We don't necessarily need that bottom underline.
107
00:09:20,990 --> 00:09:29,270
So what we can do is scroll down to the message text field once again and let's add the input props
108
00:09:29,420 --> 00:09:36,020
prop and we can set this equal to an object that will contain the props we want to pass down to the
109
00:09:36,020 --> 00:09:44,450
base input component here and let's pass the disable underlying prop with the value of true.
110
00:09:44,450 --> 00:09:50,630
And so if we save this the page will refresh and now that extra little line is gone because we're just
111
00:09:50,630 --> 00:09:58,070
removing the underline from the input component entirely and then wrapping our text field with the border
112
00:09:58,070 --> 00:10:03,360
itself and that creates the work that I think I was going for.
113
00:10:03,430 --> 00:10:06,370
Now let's start getting our Send button put together.
114
00:10:06,400 --> 00:10:16,480
So on our button container variant contained let's add a class name of classes dot send button and then
115
00:10:16,480 --> 00:10:25,300
we can scroll up to our styles object and add these send button style extending our theme dot typography
116
00:10:25,570 --> 00:10:38,530
dot estimate style with a border radius of 50 a height of forty five a width of two forty five a font
117
00:10:38,590 --> 00:10:49,480
size of 1 ram a background color of theme dot palette dot com in dot orange and then let's go ahead
118
00:10:49,480 --> 00:11:00,460
and remember to set R Ampersand cone hover to our background color of theme dot powered secondary dot
119
00:11:00,520 --> 00:11:08,590
light as we have done previously let's save this now and the page will refresh and you can see our send
120
00:11:08,590 --> 00:11:17,300
button has been perfectly styled similar to that of our estimate buttons you see how that airplane image
121
00:11:17,300 --> 00:11:23,030
the paper airplane is squeezed right up against the text though let's go down and find our send a message
122
00:11:23,090 --> 00:11:32,340
button and onto the image here let's give that a style of margin left 1 m let's save that.
123
00:11:32,420 --> 00:11:33,510
See this jump.
124
00:11:33,650 --> 00:11:36,600
And now we've got a little extra space.
125
00:11:36,790 --> 00:11:45,310
Now we can start getting the message input in the phone in email and name inputs all styled correctly
126
00:11:45,310 --> 00:11:48,250
to the right size of this container.
127
00:11:48,250 --> 00:11:54,960
So it was started by this grid item wrapping our message text field actually this grid items.
128
00:11:54,970 --> 00:11:59,800
So the grid item wrapping our message text field on that grid item.
129
00:11:59,800 --> 00:12:09,910
Let's give it a style max width of 20 m and I'll go ahead and copy this style and let's scroll up to
130
00:12:09,910 --> 00:12:16,170
the grid item container wrapping all these text fields and give it the same max width as well.
131
00:12:16,360 --> 00:12:20,320
Let's go ahead and save that then and we'll see that refresh.
132
00:12:20,320 --> 00:12:28,000
And now all of our inputs are on their own lines and we can continue styling them from here.
133
00:12:28,020 --> 00:12:34,650
Now I want to point out how if we scroll the page of we resize this all the way up here then all of
134
00:12:34,650 --> 00:12:38,290
our content is definitely not sitting where we would want it.
135
00:12:38,340 --> 00:12:43,140
You know ideally we want this to be aligned here in the center of the section.
136
00:12:43,140 --> 00:12:46,260
So it's most efficiently using the space available to it.
137
00:12:46,500 --> 00:12:48,720
But if we were to try and change that.
138
00:12:48,810 --> 00:12:56,880
So if we were to go over to our code and scroll up and we see that we've got a direction of column on
139
00:12:56,880 --> 00:13:00,590
our container wrapping all of the Contact Us contents.
140
00:13:00,720 --> 00:13:07,710
And remember how we use the justify Center to bring all the continent down here in the center this way.
141
00:13:07,710 --> 00:13:14,340
Well now let's try and use the line items prop to center our content horizontally since that is the
142
00:13:14,370 --> 00:13:18,050
cross axis of the direction column here.
143
00:13:18,060 --> 00:13:26,280
So we'll add in a line items of center and if we save this we see the page refresh and some of our content
144
00:13:26,340 --> 00:13:27,470
has jumped over.
145
00:13:27,540 --> 00:13:34,280
But some of it also has not the text fields here have not correctly jumped over the phone.
146
00:13:34,290 --> 00:13:39,600
Here is not jumping over and so I'm going to go ahead and actually get rid of that a line item sensor
147
00:13:39,600 --> 00:13:43,320
because it's not what we want to do yet it's going to cause some issues.
148
00:13:43,410 --> 00:13:47,130
So we're going to change our setup just a little bit in the next video.
16699
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.