@property Is One Of The Coolest New CSS Features

Поділитися
Вставка
  • Опубліковано 18 вер 2024

КОМЕНТАРІ • 44

  • @nomadshiba
    @nomadshiba День тому +32

    you didnt talk about how it benefits transitions.
    because normally you cant transition custom properties because browser doesnt know the type of it, so it cant know how to transition it
    but with @property we can transition the custom properties.

    • @WebDevSimplified
      @WebDevSimplified  День тому +7

      That is a great point!

    • @thewhite8782
      @thewhite8782 День тому +3

      Can you give an example or what to look up to understand this? I don't know what's meant with custom property transitions but I'm interested to know

  • @injSrc
    @injSrc День тому +7

    The only use of this @propeties I see is the ability to transitions of custome property

    • @mikescholz6429
      @mikescholz6429 День тому

      Thats the reason I’ve been waiting for it.

  • @morrowr08
    @morrowr08 День тому +2

    Can the `syntax` inside property be a variable? If so, could you potentially have all your color variables and then create a variable that is essentially an enum and dev can only select one of those options?

  • @adamstuartclark
    @adamstuartclark День тому +7

    Feels like CSS didn't really need this feature.

  • @nwfashionmedia
    @nwfashionmedia День тому +24

    Feels like a solution looking for a problem. What does this solve? Someone constantly assigning px values to color variables? The only value I can see here is that maybe I can bill more hours because I had to make the CSS type-safe. Or maybe I can finally win that award for Most Overly Complex CSS.

    • @aimableruhumuriza8603
      @aimableruhumuriza8603 21 годину тому

      That is true for most of framworks and libraries in these days. Instead of improving existing ones to solve new problems, a new one will be created and become must have skill to learn. It's crazy

    • @radhy9173
      @radhy9173 18 годин тому +1

      By default browsers only knows css values as string, which make it disables behaviours like transitions for some stuff like gradient. Assigning it to the correct type allow browser to animate those by assigning the typed custom properties instead. That is the basic stuff this feature enables. More advanced use case would be usage of inside worklet to hack into low-level CSS engine with CSS Houdini so devs can author their own CSS styles that can be configured with CSS variables.

    • @andreybogdanov3
      @andreybogdanov3 8 годин тому

      Congrats, you just discovered the purpose of TS🎉

  • @youcefg9760
    @youcefg9760 День тому

    I didn't notice this was added to Firefox in v128.0 (Jul 9th)
    Now only Paint API and Typed OM left to catch-up to the other browsers.

  • @the-iter8
    @the-iter8 22 години тому +1

    Honestly it seems like a solution that no body really needed, I would rather put some safety rules on properties like color, fontsize etc to not to accept raw values but to only accept variables. Not related to type safety but would be a great-kind-of-contextual solution

  • @markg5891
    @markg5891 День тому +12

    Oh my... Web development truly has gone ludicrously stupid. CSS is "fairly" strong typed. You have a property (color) which can have a defined set of values.
    But no, people wanted variables to "clean up" redundant css and reuse. And yes, for big css files it does look better with variables. And it might even be vital for themes.
    Now people want those variables to have that same strong type as CSS has without variables.
    So lets pollute the CSS with more garbage to have strong typed properties.
    And why? Because devs apparently make mistakes and fill in the wrong type (like pixels) where a color is intended...Thus this type safety is __ONLY__ a developer aid. It serves __NO__ purpose when you visit your site.
    Next i suppose we're gonna get "css debug symbols" akin to .map files for js. A file describing the property strong types.
    If you want to have a "typescript for css" (which this essentially is going to boil down to) then just cram this bs into SCSS and leave it out of the plain CSS files. If you have those dreaded .map files your browser already shows you the scss files so just go that route if you like added complexity.
    End of my rant...

    • @linela
      @linela День тому +2

      Yeah, this is a high level of stupidity...

    • @SardenR
      @SardenR День тому

      Maybe before before spouting so much bs learn a little about the thing you shiting about? @property has been there for a while along with other new low-level CSS features like houdini, paint API, etc for years now. If you think this feature is merely for type safety that serve no purpose whatsoever only shows how informed you are about the topic you are talking about.

    • @markg5891
      @markg5891 День тому

      @@SardenR Thank you for pointing me to that! Years means nothing for a feature to get standardized and usable everywhere, which is what this "@property" is about. Reg. houdini and paint api. I looked into it. It ties CSS and js even more, the exact opposite of what i want. It makes it even worse then i thought.

    • @radhy9173
      @radhy9173 День тому +1

      ​@@markg5891 it doesn't mean anything that it is the exact opposite of what you want because many people have been waiting and watching the progress for about 4 years now. Many people including me would like the ability to hack into low level engine of CSS with houdini features and worklet, @property is one of the foundation being worked upon to achieve that and just because you don't like it won't make it less important to the rest of us.

  • @floppa9415
    @floppa9415 День тому +3

    Browsers are adding the most random stuff to CSS without fixing basic stuff really annoys people, mainly that when doing complex layout stuff everything behaves in a so unpredicatably.

    • @specy_
      @specy_ Годину тому

      For example? What's some basic stuff that needs fixing

    • @richarddefortune1329
      @richarddefortune1329 41 хвилина тому

      Curious as well

  • @youcefg9760
    @youcefg9760 День тому

    This is part of the CSS Houdini Properties and Values API Level 1
    ua-cam.com/video/sPbpElWAJ68/v-deo.html

  • @OneHundy
    @OneHundy День тому

    Is there a shorthand for this?

  • @rodrigolaporte274
    @rodrigolaporte274 День тому

    VERY cool!

  • @engine_man
    @engine_man 16 годин тому

    Except css rules have always had a specific type of value you can use.

  • @arslan._.iftikhar
    @arslan._.iftikhar День тому +1

    .

  • @AVidhanR
    @AVidhanR День тому

    WoW WoW that's a good feature for real 🎉

  • @fathimashaikha996
    @fathimashaikha996 День тому

    Wow

  • @KimBarimg
    @KimBarimg День тому

    im early, yey✨

  • @masaratech
    @masaratech 23 години тому

    Bullshit

  • @sanan4li
    @sanan4li День тому

    Feel sad for people still prefer unmaintainable css over tailwindcss

    • @HomePhone-y2s
      @HomePhone-y2s 12 годин тому +1

      Feel worse for people that still believe class based frameworks like tailwind for CSS is actually understanding CSS

  • @linela
    @linela День тому +2

    Can you stop shaking your head so often?

    • @GHSB7462
      @GHSB7462 День тому

      ?

    • @secretsquirrel5566
      @secretsquirrel5566 День тому

      Can you shut up and just learn?

    • @charleschukwuemeka8482
      @charleschukwuemeka8482 День тому +5

      Stop watching his videos if that irritates you. It's the audacity for me

    • @yonnierenton6177
      @yonnierenton6177 День тому +1

      says so much, please don't make him change? like he is real-time explaining with expression/s and passion. (focus on the code) const result = shakeDetected ? (goodContent && tested && knowledgeable ? "❤ Love it: the shake is perfect, priceless, don't ever change!" : "⚠ Shake detected, but needs some refinement.") : "🤔 No shake or unclear movement, let's work on it."; and he shows us, what is good if he believes in it, does it work, can he stand by it etc... cheers. much love!

    • @yonnierenton6177
      @yonnierenton6177 День тому +1

      what did I learn, use tailwind lol, hope this is taken good, what I say. meaning this is good, love it everything about this channel, cheers.

  • @munna5553
    @munna5553 День тому

    HTML, CSS alway a shit in never be a improved 😊