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.
@WebDevSimplified3 ай бұрын
That is a great point!
@thewhite87823 ай бұрын
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
@Olympix_3 ай бұрын
@@WebDevSimplified I watch you from Uzbekistan! You are really increadible Developer But i wanted to ask you creating a carousel(swiper) in react-js with all components like:text, image, links(Not only with images) please Wait your respond
@w01dnick3 ай бұрын
@@thewhite8782 e.g. you have linear-gradient for button and want make a transition to another gradient on hover. It's a background image, which is discrete property, so it wouldn't transitioned, just immediate switch from one state to another. To overcome this you can create CSS variables --bg-top and --bg-bottom and use them in linear gradient. But browser doesn't know that they are colors, so it would transition them too. But with `@property` you can define them as '' and then gradient would be transitioned as desired.
@w01dnick3 ай бұрын
@@thewhite8782 e.g. you have linear-gradient for button and want make a transition to another gradient on hover. It's a background image, which is discrete property, so it wouldn't transitioned, just immediate switch from one state to another. To overcome this you can create CSS variables --bg-top and --bg-bottom and use them in linear gradient. But browser doesn't know that they are colors, so it would transition them too. But with `@property` you can define them as '' and then gradient would be transitioned as desired.
@nwfashionmedia3 ай бұрын
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.
@radhy91733 ай бұрын
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.
@andreybogdanov33 ай бұрын
Congrats, you just discovered the purpose of TS🎉
@ChadElliott_THEtheChad3 ай бұрын
In addition to informing the browser what the variable type is so it can properly transition the value during an animation (something not covered in this video), it enables inheritance, default values, and helps enforce the usage of proper values, making it less likely to introduce inconsistencies or bugs. I would also like to note that it's opt in, and you can add types to existing variables at your discretion. Have a normal stylesheet and notice your Jr devs are constantly mangling a poorly named variable? You could simply add a type def for that variable and put some guard rails around it.
@Microphunktv-jb3kj3 ай бұрын
.... seems like useful for the css lib authors. how many of actually have used vanilla css lately , instead of eg tailwind and others? :D
@nwfashionmedia3 ай бұрын
@@Microphunktv-jb3kj I switched back to "vanilla CSS" a while ago. I prefer dealing with as few pre-processors/transpilers as possible. I used to use LESS, then SASS/SCSS, but in my recent work I haven't missed them.
@damiandamianowski856918 күн бұрын
Great, From now every web developer can fix what web browser should do automaticly. Great for you w3c!
@edmasi15 күн бұрын
Gracias!
@GilGoldshlager3 ай бұрын
Cool feature, thanks 👍
@morrowr083 ай бұрын
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?
The only use of this @propeties I see is the ability to transitions of custome property
@mikescholz64293 ай бұрын
Thats the reason I’ve been waiting for it.
@Jumanji_Dev3 ай бұрын
CSS becoming TypeScript 🤨Daaaamnnn 🙃
@kamaboko116 күн бұрын
:root {} has been working well for years. Not sure how this TypeScript styled "solution?" is better.
@youcefg97603 ай бұрын
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.
@4120_PRATIKRATHOD3 ай бұрын
It's been a long time I'm using it for animations
@franzitaz3 ай бұрын
In this video was not understanding the purpose of this @property. For someone that didn't understand: One of the use cases is to solve problems of animations in CSS. The best example of him is using @property in this video, in my opinion: kzbin.info/www/bejne/qYHFoXiijKZ9bJosi=NLNEMniA19ehiDV4&t=223 PS: I think that they could make the syntax simpler as well. But I imagine that it was the best that maybe they could implement. /*Instead of:*/ @property --scale { syntax: ""; inherits: false; initial-value: 1; } /****************************/ /*Something like without the and inherits as optional:*/ @property --scale { syntax: "number"; initial-value: 1; }
@geforcesong3 ай бұрын
excellent!!
@soushi88853 ай бұрын
Next step : Typed HTML !
@AndrewTSq3 ай бұрын
Half of internets webpages would stop working then lol
@LatenightDev2 ай бұрын
This will make future frontend dev more confused to figure out that custom property. Imagine it was named with spanish or latin words.
@ErikErosa3 ай бұрын
Sounds interesting but… "Errors should never pass silently unless explicitly silenced" so I'm not convinced. Thanks for the info, though!
@the-iter83 ай бұрын
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
@youcefg97603 ай бұрын
This is part of the CSS Houdini Properties and Values API Level 1 kzbin.info/www/bejne/qYHFoXiijKZ9bJo
@hishamelfangary7223 ай бұрын
No. Stop. Just stop.
@tima13013 ай бұрын
💛💙
@OneHundy3 ай бұрын
Is there a shorthand for this?
@davidcrowell30413 ай бұрын
Why?
@IlyesCodes3 ай бұрын
Best question to ask, why the heck do we need type checking for a stylesheet
@MrJloa3 ай бұрын
Over engineering 👍 Solves imaginary problem yey
@IlyesCodes3 ай бұрын
This is really a headache to think about, i dont see a reason to add type checking to css it is just a styling language. Next step HTML type checking
@dariantrama25912 ай бұрын
Maybe include a real world useful example for why this is actually helpful? I see in the comments that this could be helpful for transitions or animations but aside from that this just seems like over complicating CSS for little to no reason. I can control the colors of my divs just fine without it!
@tommysmith54793 ай бұрын
You keep saying "custom properties" - do you mean variables?
@otaviocf46573 ай бұрын
the official documentation calls it custom properties
@tommysmith54793 ай бұрын
@@otaviocf4657 Ok - I just wanted clarification: so custom properties are variables - var()?
@Oskinavara3 ай бұрын
@@tommysmith5479 yes
@tommysmith54793 ай бұрын
@@Oskinavara Thanks all. That's rather confusing!
@anothermouth70773 ай бұрын
Another thing to be demanded by the recruiters which serves no purpose 😂
@FalioV3 ай бұрын
No tnx. I dont see how this will benefit me at all. I prefer to use out of the box UI library and style the components and put more effort in more complex part of the app then the visual looking. Those features will remain unusable (as many out there) for big part of the developers. Other then that interesting topic and good video as always! :)
@rodrigolaporte2743 ай бұрын
VERY cool!
@OmriTurge3 ай бұрын
Terrible, and useless. No need any type safety in css, people should stop with this fashioned thing
@adamstuartclark3 ай бұрын
Feels like CSS didn't really need this feature.
@nEMOheartTaco3 ай бұрын
Back when I was focused on building CSS frameworks and component libraries, this would have been really helpful. I think it just depends on your use-case.
@LatenightDev2 ай бұрын
@@nEMOheartTaco We already have root property, why you want to named your own property and become hard to understand for everyone ?
@floppa94153 ай бұрын
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_3 ай бұрын
For example? What's some basic stuff that needs fixing
@richarddefortune13293 ай бұрын
Curious as well
@AndrewTSq3 ай бұрын
I would like in drag & drop elements, that we could style the dragged element.
@gomesbruno201Ай бұрын
css had only one job: copy sass. they did it wrong
@AndrewTSq3 ай бұрын
so CSS is soon a destroyed thing if they add types into it.. why??
@diadetediotedio69183 ай бұрын
uh, this is more verbose than needed, I don't think it makes that sense. But if it fits your usecase, have some fun.
@markg58913 ай бұрын
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...
@linela3 ай бұрын
Yeah, this is a high level of stupidity...
@SardenR3 ай бұрын
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.
@markg58913 ай бұрын
@@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.
@radhy91733 ай бұрын
@@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.
@Developer_hubs3 ай бұрын
Thou shall not make CSS difficult with useless features!
@noggstaj3 ай бұрын
durrrrrp
@fathimashaikha9963 ай бұрын
Wow
@KimBarimg3 ай бұрын
im early, yey✨
@arslan._.iftikhar3 ай бұрын
.
@engine_man3 ай бұрын
Except css rules have always had a specific type of value you can use.
@IlyesCodes3 ай бұрын
Why the heck do we need types in css? Are we really trying to overcomplicate the simple things here? WHY DO WE NEED TYPES IN CSS I DONT GET IT
@OmriTurge3 ай бұрын
Simple, we dont😂
@IlyesCodes3 ай бұрын
@@OmriTurge XD TRUE
@AVidhanR3 ай бұрын
WoW WoW that's a good feature for real 🎉
@munna55533 ай бұрын
HTML, CSS alway a shit in never be a improved 😊
@linela3 ай бұрын
Can you stop shaking your head so often?
@GHSB74623 ай бұрын
?
@secretsquirrel55663 ай бұрын
Can you shut up and just learn?
@charleschukwuemeka84823 ай бұрын
Stop watching his videos if that irritates you. It's the audacity for me
@yonnierenton61773 ай бұрын
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!
@yonnierenton61773 ай бұрын
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.
@masar-at3 ай бұрын
Bullshit
@sanan4li3 ай бұрын
Feel sad for people still prefer unmaintainable css over tailwindcss
@HomePhone-y2s3 ай бұрын
Feel worse for people that still believe class based frameworks like tailwind for CSS is actually understanding CSS
@noggstaj3 ай бұрын
yes, putting your css directly in your html is the way to go!