(评论)
(comments)
原始链接: https://news.ycombinator.com/item?id=38497445
作者建议 Web 开发人员可以仅使用 CSS 和 HTML 创建有效的设计和用户体验,而无需 JavaScipt 或框架,正如他们的个人网站所证明的那样。 他们认为,优先使用功能较弱的工具并坚持使用 HTML 和 CSS 等声明性语言而不是 JavaScript 等命令式语言,可以为开发人员和用户体验带来好处,同时还倡导适当的可访问性和维护标准。 此外,作者还强调了忠于自己的专业判断并抵制上级任意选择工具的重要性。 然而,Web 应用程序必然依赖于 JavaScript 并且无法正常运行的概念,以及它将导致更慢且效率更低的体验的建议,与本文中提出的某些观点相矛盾。 尽管如此,这种观点提供了简化网页设计流程的机会,同时为创建者和消费者节省资源、降低成本并提高整体效率。 关于网络优化策略,作者建议考虑普通的 JavaScript 选项,并忽略那些选择在浏览器中排除 JavaScript 的少数群体,因为它们对更广泛的受众影响很小。 此外,作者指出,与传统方法相比,利用 JavaScript 可能会带来更快的性能,并强调了直接通过 JavaScript 实现图像处理而不是诉诸服务器端渲染的潜在好处。 最终,根据个人情况选择一组首选工具对于以最佳效率提供有效设计至关重要,无论是采用 CSS 和 HTML 还是合并 JavaScript 来实现更全面、动态的内容管理。
`appearance` has a lot of caveats on MDN about testing it thoroughly if you're going to use it—even `appearance: none`. This may matter less if you only have to support new browsers, but keep in mind that old versions of Safari stay in circulation longer than you might think.
`datalist` does nothing on Firefox Android. It just shows to me as an input box with no functionality at all (not even the suggestions over the keyboard that others report in Chrome Android).
The color picker is neat, but extremely nonstandard, which is a dealbreaker for most businesses not just because the designers will complain but because customer support will find it harder to help people. Chromium provides the functionality to pick on a page and pick literally any color, but Firefox Android only gives me the rainbow, a gray, and black and white.
The article itself acknowledges the inconsistencies with `details` and `dialog`.
I hope we eventually get to a place where browsers that don't support these features (and support them consistently with each other) are no longer used, but in the meantime these elements will only find their way into my side projects, where I have full control of which browsers I support.
reply