Fireship · @fireship

CSS just changed forever… plus 7 new features you don't know about

Uploaded November 18, 2024 · Length 4:18

CSS just changed forever… plus 7 new features you don't know about

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.

  1. 0:00

    if you decide to become a developer

  2. 0:01

    you'll be introduced to a wide variety

  3. 0:03

    of new types of headaches triggered by

  4. 0:05

    the stressors of blue light exposure

  5. 0:07

    excessive sitting and unrealistic

  6. 0:08

    deadlines but the worst type of headache

  7. 0:10

    you can experience is the one that's

  8. 0:12

    triggered when attempting to update some

  9. 0:13

    Legacy CSS code luckily though CSS just

  10. 0:16

    got a massive update that will help you

  11. 0:18

    forget about all of its pain points a

  12. 0:20

    beautiful new logo in the color of

  13. 0:22

    Rebecca purple a color with a special

  14. 0:24

    backstory in much the same way flame

  15. 0:26

    stickers make your cargo faster this new

  16. 0:28

    logo will make CSS not suck anymore more

  17. 0:30

    because it serves as a reminder that CSS

  18. 0:32

    is actually awesome when you use

  19. 0:34

    features on the modern Baseline path

  20. 0:36

    which is supported by all major browsers

  21. 0:38

    in today's video we'll look at seven new

  22. 0:40

    features you can use as a web developer

  23. 0:42

    that you didn't know exist it is

  24. 0:44

    November 18th 2024 and you're watching

  25. 0:46

    the code report I'm not going to sit

  26. 0:48

    here and beat a dead horse showing you a

  27. 0:49

    bunch of memes about how to center a div

  28. 0:52

    because those memes are now totally

  29. 0:53

    obsolete thanks to the aligned content

  30. 0:55

    property which doesn't require flexbox

  31. 0:57

    or grid and just works in any block

  32. 0:59

    layer out why nobody thought to make

  33. 1:01

    this a thing 25 years ago I have no idea

  34. 1:04

    but that's not the only game Cher

  35. 1:05

    another new feature you need to know

  36. 1:06

    about is the property at rule which is a

  37. 1:09

    part of CSS Houdini we can easily create

  38. 1:11

    a variable in CSS like so but the

  39. 1:14

    problem here is that the browser

  40. 1:15

    interprets its value as a string and

  41. 1:17

    that makes it impossible to achieve

  42. 1:19

    certain types of animations with

  43. 1:20

    variables like the percentage of a

  44. 1:22

    gradient with property you can now give

  45. 1:23

    your variables a specific type like

  46. 1:26

    number color percentage and so on which

  47. 1:28

    not only makes your code safer but also

  48. 1:30

    allows the browser to use that value in

  49. 1:32

    animations speaking of animations

  50. 1:34

    another powerful new out rule is

  51. 1:36

    starting style which allows you to

  52. 1:38

    define a style when an element is first

  53. 1:40

    rendered in a page it's especially

  54. 1:42

    useful when you have something like a

  55. 1:43

    dialogue or popover or anything hidden

  56. 1:46

    with display none because once you flip

  57. 1:48

    display none it immediately appears in

  58. 1:50

    the page even if you defined a

  59. 1:51

    transition animation that's pretty

  60. 1:53

    annoying but now with starting style we

  61. 1:55

    can easily position an element as the

  62. 1:57

    starting point for an animation like for

  63. 1:59

    example we might translate a dialogue