All language subtitles for 011 Adding Basic CSS Styling_en

af Afrikaans
sq Albanian
am Amharic
ar Arabic Download
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian Download
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:02,070 --> 00:00:03,389 Now regarding the styling 2 00:00:03,389 --> 00:00:07,880 of our components, we still use CSS, 3 00:00:07,880 --> 00:00:10,540 but there is nothing too React specific 4 00:00:10,540 --> 00:00:13,070 when it comes to that CSS code. 5 00:00:13,070 --> 00:00:15,880 In the end, we can just add a new CSS file. 6 00:00:15,880 --> 00:00:19,730 And typically for the CSS code of a given component 7 00:00:19,730 --> 00:00:24,050 you add that file next to the component JavaScript file 8 00:00:24,050 --> 00:00:27,773 and that would be the ExpenseItem.CSS file here. 9 00:00:29,330 --> 00:00:32,250 Then you want to write your CSS code in there 10 00:00:32,250 --> 00:00:34,480 but since this is no CSS course, 11 00:00:34,480 --> 00:00:37,710 I don't want to bore you with writing a lot of CSS code 12 00:00:37,710 --> 00:00:40,180 and hence you attached find a finished 13 00:00:40,180 --> 00:00:43,750 ExpenseItem.CSS file, which you can simply download 14 00:00:43,750 --> 00:00:47,090 and use or simply download it, open it, 15 00:00:47,090 --> 00:00:49,420 and copy the code you find in there 16 00:00:49,420 --> 00:00:52,283 into your ExpenseItem.CSS file. 17 00:00:54,750 --> 00:00:57,620 Now back in ExpenseItem.js, 18 00:00:57,620 --> 00:00:59,780 we need to do one important thing. 19 00:00:59,780 --> 00:01:02,770 We need to make this overall build process 20 00:01:02,770 --> 00:01:05,860 aware of that CSS file and tell it 21 00:01:05,860 --> 00:01:09,250 that the CSS code in there should be considered 22 00:01:09,250 --> 00:01:12,760 and should be injected in the finished application 23 00:01:12,760 --> 00:01:17,670 because it's not by default browsing all your files 24 00:01:17,670 --> 00:01:20,000 and automatically including everything, 25 00:01:20,000 --> 00:01:23,520 you explicitly have to tell React, you could say, 26 00:01:23,520 --> 00:01:26,410 or that build process that a certain file 27 00:01:26,410 --> 00:01:27,920 should be considered. 28 00:01:27,920 --> 00:01:30,090 For ExpenseItem.js, we did this 29 00:01:30,090 --> 00:01:32,360 with this import and app JS. 30 00:01:32,360 --> 00:01:35,070 For expenseItem.CSS, we need to do that 31 00:01:35,070 --> 00:01:37,610 instead of ExpenseItem.js, 32 00:01:37,610 --> 00:01:41,013 there we simply import ./ExpenseItem.CSS 33 00:01:43,690 --> 00:01:44,623 just like that. 34 00:01:45,650 --> 00:01:47,790 This simply tells the build process 35 00:01:47,790 --> 00:01:50,113 that the CSS files should be considered. 36 00:01:51,120 --> 00:01:53,620 Now instead that CSS file, I in the end, 37 00:01:53,620 --> 00:01:56,430 just prepared a bunch of CSS classes 38 00:01:56,430 --> 00:02:00,350 which can be added to elements to apply a certain look 39 00:02:00,350 --> 00:02:02,700 and they are, for now, on this HTML code 40 00:02:02,700 --> 00:02:05,320 in ExpenseItem in our component 41 00:02:05,320 --> 00:02:07,923 we need to add these classes. 42 00:02:08,900 --> 00:02:13,200 For example, on the wrapping div here. 43 00:02:13,200 --> 00:02:15,490 Now there's one special thing here. 44 00:02:15,490 --> 00:02:20,490 We don't type class here as we would do in regular HTML, 45 00:02:21,000 --> 00:02:22,413 but instead className. 46 00:02:23,600 --> 00:02:27,170 And this can be strange, but you have to keep in mind 47 00:02:27,170 --> 00:02:30,930 that this here is not really HTML. 48 00:02:30,930 --> 00:02:33,900 It looks like HTML, but it's this special 49 00:02:33,900 --> 00:02:37,290 JSX syntex invented by the React team. 50 00:02:37,290 --> 00:02:42,083 And in the end under the hood, it's still JavaScript code, 51 00:02:43,520 --> 00:02:47,530 that's why most attributes are the same, but not all. 52 00:02:47,530 --> 00:02:51,450 And here the class attribute was renamed to className 53 00:02:51,450 --> 00:02:55,400 because class is a reserved word in JavaScript. 54 00:02:55,400 --> 00:02:56,860 Technically it would still work 55 00:02:56,860 --> 00:03:01,127 if you would use class here, but should use className. 56 00:03:01,127 --> 00:03:05,210 Now here on this overall div, which wraps everything, 57 00:03:05,210 --> 00:03:09,040 we then add the expense-item class here 58 00:03:10,100 --> 00:03:14,160 On this div, which holds our title and our amount, 59 00:03:14,160 --> 00:03:15,660 we add another of className, 60 00:03:15,660 --> 00:03:19,150 which is expense-item__. 61 00:03:19,150 --> 00:03:21,310 So here we got two underscores. 62 00:03:21,310 --> 00:03:22,593 Description. 63 00:03:23,730 --> 00:03:26,650 And then here on that div with the amount 64 00:03:26,650 --> 00:03:31,650 we simply add className and then expense-item__price. 65 00:03:36,680 --> 00:03:38,846 And if you now save everything, 66 00:03:38,846 --> 00:03:42,840 it should look like this, which is definitely nicer. 67 00:03:42,840 --> 00:03:44,850 Still not the final look you want, 68 00:03:44,850 --> 00:03:46,360 but definitely nicer. 69 00:03:46,360 --> 00:03:48,640 By the way, I'm super zoomed in here 70 00:03:48,640 --> 00:03:50,130 to make this easier to read, 71 00:03:50,130 --> 00:03:52,500 otherwise it would look something like this 72 00:03:52,500 --> 00:03:54,400 and that's definitely also not great, 73 00:03:54,400 --> 00:03:56,770 but again, it's not the final look. 74 00:03:56,770 --> 00:03:58,210 Again, let me zoom in closer 75 00:03:58,210 --> 00:04:00,110 so that we can better see that though. 76 00:04:01,000 --> 00:04:03,730 Now that is how easy it is to add styling 77 00:04:03,730 --> 00:04:05,570 to your React components though. 78 00:04:05,570 --> 00:04:08,220 It's really not too fancy. 79 00:04:08,220 --> 00:04:09,950 You have to be aware of the fact 80 00:04:09,950 --> 00:04:12,188 that it's className instead of class, 81 00:04:12,188 --> 00:04:15,830 but other than that, it's really just standard 82 00:04:15,830 --> 00:04:20,529 CSS code, which then is added to your elements. 83 00:04:20,529 --> 00:04:22,890 And in that CSS code, you can use 84 00:04:22,890 --> 00:04:25,100 all the selectors you might know, 85 00:04:25,100 --> 00:04:27,780 you're not limited to classes, but again, 86 00:04:27,780 --> 00:04:30,370 I don't want to turn that into a CSS course, 87 00:04:30,370 --> 00:04:32,563 so we'll keep that fairly simple. 88 00:04:33,580 --> 00:04:36,930 This import might be the strangest thing in the end 89 00:04:36,930 --> 00:04:38,880 because that is needed to make 90 00:04:38,880 --> 00:04:42,220 this entire project aware of that CSS file. 91 00:04:42,220 --> 00:04:45,393 And that's how we can style our components. 7052

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.