text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
They share a common font.
7,185.27
1.32
They share a common size and many other properties
7,186.59
2.7
are all shared between these elements.
7,189.29
1.8
There are just some things that are a little bit different about them.
7,191.09
3.75
I could have written three different CSS selectors
7,194.84
2.46
to deal with all of these cases, but there might be some repetition there.
7,197.3
3.73
So here's what I can do by taking advantage of the features
7,201.03
2.93
that Sass gives me.
7,203.96
1.65
Let me go ahead and look at inheritance.scss to look at the code
7,205.61
4.95
for doing this.
7,210.56
1.97
And it looks a little bit cryptic at first.
7,212.53
3.12
But here's what I've defined.
7,215.65
1.71
I've here defined using a percent sign that this is what a generic message is
7,217.36
4.44
going to be, something that I can extend later to add additional information to.
7,221.8
4.41
All of the messages, whether they be success messages or danger messages
7,226.21
3.18
or warning messages, they're all going to have the same font.
7,229.39
2.81
They're all going to have the same border.
7,232.2
1.75
They're all going to have the same padding and margin, spacing
7,233.95
2.58
around and outside of it.
7,236.53
1.56
But each of the specific messages are going to be slightly different.
7,238.09
4.86
How are they different?
7,242.95
1.09
Well, let's take a look down here.
7,244.04
1.91
Anything with a class of success, I'm going to say extends this message.
7,245.95
6.12
And by extends this message what I mean is that anything with a class
7,252.07
3.42
of success is going to inherit all of these CSS properties-- the font,
7,255.49
4.77
the border, the padding in the margin--
7,260.26
2.4
but it's going to add additional information to it.
7,262.66
2.13
In particular, we're going to add a color.
7,264.79
2.34
We're going to say that for success messages,
7,267.13
1.89
the background color is going to be green.
7,269.02
2.71
I've extended the basics of what a message is, but said
7,271.73
2.78
that this message in particular has some additional style that we're
7,274.51
3.6
going to assign to it as well.
7,278.11
2.22
And the other two messages behave in very similar ways.
7,280.33
2.67
My warning message extends the message, but instead
7,283
3.18
says the background color should be orange.
7,286.18
2.22
And finally, the error message also extends the message.
7,288.4
2.82
But this time, it gives us the background color of red instead.
7,291.22
4.51
So now, when you compile this all together
7,295.73
2.3
into inheritance.css, which I compiled it in advance,
7,298.03
4.3
this is what this is ultimately going to look like.
7,302.33
2.18
It translates what I've written into saying,
7,304.51
2.34
all right, success and warning and errors
7,306.85
2.82
should have all of these properties.
7,309.67
2.19
But success should also have this background color,
7,311.86
2.36
warning should have this background color,
7,314.22
1.75
error should have this background color.
7,315.97
1.96
So again, we could have written this CSS.
7,317.93
2.18
There is nothing that Sass does that we couldn't
7,320.11
2.76
have written ourselves using CSS.
7,322.87
2.58
Sass we'll just make it a little bit easier to do many of the same thing.
7,325.45
3.67
So we can write things in a little bit of a nicer syntax
7,329.12
2.57
by saying the success message inherits from the message
7,331.69
3.15
but adds a background color.
7,334.84
1.6
And likewise, the warning and error messages do the same thing,
7,336.44
3.36
but in a simpler syntax and a bit of a nicer syntax, such that later
7,339.8
3.8
we can let the computer take the Sass code and compile it into CSS instead.
7,343.6
6
And so those now are some of the fundamentals
7,349.6
2.46
of what we've seen in building web programs using HTML and CSS.
7,352.06
3.99
We've seen how we can use HTML to describe the structure of our web page,
7,356.05
3.9
deciding what's going to show up where on the page, and then we looked at CSS
7,359.95
3.57
and how CSS can then be used to style our web page in various different ways,
7,363.52
4.05
adding custom styling like colors and layouts,
7,367.57
2.49
but also thinking about things like responsive design,
7,370.06
3.03
like what happens on a mobile screen or on a tablet,
7,373.09
2.52
and making sure that our web pages look good on those screens too.
7,375.61
3.67
And then finally, we took a look at Sass, an extension to CSS,
7,379.28
3.43
that adds a number of additional features,
7,382.71
1.75
features like variables and nesting and inheritance,
7,384.46
3.14
that make it even easier for us to be able to write style
7,387.6
2.77
that we can apply to our web pages.
7,390.37
2.09
From there, we're going to be transitioning now
7,392.46
1.96
to looking at how we can use HTML and CSS in larger web applications
7,394.42
4.14
as we begin to incorporate other tools, tools like Python and JavaScript
7,398.56
4.11
and other languages and frameworks altogether.
7,402.67
2.25
So this is Web Programming with Python and JavaScript.
7,404.92
3.09
We'll see you next time.
7,408.01
2.09