text
stringlengths 1
81
| start
float64 0
10.1k
| duration
float64 0
24.9
|
|---|---|---|
I now save the variables.scss file.
| 6,862.7
| 3.04
|
And now, without doing anything--
take a look at my terminal--
| 6,865.74
| 3.3
|
Sass detected a change
to variables.scss,
| 6,869.04
| 3.61
|
so it gave me a new version
of my original CSS file.
| 6,872.65
| 4.38
|
If I go back to my web browser now,
refresh the page, now, all of the text
| 6,877.03
| 4.51
|
is green, as I would expect it to be.
| 6,881.54
| 3.59
|
So that's one of the very powerful
features that Sass gives us.
| 6,885.13
| 3.5
|
It gives us the ability to add
variables to our CSS code just
| 6,888.63
| 3.54
|
to factor out commonalities.
| 6,892.17
| 1.59
|
If there are common fonts, common
colors, common borders, common styling,
| 6,893.76
| 3.96
|
that I want to apply to a
lot of different things,
| 6,897.72
| 2.28
|
it becomes much easier just
to use Sass in order to do so.
| 6,900
| 4.31
|
And finally, we'll take a look
at a couple of other features
| 6,904.31
| 2.92
|
that Sass gives us the
ability to do, one of them
| 6,907.23
| 3.18
|
is the ability to nest CSS selectors
inside of other CSS selectors.
| 6,910.41
| 5.5
|
So one thing you've seen
so far, for example,
| 6,915.91
| 2.19
|
is that in CSS, if I wanted to style all
of the unordered lists that are inside
| 6,918.1
| 5.93
|
of divs, for example, I could say
like, div arrow unordered list,
| 6,924.03
| 5.67
|
in order to style unordered
lists that are inside of divs.
| 6,929.7
| 4.74
|
What Sass will do is that will give
us a bit of a nicer syntax for doing
| 6,934.44
| 4.2
|
this type of thing, in particular,
by allowing us to nest CSS inside
| 6,938.64
| 4.98
|
of other pieces of CSS.
| 6,943.62
| 2.45
|
So just as an example
of this, I'll go ahead
| 6,946.07
| 2.11
|
and open up a file I already
brought, called nesting.html.
| 6,948.18
| 4.74
|
And so here is what we might
see inside of nesting.html.
| 6,952.92
| 2.63
|
Here is the body of the page.
| 6,955.55
| 2.44
|
Inside the body of the page,
I have a div, inside of which
| 6,957.99
| 3.9
|
is a paragraph inside the div and
also a list, an unordered list,
| 6,961.89
| 3.72
|
or ul, that's inside
of this div as well.
| 6,965.61
| 3.67
|
And then we also have a paragraph
that's outside of the div.
| 6,969.28
| 2.93
|
And a list that's outside of
the div in addition to that.
| 6,972.21
| 3.2
|
So a number of different elements,
some of which are located inside
| 6,975.41
| 2.8
|
of other elements.
| 6,978.21
| 1.05
|
And what I'd like to do is be very
precise about how I style these pages.
| 6,979.26
| 5.39
|
What Sass is going to
allow us to do is it
| 6,984.65
| 2.41
|
lets us write a Sass file that
looks a little something like this.
| 6,987.06
| 4.39
|
Let's take a look at what it's doing.
| 6,991.45
| 1.55
|
It's saying, for the
entire div, I would like
| 6,993
| 2.97
|
to give that div a
font size of 18 pixels.
| 6,995.97
| 3.18
|
And then, what CSS normally
doesn't allow us to do,
| 6,999.15
| 3.06
|
but we can do now using
the power of Sass,
| 7,002.21
| 2.4
|
is say, for any paragraphs
that are inside of that div,
| 7,004.61
| 3.9
|
go ahead and give those
paragraphs the color of blue.
| 7,008.51
| 2.73
|
And for any unordered lists
that are inside of the div,
| 7,011.24
| 3.09
|
give those unordered
lists a color of green.
| 7,014.33
| 2.94
|
By nesting these CSS
selectors inside of others,
| 7,017.27
| 3.18
|
we've been able to get
across the idea that I only
| 7,020.45
| 2.91
|
want to style the paragraph
if it is inside of a div.
| 7,023.36
| 3.42
|
And this is just a little bit
of a nicer, cleaner syntax
| 7,026.78
| 3.12
|
for doing some of these more complex
styling tasks that might come up.
| 7,029.9
| 4.57
|
So what does this actually look like?
| 7,034.47
| 1.55
|
If I like take this SCSS file
and turn it into normal CSS,
| 7,036.02
| 4.17
|
what is the result going to be?
| 7,040.19
| 1.83
|
Well, let's take a look.
| 7,042.02
| 1.36
|
We can try it out by let me
go into my nesting folder
| 7,043.38
| 3.77
|
where all these files are located.
| 7,047.15
| 1.89
|
And if I run Sass nesting.scss,
turn it into nesting.css,
| 7,049.04
| 7.93
|
now let's open up nesting.css
and see what it looks like.
| 7,056.97
| 3.74
|
Here, it's turned into
a take all of the divs,
| 7,060.71
| 2.73
|
give them a font size of 18 pixels.
| 7,063.44
| 2.24
|
And then, we're using the same
descendant selector notation
| 7,065.68
| 3.97
|
that we saw before, where all
the paragraphs inside of divs
| 7,069.65
| 3.27
|
should be colored blue, all the
unordered lists inside of a div
| 7,072.92
| 3.21
|
should be colored green.
| 7,076.13
| 1.29
|
And this certainly works.
| 7,077.42
| 1.21
|
And we could have just written
this CSS from the beginning,
| 7,078.63
| 2.75
|
but it can be a little bit cleaner, a
little bit easier to read to use Sass
| 7,081.38
| 4.35
|
in order to really say,
paragraphs inside of divs
| 7,085.73
| 3.2
|
should be structured this way, unordered
lists are styled in some other way.
| 7,088.93
| 3.83
|
And using this nothing approach
just makes it often easier
| 7,092.76
| 2.84
|
to take a look at this SCSS
page and really understand
| 7,095.6
| 3.96
|
how all of the different style
code interacts with each other.
| 7,099.56
| 3.83
|
So after all of this now,
if I open up nesting.html,
| 7,103.39
| 5.2
|
we might see something that looks
a little something like this.
| 7,108.59
| 3
|
The paragraph inside the div and
the list inside of the div, those
| 7,111.59
| 3.72
|
both get changes to the way
that they've been styled.
| 7,115.31
| 3.18
|
But unlike them, these
paragraphs outside of the div
| 7,118.49
| 3.24
|
and the list that is
also outside of the div,
| 7,121.73
| 2.13
|
those get styled a
little bit differently.
| 7,123.86
| 3.43
|
So two features now we've
seen inside of Sass.
| 7,127.29
| 2.45
|
We've first seen the
ability to have variables
| 7,129.74
| 2.57
|
to make sure we're not
repeating ourselves
| 7,132.31
| 1.75
|
in many places throughout the code.
| 7,134.06
| 1.68
|
And now, we've seen the ability to
nest CSS selectors inside of each other
| 7,135.74
| 4.62
|
by taking advantage of Sass.
| 7,140.36
| 2.52
|
And finally, we'll take a
look at one last feature
| 7,142.88
| 2.46
|
that Sass is going to give us.
| 7,145.34
| 1.44
|
And that is something
called inheritance.
| 7,146.78
| 2.28
|
If we have certain CSS selectors that
are related to other CSS selectors,
| 7,149.06
| 4.65
|
but they're may be adding
some additional information.
| 7,153.71
| 3.18
|
And in this case, I'm actually going
to show you the finished product first.
| 7,156.89
| 3.46
|
So let's go into inheritance and
let me open up inheritance.html.
| 7,160.35
| 5.75
|
And here, you see I've
tried to almost implement
| 7,166.1
| 2.79
|
Bootstrap-style alert messages in HTML.
| 7,168.89
| 3.48
|
I have a success message up at the
top, a warning message, and then
| 7,172.37
| 2.91
|
an error message.
| 7,175.28
| 1.2
|
And each of these messages you'll
notice are styled differently.
| 7,176.48
| 2.88
|
In particular they're
each a different color.
| 7,179.36
| 2.13
|
But despite that, they
share a lot in common.
| 7,181.49
| 2.52
|
They share a common border.
| 7,184.01
| 1.26
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.