4 ms·
>CSS today is so good that I now design websites in CSS There are so many things missing that people are forced to use Javascript and a div-mess to implement w
by simion314 7y ago
>CSS today is so good that I now design websites in CSS
There are so many things missing that people are forced to use Javascript and a div-mess to implement widgets. Ex elements like dropdowns, numeric input, the small scrollbar that appears for elements, I am wondering if browser makes are just ignoring css and focusing on JS.(I admit flexbox and grid layout is cool)
- tyingq 7y agoAgreed. There remains many moments where I'm questioning why I have to use JavaScript. A css concept exists to accomplish what I'm doing, but it's incomplete. It is also often blind to stuff where css could be useful like basic-auth.
- thdrdt 7y agoThe moment people start building their own numeric input they create all kinds of problems on different devices. I think people should just accept the browser default. And dropdowns can easily be created CSS only. To me the use of JS to get the design right always smells like bad practice.
- simion314 7y agoI know, it is not the developers at fault , we the devs pushed against this, we tried to get the native input to look as much as possible as the design but it was not accepted, we had no choice but to use JS and get teh pixel perfect design.
- jonpurdy 7y agoI’ve been in Product Management positions and always advocate for native controls over custom. Too many times I’ve seen custom stuff take way longer to build and make work responsively. Native might not be pixel-perfect to a design but that’s okay; design is how it works, not how it looks.
- matheusmoreira 7y ago> we had no choice but to use JS and get teh pixel perfect design There was another choice: sacrifice the pixel perfect design and accept the native inputs.
- simion314 7y agoBy "we" I mean the developers, we can explain the upsides and downsides of the solutions but we don't decide the look and feel.
- saadalem 7y agoYou can make smooth scrolling, dropdown etc.. With just CSS
- simion314 7y agoWhat I mean for dropdowns is to get css properties to style the "select" element and not have to use div inside divs. For scrollbars I do not remember now the issue we had to use JS, I think on some browser you could not get the exact colors/look the designers wanted. Edit: as an example in other GUI frameworks you are also limited but you can extend the widget with a custom render function and you can paint the widget as you want, you get the look you want but you keep the native widget behavior like the correct events and keyboard handling where with the nested DIVs you get most of the time missing or broken functionality, even Google could not properly implement the Search and dropdown in YouTube, it gets stuck open sometimes and you have to reload the page.
- zzo38computer 7y agoWhat is needed is better way for the user (rather than the document author) to customize it. For example, I may want to disable smooth scrolling, or make other adjustments.
- vbezhenar 7y agoWhy do you want to style dropdowns or scrollbars? Using those "designer" dropdowns is a pain on mobile, while simple dropdowns just use native controls and work flawlessly. Same about scrollbars, I hate websites that interfere with my scrolling.
- simion314 7y agoIs not me, the designers want it, we need to ask them why? But in my case it was a complex application that is not intended to be used from a phone.
- acdha 7y ago> Is not me, the designers want it, we need to ask them why? Yes: JS widgets have a usability impact and especially accessibility, which is a legal requirement in much of the world. Some libraries have good accessibility stories but given that this is an ongoing cost which will need to be supported it’s always important to link it to an actual requirement (e.g. searchable drop downs) to justify the expense.
- zzo38computer 7y agoThere is ARIA, but ARIA isn't quite good enough. I also suggested a <widget> element, which allows you to define your own widgets and provide an implementation in HTML and JavaScript to be used if the browser cannot use it directly (if the widget is implemented directly (subject to user configuration), then the stuff inside the <widget> block is ignored or used in an implementation-defined way; if the widget is not implemented, then the <widget> is treated the same as a <span>, and any <script>, <noscript>, etc it contains is interpreted normally). (For selections from lists, there is already <input> anyways, and the browser can include whatever special features they want; they may be disabled in application mode if needed.)
- acdha 7y agoARIA is always improving but really the problem is that most developers either don’t use it or don’t test their usage. This is not a problem of needing new technology as much as companies skimping until they get sued.