Fireship · @fireship
CSS just changed forever… plus 7 new features you don't know about
Uploaded November 18, 2024 · Length 4:18
Summary
Fireship explains 7 new CSS features, including aligned content, property at rule, starting style, math functions, light dark mode, user valid and invalid pseudo classes, and interpolate size.
- css
- new features
- aligned content
- css houdini
- property at rule
- starting style
- css math functions
- light dark mode
- css pseudo classes
- interpolate size
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
if you decide to become a developer
- 0:01
you'll be introduced to a wide variety
- 0:03
of new types of headaches triggered by
- 0:05
the stressors of blue light exposure
- 0:07
excessive sitting and unrealistic
- 0:08
deadlines but the worst type of headache
- 0:10
you can experience is the one that's
- 0:12
triggered when attempting to update some
- 0:13
Legacy CSS code luckily though CSS just
- 0:16
got a massive update that will help you
- 0:18
forget about all of its pain points a
- 0:20
beautiful new logo in the color of
- 0:22
Rebecca purple a color with a special
- 0:24
backstory in much the same way flame
- 0:26
stickers make your cargo faster this new
- 0:28
logo will make CSS not suck anymore more
- 0:30
because it serves as a reminder that CSS
- 0:32
is actually awesome when you use
- 0:34
features on the modern Baseline path
- 0:36
which is supported by all major browsers
- 0:38
in today's video we'll look at seven new
- 0:40
features you can use as a web developer
- 0:42
that you didn't know exist it is
- 0:44
November 18th 2024 and you're watching
- 0:46
the code report I'm not going to sit
- 0:48
here and beat a dead horse showing you a
- 0:49
bunch of memes about how to center a div
- 0:52
because those memes are now totally
- 0:53
obsolete thanks to the aligned content
- 0:55
property which doesn't require flexbox
- 0:57
or grid and just works in any block
- 0:59
layer out why nobody thought to make
- 1:01
this a thing 25 years ago I have no idea
- 1:04
but that's not the only game Cher
- 1:05
another new feature you need to know
- 1:06
about is the property at rule which is a
- 1:09
part of CSS Houdini we can easily create
- 1:11
a variable in CSS like so but the
- 1:14
problem here is that the browser
- 1:15
interprets its value as a string and
- 1:17
that makes it impossible to achieve
- 1:19
certain types of animations with
- 1:20
variables like the percentage of a
- 1:22
gradient with property you can now give
- 1:23
your variables a specific type like
- 1:26
number color percentage and so on which
- 1:28
not only makes your code safer but also
- 1:30
allows the browser to use that value in
- 1:32
animations speaking of animations
- 1:34
another powerful new out rule is
- 1:36
starting style which allows you to
- 1:38
define a style when an element is first
- 1:40
rendered in a page it's especially
- 1:42
useful when you have something like a
- 1:43
dialogue or popover or anything hidden
- 1:46
with display none because once you flip
- 1:48
display none it immediately appears in
- 1:50
the page even if you defined a
- 1:51
transition animation that's pretty
- 1:53
annoying but now with starting style we
- 1:55
can easily position an element as the
- 1:57
starting point for an animation like for
- 1:59
example we might translate a dialogue


