Don't Use JS for That: Moving Features to CSS and HTML by Kilian Valkhof

  Рет қаралды 90,500

JSConf

JSConf

Күн бұрын

Пікірлер: 138
@zig5712
@zig5712 4 ай бұрын
This felt like a somewhat quick summary of the past 6 months of kevin powell YT, and i liked it !
@Ibrahim-ui1ns
@Ibrahim-ui1ns 4 ай бұрын
how ? could you explain more
@zig5712
@zig5712 4 ай бұрын
@@Ibrahim-ui1ns Kevin Powell is a famous CSS youtuber and most of the tips and tricks showcased in this talk have been already seen on his channel for the past 6months (up to probably a couple years ago to be honest). The biggest drawback of new CSS features usually being the browser support on one hand, learning a new way to do the same thing on the other hand. It's a brave fight, cuz yes it is a fight.
@thekwoka4707
@thekwoka4707 3 ай бұрын
Except actually good.
@yt_brij
@yt_brij 3 ай бұрын
True
@danielvega646
@danielvega646 3 ай бұрын
Okay, the scroll driven animation being just three lines of css insted of three boattled files is purely art.
@JohnSmith-op7ls
@JohnSmith-op7ls 3 ай бұрын
Uhh, can we stop with the scroll animations. Nobody but UI designers like them.
@Ryan-xq3kl
@Ryan-xq3kl 3 ай бұрын
@@JohnSmith-op7ls forreal, its a website not a powerpoint lol
@berthold64
@berthold64 3 ай бұрын
@@JohnSmith-op7ls i hate scroll smoothing
@rranon8489
@rranon8489 3 ай бұрын
And it's not yet a standard API.
@AlThePal78
@AlThePal78 3 ай бұрын
@@berthold64 I love it, makes it feel smooth to use lol no pun intended but I am tired only word I can think to use lol
@ggsheet
@ggsheet 3 ай бұрын
Wish the audience had gotten the hang of how cool and important this is in order to make pages more performant and save devs a lot of time writing code and debugging
@berthold64
@berthold64 3 ай бұрын
Underrated talk, less javascript is better
@SSTSparkz
@SSTSparkz 4 ай бұрын
I like how summary/details is still considered a new thing 10 years after it got released
@fernandolunadev
@fernandolunadev 4 ай бұрын
Also and Popover API. Those two are a brand new but all the browsers has implemented them since at least two or three years. My students spilt the jaw on the floor when they learn to build a native with two lines of HTML and just 3 or 4 lines of CSS. They came from YT tutorials with dozens of lines of HTML and another dozens of CSS. My mistake: Previously I mentioned as an HTML tag but the correct form to name it is Popover API: a couple of techniques applied by attributes in any HTML tag to launch a or another HTML tag as a popover tag or toast tag. Thanks to @Venyl for detecting and notifying me about my mistake. A mobile screen is not proper to write or respond this kind of messages.
@phat80
@phat80 3 ай бұрын
CSS appearance property is fully supported in Safari only since version 15.4 (2022). It really doesn’t matter when new features are added to the standards. More important is when it becomes fully supported by the majority of browsers.
@Venyl
@Venyl 3 ай бұрын
@@fernandolunadev there's no element I think, you meant the attribute?
@JohnSmith-op7ls
@JohnSmith-op7ls 3 ай бұрын
@@fernandolunadevTakes a good 3 years or so to hit that 90% adoption that most are waiting on. Bigger companies often want to see more like 98-99% for anything public facing. Blame the W3C for not standardizing most of this stuff two decades ago when MS was getting hate for daring to go off the horribly limited standards because they actually wanted to make things possible before the next ice age.
@fernandolunadev
@fernandolunadev 3 ай бұрын
@@Venyl Yes of course, You have right and thanks for detecting my mistake. ✅ I'll correct my previous post to clarify my bad.
@codecruz
@codecruz 3 ай бұрын
JS should always be the sprinkle on top for functionality you can't accomplish with HTML + CSS. That said, there was stuff in here that was new to me! Well done!
@majorhumbert676
@majorhumbert676 3 ай бұрын
How do you build a word processor, whiteboard app, drawing tool, or 3d app with "sprinkles" of JavaScript?
@explosionspin3422
@explosionspin3422 3 ай бұрын
99% of websites don't fall into these categories lol
@DJRYGAR1
@DJRYGAR1 3 ай бұрын
@@majorhumbert676 you don't. Get your C#/GO/C++ toolbox and make it as proper desktop app
@majorhumbert676
@majorhumbert676 2 ай бұрын
@@codecruz @codecruz used the word "always". Even if it is 99% (which I don't buy), it's not where 99% of the effort lies.
@fernandolunadev
@fernandolunadev 4 ай бұрын
AMAZING KEYNOTE! 👏👏👏 (standing ovation!) As a web development professor deeply involved and focused in JS, I started a couple of years ago to encourage students to research and track the evolution of CSS and HTML, so that they can take responsibility away from JS in certain design situations. I explain that this, in turn, helps to make JS cleaner and simpler to understand when other people should read your code, but also contributes to the rendering processing speed since all HTML and CSS handled from JS will always be slower. Congrats for the keynote!
@PedroS-nv1sl
@PedroS-nv1sl 3 ай бұрын
20 minutes of this video has just saved me about 2 hours of research and implementation 😅
@qodesmith520
@qodesmith520 4 ай бұрын
Absolutely amazing. I love JavaScript and it feels good to let html and css do more of the work.
@phat80
@phat80 3 ай бұрын
In fact C++ 😀
@rrd_webmania
@rrd_webmania 4 ай бұрын
I used half of these, the other half is new for me. I can't wait try them.
@therussianfederation9879
@therussianfederation9879 2 ай бұрын
field-sizing: content was the thing I really needed!
@tonymorin6308
@tonymorin6308 3 ай бұрын
Wow, that was good! Really interesting! CSS & HTML has evolved. Checkboxes (used to hate checkboxes!), the accordian, modal, in fact all of it. Fairly straightforward too in these simple demos. It's making me realise I need to get out of my old ways & do some research & updating to make life easier, faster & nicer too. Great job Killian! thanks 👍
@JohnSmith-op7ls
@JohnSmith-op7ls 3 ай бұрын
Only took 3 decades for the W3C to implement features people were clamoring for 3 decades ago, and desktop apps have had for 4 decades. Imagine how advanced this all would be if the W3C wasn’t so slow and incompetent
@idahosanosa
@idahosanosa 4 ай бұрын
My rule is to always keep it as simple as possible and this is just a great example of it
@codehan
@codehan 4 ай бұрын
The dialog got me.. Great stuff, thanks for that!
@blarvinius
@blarvinius 3 ай бұрын
I don't want this video to end... ❤
@antonzhylenko2132
@antonzhylenko2132 3 ай бұрын
Tough crowd, they are probably in awe bc this is incredible
@sivaganesh4489
@sivaganesh4489 4 ай бұрын
Video is gem
@codingwithem
@codingwithem 4 ай бұрын
That is very cool introduction about the modern of web. That all we need of the complex system. Keep everything original and simple. I think.
@JohnSmith-op7ls
@JohnSmith-op7ls 3 ай бұрын
It’s sad that 40 year old software UI functionality is considered modern in the browser
@codingwithem
@codingwithem 3 ай бұрын
@@JohnSmith-op7ls I believe there is a future for us. Keep everything simple until there is no more complex.
@oluwafemiolukoya9352
@oluwafemiolukoya9352 3 ай бұрын
i’ve always taken into consideration solutions that take care of weight lifting and improved performance. This is a very insightful keynote! 🔥🔥
@Tarabass
@Tarabass 4 ай бұрын
This is like telling my coworkers that you can submit and validate forms without libraries and style them using pseudo classes in css. They have no idea 😅
@TheNeonRaven
@TheNeonRaven 3 ай бұрын
The caveat with form validation, is you want your validation to be the same on client and server and it leaves room for bugs if you implement it two different ways.
@italktocomputers1901
@italktocomputers1901 3 ай бұрын
@@TheNeonRaven Ive ran into this a lot and notice it to be a pain point in other teams as a well. What are some common ways to fix this?
@TheNeonRaven
@TheNeonRaven 3 ай бұрын
@@italktocomputers1901 The easiest, is if you have a JS backend, you can use the same validation libraries on the front end as you do on the backend - there are some good lightweight libraries like valibot. If you're using something else for a backend, you can mostly re-use regexes wherever you can (though there can be some differences in implementations), or if you can find a library that generates the JS code as well as does the server validation. If you don't find anything that works well with your tech stack, you can certainly roll your own, and validate that both the server and client produce the same results through unit testing.
@Psycandy
@Psycandy 3 ай бұрын
more features less work! really interesting and nicely presented
@tonymorin6308
@tonymorin6308 3 ай бұрын
PS - I'm noticing more of these snappy short YT demos & I'm a big fan. Probably because back in the day I wasn't as able as I am at working out the detail, after only watching a short demo on a topic.
@DrMorganClydesdale
@DrMorganClydesdale 3 ай бұрын
Oh god my ears at the end lol, This was a really great one.
@Tubeytime
@Tubeytime 3 ай бұрын
The more you brute force something, the worse it performs. Pretty straightforward philosophy.
@cscnmhmt
@cscnmhmt 4 ай бұрын
I think the audience was heavily backend developers :/
@oserodal2702
@oserodal2702 Ай бұрын
It wasn't a JS conference, it was a NodeJS conference 😢
@nustaniel
@nustaniel 4 ай бұрын
position: sticky; top: 0; on that stuck-to-the-top header for 20:30 will typically do the trick fine and you don't need to figure out some arbitrary pixel value to set as a scroll margin.
@digitaldevigner4080
@digitaldevigner4080 4 ай бұрын
This is precisely why as a React Native developer I never really felt React for web was a good idea. We as a community try to force the creation of what is a really simple concept of HTML and CSS with an overly complex layer of JavaScript. I also love JS and sometimes React has a purpose but I wish we would all go back to more pure standards. Even on the server side I just don’t see Node ever taking off with 99% of users the way PHP did. Node is nice but the fact that free shared hosting is a lot more complex and expensive means it will likely never replace something like PHP. I’m now trying to put as little JS into websites as possible.
@TshepoMelesi-pe1wx
@TshepoMelesi-pe1wx 4 ай бұрын
Great stuff right here!!!
@NaserPapi-x7z
@NaserPapi-x7z 2 ай бұрын
I really enjoyed this video. Thanks a lot for sharing such amazing content!
@austin.valentine
@austin.valentine 3 ай бұрын
Clicked because I agreed with the premise in the title. Really would prefer to build web pages and use JavaScript to provide only extra non-UI functionality/processing.
@abdoseadaa
@abdoseadaa 3 ай бұрын
this is amazing 🎉🚀 goodbye me ears at the end though 💀💀
@MASTERISHABH
@MASTERISHABH 4 ай бұрын
I've used summary, details and data-collapse for Accordians and it's all fun and games until you've 20 images loading in network tab even when the accordion is collapsed. Not sure, why this happened for me even when image show was set to lazy load but had to go with a js option just to prevent this. Do let me if there's a way to fix this without js. Tech Stack: NextJs and Tailwind
@isaidstream4547
@isaidstream4547 3 ай бұрын
The, field-sizing: content, is amazing
@mhn23visual
@mhn23visual 3 ай бұрын
This was really cool!
@VerySadBatman
@VerySadBatman 4 ай бұрын
This was an amazing talk!
@benjamindrane2285
@benjamindrane2285 3 ай бұрын
No one in the audience got the joke he set up in the beginning where he said he loved HTML but the slide said JSX so he edited it on the fly. Very clearly setup to be a joke and no one laughed.... What a shame.
@genrescope
@genrescope 3 ай бұрын
Crowd was full of C devs😂
@ravirajchilka
@ravirajchilka 3 ай бұрын
No, they were cab drivers graduated from bootcamp
@Dom-zy1qy
@Dom-zy1qy 3 ай бұрын
Tbh if you didn't catch that it changed it would be easy to think he was talking about JSX when referring to html since they're basically the "same thing" (well not rly but you know what I mean)
@Cysecsg
@Cysecsg 2 ай бұрын
Nah, the rule of least power, as he said it. He even spent the first 3 minutes explaining it. I love how smart you think you are, compared to the room of devs. That confidence is remarkable.
@autocosm
@autocosm Ай бұрын
They also forgot to laugh when he said "I know all of you write semantic HTML"
@kaustavroy6542
@kaustavroy6542 3 ай бұрын
Loved the talk
@claasdev
@claasdev 4 ай бұрын
While dialogs are great, I think popover is even better :)
@patrickjreid
@patrickjreid 3 ай бұрын
Why the heck hasn't switch been added to html!?! This should be old, not a fancy single browser feature. I don't get it! This is the lowest of low hanging fruits.
@SuviTuuliAllan
@SuviTuuliAllan 3 ай бұрын
Does it add any semantics? Isn't it presentational? Presentational stuff doesn't belong in HTML. That stuff belongs in CSS.
@majorhumbert676
@majorhumbert676 2 ай бұрын
@@patrickjreid HTML is just a markup language for writing articles. What's next, switch statements in markdown?
@lptimey
@lptimey Ай бұрын
@@majorhumbert676switch as in on/off slider seen in 5:38. not switch case.
@KaustabRoy-w6v
@KaustabRoy-w6v 3 ай бұрын
loved the tips , great vid
@kilianlindberg
@kilianlindberg 3 ай бұрын
1:39 could this also mean we may get back into Table-HTML Layouts, yay 🎉 I remember the good old days of layout with tables.. still works perfectly in backward compatibility; the reason to why not use it (?) Google SEO(?) ..
@binamralamsal
@binamralamsal 3 ай бұрын
The reason not to use it is because we have better solutions now with flexbox, grids, etc.
@Daijyobanai
@Daijyobanai 3 ай бұрын
Accessibility is one reason, a table is only a semantic element if it holds tabular data, if holds the entire page it makes no sense semantically. Then you have to scale the table and all it's columns, rows, and cells to device screen sizes.
@ivan.jeremic
@ivan.jeremic 4 ай бұрын
technically correct would be "don't use the DOM API for that" because the DOM library is not part of the JavaScript language.
@ffffoundit3198
@ffffoundit3198 4 ай бұрын
DOM API is not part of the javascript spec but its very much javascript, when i do HTMLElement.prototype am writing javascript.
@ivan.jeremic
@ivan.jeremic 4 ай бұрын
@@ffffoundit3198 yes but you would be surprised how many people don't know this.
@akash-kumar737
@akash-kumar737 3 ай бұрын
Legends say they are still clapping 👏
@danielvega646
@danielvega646 3 ай бұрын
Brilliant!
@marcol.9125
@marcol.9125 3 ай бұрын
Awesome tips 👌🏼
@johndoe4016qweasd
@johndoe4016qweasd 3 ай бұрын
cool stuff! thank you!
@AlThePal78
@AlThePal78 3 ай бұрын
marker is a game changer but do i want my stuff to jump up maybe that was just a demo this is great information I don't use most of this stuff but now I see I can and I can probably use marker open with some transitions :)
@stingray2107
@stingray2107 Ай бұрын
Great talk, loved your jokes
@johnmcgg
@johnmcgg 4 ай бұрын
great talk!
@mattwood8659
@mattwood8659 2 ай бұрын
I was excited for the data list example but the downside is you can't style it via css
@eustiantsev
@eustiantsev 4 ай бұрын
nice talk, potato salad in styles 🤠
@ib_concept
@ib_concept 3 ай бұрын
some unlearning relearning is vital!
@Emerson-tv5yo
@Emerson-tv5yo 4 ай бұрын
Would also recommend using a component library when possible (Angular Material is amazing), gives you a great springboard that can be tweaked to fit your desired needs and style. No need to reinvent the wheel.
@DEBO5
@DEBO5 3 ай бұрын
Yea but then everything looks so angular materialy
@Emerson-tv5yo
@Emerson-tv5yo 3 ай бұрын
@@DEBO5 You can tweak pretty much every style of Material with CSS (I use tailwind and it plays nicely with Material) if you want to make it look unique
@claasdev
@claasdev 4 ай бұрын
While dialog is great, I think popover is even better :)
@13137713
@13137713 3 ай бұрын
thank you for this!
@gavriel_adi
@gavriel_adi 3 ай бұрын
The smart man at night shows how to make an opening animation for a dialog, but this is while there is no option to make a closing animation, which means it is not possible to do it without JS. hook
@pipilipilav98
@pipilipilav98 3 ай бұрын
Can I use more htmx because of this ?
@andreilucasgoncalves1416
@andreilucasgoncalves1416 2 ай бұрын
Yes, and with MPA View transition you can even use less HTMX, but it does not solve the problem of losing state of scroll and inputs
@Wolfci
@Wolfci 4 ай бұрын
Would be awesome to do the :had with WebKit scroll bar to adjust width without JS
@AlThePal78
@AlThePal78 3 ай бұрын
I get error with this because it says that $$ not define then when I take them out it says it is not a function is there something more I need to know?
@andreilucasgoncalves1416
@andreilucasgoncalves1416 2 ай бұрын
The $$ represents something like jquery, the vanilla correct way of doing this is "document.querySelector('dialog').showModal()"
@user-tn4pr4gu3t
@user-tn4pr4gu3t 3 ай бұрын
Best take away is with CSS/HTML first dev, copy and paste work wonder
@hedgehogform
@hedgehogform 3 ай бұрын
That cover flow demo is really laggy on my device
@boomknuffelaar
@boomknuffelaar 3 ай бұрын
Well, I'll just keep using frameworks and hope that they use the most recent supported mechanism when it doesn't need a polyfill. 🧠
@knmn8562
@knmn8562 2 ай бұрын
what is that modern day lorem ipsum
@kelvincoder6350
@kelvincoder6350 3 ай бұрын
I hate media queries, I wish to learn more about css clamp.
@Daijyobanai
@Daijyobanai 3 ай бұрын
media queries can be a PITA to debug. I agree. And the more programmatic code there is in CSS the harder a site is to maintain (especially when you aren't the original author).
4 ай бұрын
Will it work on IE6?
@codeinspector
@codeinspector 4 ай бұрын
nice!
@mtfreytag
@mtfreytag 3 ай бұрын
Too bad safari even Technology Preview still has the pseudo selectors behind flags
@jjcbvg
@jjcbvg 4 ай бұрын
full stack and manage code base for financial reporting app…being only dev that knows what’s going on…I can’t help but ask if you think it’s okay to move some of this behavior to css and remove from js. I could see it being a maintainability nightmare when everyone expects this behavior to be in the JS code
@clickadelic7681
@clickadelic7681 4 ай бұрын
I'd been in such a place, worthless enterprise trying to convince non-coders to invest time in shifting codebase - forget it. "It's works, duh, why should we do that?"..
@openm1ndead
@openm1ndead 4 ай бұрын
You've got to be kitten me!
@bechirzouaoui5821
@bechirzouaoui5821 3 ай бұрын
I use tauri
@vince14genius
@vince14genius 4 ай бұрын
Didn't watch the video but here are some counterpoints to general "use CSS over JS" arguments: - compatibility is a non-issue: you should be using either progressive enhancement or graceful degradation anyways, and for the fancy stuff supporting older browsers is easier to do in JS/DOM than CSS - performance varies on a case by case basis, it's not as simple as "CSS is faster than JS" - development time: some features are just way easier to implement in JS than trying to do tricks and hacks in CSS
@13137713
@13137713 3 ай бұрын
man : ) watch the video, seriously.
@andyl9920
@andyl9920 10 күн бұрын
Teach us pure css for responsive webpages. No media queries and no frameworks
@Daijyobanai
@Daijyobanai 3 ай бұрын
React devs making button components for every new site/page they work on, completely confused by this talk.
@codewithtae6637
@codewithtae6637 4 ай бұрын
It's a security risk if a web page picks a color but its 'standard' if a browser has access to my system...😅
@pokefreak2112
@pokefreak2112 4 ай бұрын
you trust the browser to provide you with a safe environment, that's the whole point. same reason someone might work in a VM, you're trusting the VM author to provide you with a sandbox that the programs running inside it can't eacape
4 ай бұрын
You didn't understand this (security risk), so change your smile emoji to something sad.
@guillaumebrunerie
@guillaumebrunerie 4 ай бұрын
Actually, there is an EyeDropper API to do exactly that, and also the built-in color picker is very bad (for instance you can't copy the hex code of a color in Chrome, and it looks widely different depending on the browser).
@chibonchibon3967
@chibonchibon3967 3 ай бұрын
Just use firefox and noscript to feel the web without js, disclaimer... Its broken for 98% of websites😂
@RaWMajkeL
@RaWMajkeL Ай бұрын
nihil novi
@PeterStJ
@PeterStJ 4 ай бұрын
Uhm... the focus/focus-visible does not work... at all, in any up to date browser, even in Chrome (on MacOS latest). It's weird giving examples that do not work. Basically last given value is used for both kbd AND mice (i.e. if I put color on focus-visible and It is defined after styles for focus - focus-visible wins over focus, if I put focus last - it wins, they overwrite each other, also color transparent just makes Firefox and Safari use the OS colors, it uses transparent on Chrome only and it applies it both for kbd and mice sooo... yeah, it does not work as suggested).
@lnplum
@lnplum 4 ай бұрын
I'm not sure what you're doing but I'm on the latest stable Edge on Windows (i.e. Chrome by any other name) and putting :focus-visible first and then :focus afterwards and having them affect the same property (e.g. background-color) works exactly as expected for me, i.e. for mouse the :focus wins, for keyboard :focus-visible wins.
@TheNeonRaven
@TheNeonRaven 3 ай бұрын
It doesn’t work on text fields, because by their very nature, you need a keyboard to type into a text field. It works everywhere else and has for years now.
@fikrirahmatnurhidayat4988
@fikrirahmatnurhidayat4988 Ай бұрын
I build browser using Electron, not mentioning Chromium is wild.
@arytiwa4351
@arytiwa4351 3 ай бұрын
why no one laughed at this 1:17 :-'|
@8infinito8
@8infinito8 4 ай бұрын
I always think that if something is well done in HTML + CSS, is not worth to do it in JS.
@paulhetherington3854
@paulhetherington3854 3 ай бұрын
VALKHOF -- Netherlands , Duch! VAL -- verified identity - but not here, in America! 1. He be -- very dumb! K= many pitfals - identity key! HOF= Someone helped, with that, policeman -- in that fight! You caused - many problemz - then -- by "Personal venue!"
@xade8381
@xade8381 2 ай бұрын
logic in css is the thing I hate, everything else was dope
@jp263
@jp263 3 ай бұрын
Better yet, don't use JS
Web Performance: The African Case by Mohamed Ayoub Alouane
30:30
How to Get a Developer Job - Even in This Economy [Full Course]
3:59:46
freeCodeCamp.org
Рет қаралды 3,2 МЛН
When u fight over the armrest
00:41
Adam W
Рет қаралды 32 МЛН
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 74 МЛН
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 4,3 МЛН
What's Coming Next to JavaScript? by Nicolò Ribaudo
31:58
CSS Popover + Anchor Positioning is Magical
20:44
Kevin Powell
Рет қаралды 34 М.
Start over-engineering your CSS | Kevin Powell | CSS Day 2024
50:28
Web Conferences Amsterdam
Рет қаралды 20 М.
23 CSS features you should know (and be using) by now
31:31
Kevin Powell
Рет қаралды 80 М.
Please stop using px for font-size.
15:18
Coder Coder
Рет қаралды 241 М.