Supercharge Your Styling with CSS Custom Properties

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ค. 2024
  • Unleash the Power of CSS Custom Properties, also known as CSS variables, in this comprehensive tutorial. It is designed to help front-end developers understand the significance of custom properties in modern web design and how to leverage them effectively in projects.
    Custom properties allow us to define values once and reuse them throughout the CSS code, offering greater flexibility and maintainability. By defining custom properties using the two-dash syntax to utilizing @property ruleset, everything is covered. As the tutorial progresses, we will learn practical techniques for utilizing custom properties to enhance their web styling capabilities. Advanced techniques include creating fallback values, controlling inheritance, and optimizing performance.
    Whether you're a beginner or a seasoned professional, this tutorial offers practical guidance and insights to help you unlock the full potential of CSS custom properties in your web projects. Don't miss out on this opportunity to elevate your web design skills and take your projects to new heights with CSS custom properties.
    Related Topics
    -----------------------------------------------------
    - Unlock the Potential of CSS Custom Properties | CSS Variables
    - CSS Variables - An introduction to CSS custom properties
    - Get more out of custom properties
    - CSS Variables Tutorial (CSS Custom Properties)
    - CSS Custom Properties - Supercharged
    Chapters
    -----------------------------------------------------
    00:00 Intro
    00:39 Why do we need custom properties in CSS?
    01:17 Intro to the CSS custom properties
    03:20 The fallback value
    04:50 @property ruleset
    06:06 Custom property and inline styles
    Subscribe and never miss a beat
    -----------------------------------------------------
    🔔 Subscribe for more videos like this: / @optimisticweb
    Learn at your own pace
    -----------------------------------------------------
    - Learn HTML - • HTML
    - Learn CSS - • CSS
    - Learn JavaScript - • JavaScript
    Connect, share, and grow
    -----------------------------------------------------
    - TH-cam: / @optimisticweb
    - X (Twitter): / optimisticweb
    - Instagram: / optimisticweb
    - Facebook: / optimisticweb
    - CodePen: codepen.io/optimisticweb
    #css #cssvariables #csscustomproperties #customproperties #frontenddevelopment #frontend #webdevtutorial #csstutorialforbeginners #webdesign #cssmagic #csstutorial #html #cssforbeginners #learncss #learnhtml #optimisticweb

ความคิดเห็น • 8

  • @surakadotme
    @surakadotme 2 หลายเดือนก่อน +3

    thanks for this video. i very like custom properties.

    • @OptimisticWeb
      @OptimisticWeb  2 หลายเดือนก่อน

      You're welcome! Yes, custom properties provide greater flexibility and maintainability in CSS.

  • @saladexe5398
    @saladexe5398 หลายเดือนก่อน +1

    Nice

  • @biggand8520
    @biggand8520 2 หลายเดือนก่อน +1

    Hello, as always relevant and accessible. With the custom properties and fallbacks (especially with fallbacks) I've just built my entire dark mode for my app :)) So, custom properties are powerful enough; they add to the CSS the features of a real programming language. Moreover, recently Chrome dev-tools gained the possibility to inspect custom properties, now you can inspect which rule was applied to your element and where it came from. It is really helpful when there are multi-fallbacks across embedded CSS files. Maybe I'm wrong and Chrome has this possibility (as Safari does), maybe it was hidden somewhere, however, the development process was harder. Now you can literally click on the custom property and inspect where it came from. So yeah, the topic is relevant and the environment is conducive. But frankly speaking, I don't like the overuse of the custom properties, when every single feature (sizes, radiuses, colors, and etc) is defined with them, CSS turns into endless lists of declarations, however, it comes to personal preferences and code balance.

    • @OptimisticWeb
      @OptimisticWeb  2 หลายเดือนก่อน

      I completely agree with your observation. Custom properties are indeed powerful for maintaining code, yet it's important to be mindful of overuse, as it can introduce other issues. Finding the right balance is key.

  • @Kogemate
    @Kogemate 2 หลายเดือนก่อน +1

    Dark mode was a nightmare to implement. With custom properties, you can change the colors with simplicity even of the graphic elements (svg accepts the custom properties from the css!). So now, there is no need to switch logos, you only need to fill the svg with a different color.

    • @OptimisticWeb
      @OptimisticWeb  2 หลายเดือนก่อน

      You're absolutely right! Thanks for sharing your experience.