前端自检清单
目录
如何使用?
前端自检表 中的所有项对于大多数项目都是必需的,但是有些元素可以省略或不是必需的(例如,对于管理web应用程序,你可能并不需要RSS订阅)。我们使用三个级别来灵活区分:
有些资源拥有相对的符号,可帮助你了解清单中可能找到的内容或类型:
📖: 文档或文章
🛠: 在线工具或测试工具
📹: 媒体或视频内容
你可以通过阅读 README_APP 文件 为 前端自检表应用 做出一些贡献,README文件里详细的阐述了关于此项目的所有事情。
Head
注意: 你可以找到一份可能在HTML document的
<head>
里包含了所有东西的列表。
Meta tag
接下来的两个meta标记(Charset and Viewport) 需要首先出现在head里。
browserconfig.xml
文件所需的最低xml
标记如下:
📖 [Browser configuration schema reference](https://msdn.microsoft.com/en-us/library/dn320426(v=vs.85).aspx)
HTML tags
📖 [About conditional comments (Internet Explorer) - MSDN - Microsoft](https://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx)
🛠 Critical by Addy Osmani on GitHub automates this.
Social meta
可视化并自动生成带有元标记的social 元标记。
Facebook OG 和 Twitter Cards 是的,对于任何网站,强烈推荐。如果你的目标用户是某个特定的用户,并且想要确保显示效果,可以考虑其他社交(social )媒体标签。
注意: 使用
og:image:width
和og:image:height
将为爬虫指定图像的尺寸,这样爬虫就可以立即呈现图像,而不必异步下载和处理图像。
🛠 Test your page with the Facebook OG testing
🛠 Test your page with the Twitter card validator
HTML
最佳实践
HTML testing
🛠 webhint
Webfonts
注意: 使用WebFonts可能导致非样式文本的闪烁/不可见文本的闪烁-考虑使用回退字体和/或使用WebFont加载器来控制行为。
CSS
注意: 看看大多数前端开发人员所遵循的CSS指南和Sass指南。如果你对CSS属性有疑问,可以访问CSS Reference。为了保持一致性,还有一个简短的代码指南。
📖 Reboot
Performance
🛠 PurgeCSS
CSS testing
Images
注意: 要全面了解图片优化,请查看Addy Osmani的免费电子书Essential Image Optimization。
Best practices
🛠 Imagemin
🛠 使用ImageOptim to optimise your images for free.
🛠 Use Kraken.io awesome alternative for both png and jpg optimization. Up to 1mb per files on free plan.
🛠 TinyPNG losslessly optimise png, apng (animated png) and jpg images. Free and paid version available.
🛠 ZorroSVG jpg-like compression for transparent images using svg masking.
🛠 SVGO a Nodejs-based tool for optimizing SVG vector graphics files.
🛠 SVGOMG a web-based GUI version of SVGO for optimising your svgs online.
JavaScript
最佳实践
JavaScript testing
Security
最佳实践
📖 [Cross-Site Request Forgery (CSRF) Prevention Cheat Sheet - OWASP](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet)
📖 [XSS (Cross Site Scripting) Prevention Cheat Sheet - OWASP](https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet)
Performance
最佳实践
📖 Cookies
Preparing upcoming requests
Performance testing
Accessibility
注意: 你可以观看注意事项视频列表A11ycasts with Rob Dodson 📹
最佳实践
Headings
Semantics
Form
Accessibility testing
SEO
🛠 Test your robots.txt with Google Robots Testing Tool
📖 JSON-LD
🛠 Test your page with the Structured Data Testing Tool
🛠 Complete list of vocabularies that can be used as structured data. Schema.org Full Hierarchy
原文:选自github
Last updated