Front-End-Checklist(前端清单)

简介: The Front-End Checklist is an exhaustive list of all elements you need to have / to test before launching your site / page HTML to production.It is based on Front-End developers' years of experience, with the addition from some other open-source checklists.





The Front-End Checklist is an exhaustive list of all elements you need to have / to test before launching your site / page HTML to production.


It is based on Front-End developers' years of experience, with the addition from some other open-source checklists.


Table of Contents


  1. How to use
  2. Head
  3. HTML
  4. Webfonts
  5. CSS
  6. Images
  7. JavaScript
  8. Performance
  9. Accessibility
  10. SEO


How to use?


All items in the Front-End Checklist are required for the majority of the projects, but some elements can be omitted or not essential (in case of an administration web app, you may not need RSS feed for example). We choose to use 3 levels of flexibility:


  • means that the item is recommended but can be omitted in some


  • particular situations.


  • means that the item is highly recommended and can eventually be omitted in some really particular cases. Some elements, if omitted, can have bad repercussions in terms of performance or SEO.


  • means that the item can't be omitted by any reason. You may cause a dysfunction in your page or have accessibility or SEO issues. The testing priority needs to be on these elements first.


Some resources possess an emoticon to help you understand which type of content / help you may find on the checklist:


  • : documentation or article



  • : online tool / testing tool



  • : media or video content


Head


Notes: You can find a list of everything that could be found in the <head> of an HTML document.


Meta tag

  • Doctype: The Doctype is HTML5 and is in the top of all your HTML pages.
<!-- Doctype HTML5 -->
<!DOCTYPE html>


Determining the character encoding - HTML5 W3C


The next 3 meta tags (Charset, X-UA Compatible and Viewport) need to come first in the head.


  • Charset: The charset declared (UTF-8) is declared correctly.


<!-- Set character encoding for the document -->
<meta charset="utf-8">


  • X-UA-Compatible: The X-UA-Compatible meta tag is present.


<!-- Instruct Internet Explorer to use its latest rendering engine -->
<meta http-equiv="x-ua-compatible" content="ie=edge">


Specifying legacy document modes (Internet Explorer)


  • Viewport: The viewport is declared correctly


<!-- Viewport for responsive web design -->
<meta name="viewport" content="width=device-width, initial-scale=1">复制代码


  • Title: A title is used on all pages (SEO: No more than 65 characters, website title included)


<!-- Document Title -->
<title>Page Title less than 65 characters</title>


Title - HTML | MDN


  • Description: A meta description is provided, it is unique and doesn't possess more than 150 characters.


<!-- Meta Description -->
<meta name="description" content="Description of the page less than 150 characters">复制代码


  • Favicons: Each favicon has been created and displays correctly. If you have only a favicon.ico, put it at the root of your site. Normally you won't need to use any markup. However, it's still good practice to link to it using the example below. Today, PNG format is recommended over .ico format (dimensions: 32x32px)


<!-- Standard favicon -->
<link rel="icon" type="image/x-icon" href="https://example.com/favicon.ico" />
<!-- Recommended favicon format -->
<link rel="icon" type="image/png" href="https://example.com/favicon.png" />复制代码






  • Apple Touch Icon: Apple touch favicon apple-mobile-web-app-capable are present. (Create your Apple Icon file with at least 200x200px dimension to support all dimensions that you may need)


<!-- Apple Touch Icon -->
<link rel="apple-touch-icon" href="/custom-icon.png">



  • Canonical: Use rel="canonical" to avoid duplicate content.


<!-- Helps prevent duplicate content issues -->
<link rel="canonical" href="http://example.com/2017/09/a-new-article-to-red.html">复制代码


HTML tags


  • Language tag: The language tag of your website is specified and related to the language of the current page.


<html lang="en">


  • Direction tag: The direction of lecture is specified on the body tag (It can be used on another HTML tag).


<html dir="rtl">


dir - HTML | MDN


  • Alternate language: The language tag of your website is specified and related to the language of the current page.


<link rel="alternate" href="https://es.example.com/" hreflang="es">复制代码


  • Conditional comments: Conditional comments are present for IE if


  • needed.


About conditional comments (Internet Explorer) - MSDN - Microsoft


  • RSS feed: If your project is a blog or has articles, an RSS link was provided.


  • CSS Critical: The CSS critical (or "above the fold") collects all the CSS used to render the visible portion of the page. It is embedded before your principal CSS call and between <style></style> in a single line (minified).


Critical by Addy Osmany on Github


  • CSS order: All CSS files are loaded before any JavaScript files in the <head>. (Except the case, where sometimes JS files are loaded asynchronously on top of your page).


Social meta


Facebook OG and Twitter Cards are, for any website, highly recommended. The other social media tags can be considered if you target a particular presence on those and want to ensure the display.


  • Facebook Open Graph: All Facebook Open Graph (OG) are tested and no one is missing or with a false information. Images need to be at least 600 x 315 pixels, 1200 x 630 pixels recommended.


<meta property="og:type" content="website">
<meta property="og:url" content="https://example.com/page.html">
<meta property="og:title" content="Content Title">
<meta property="og:image" content="https://example.com/image.jpg">
<meta property="og:description" content="Description Here">
<meta property="og:site_name" content="Site Name">
<meta property="og:locale" content="en_US">




  • Twitter Card:


<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@site_account">
<meta name="twitter:creator" content="@individual_account">
<meta name="twitter:url" content="https://example.com/page.html">
<meta name="twitter:title" content="Content Title">
<meta name="twitter:description" content="Content description less than 200 characters">
<meta name="twitter:image" content="https://example.com/image.jpg">复制代码




⬆ back to top



HTML


Best practices


  • HTML5 Semantic Elements: HTML5 Semantic Elements are used appropriately (header, section, footer, main...)


HTML Reference


  • Error pages: Error 404 page and 5xx exist. Remember that the 5xx error page needs to have his CSS integrated (no external call on the current server).


  • Noopener: In case you are using target="_blank" on your links, rel="noreferrer noopener" is present on the <img>.


  • Clean up comments: Unnecessary code needs to be removed before sending the page to production.


HTML testing


  • W3C compliant:: All pages need to be tested with the W3C validator to identify possible issues in the HTML code.


W3C validator


  • HTML Lint: I use tools to help me analyze any issues I could have on my HTML code.


Dirty markup


  • Desktop Browsers: All pages were tested on all current desktop


  • browsers (Safari, Firefox, Chrome, Internet Explorer, EDGE...).


  • Mobile Browsers: All pages were tested on all current mobile browsers (Native browser, Chrome, Safari...).


  • Link checker: There are no broken links in my page, verify that you don't have any 404 error.



  • Adblockers test: Your website shows your content correctly with adblockers enabled (You can provide a message encouraging people to disable their adblocker)


  • Pixel perfect: Pages are close to pixel perfect. Depending on the quality of the creatives, you may not be 100% accurate, but your page needs to be close to your template.


Pixel Perfect - Chrome Extension


⬆ back to top


Webfonts


  • Webfont format: WOFF, WOFF2 and TTF are supported by all modern

  • browsers.






  • Webfont size: Webfont sizes don't exceed 2 MB (all variants included)

⬆ back to top



CSS


Notes: Take a look on CSS guidelines and Sass Guidelines followed by most Front-End developers. If you have a doubt on CSS properties, you can visit CSS Reference.


  • Responsive Web Design: The website is using responsive web design.


  • CSS Print: A print stylesheet is provided and is correct on each page.


  • Preprocessors: Your page is using a CSS preprocessor (Sass is


  • preferred).


  • Unique ID: If IDs are used, they are unique to a page


  • Reset CSS: A CSS reset (reset, normalize or reboot) is used and up to date. (If you are using a CSS Framework like Bootstrap or Foundation, a



  • Normalize is already included into it.)





  • JS prefix: All classes (or id- used in JavaScript files) begin with js- and are not styled into the CSS files.


<div id="js-slider" class="my-slider">
<!-- Or -->
<div id="id-used-by-cms" class="js-slider my-slider">


  • CSS embed or line: Avoid at all cost the use of CSS embed or inline: only used for valid reasons (ex: background-image for slider, CSS critical).


  • Vendor prefixes: CSS vendor prefixes are used and are generated accordingly with your browser support compatibility.


Autoprefixer CSS online


Performance


  • Concatenation: CSS files are concatenated in a single file (Not for HTTP/2)


  • Minification: All CSS files are minified.


  • Non-blocking: CSS files need to be non-blocking to prevent the DOM from taking time to load.



  • Unused CSS: Remove unused CSS




CSS testing


  • Stylelint: All CSS or SCSS files are without any errors.




  • Responsive web design: All pages were tested at the following


  • breakpoints: 320px, 768px, 1024px (can be more / different according to your analytics).


  • CSS Validator: The CSS was tested and pertinent errors were corrected.


CSS Validator


  • Reading direction: All pages need to be tested for LTR and RTL languages if they need to be supported.


⬆ back to top


Images


Notes: For a complete understanding of image optimization, check the free ebook Essential Image Optimization from Addy Osmani.


Best practices


  • Optimization: All images are optimized to be rendered in the browser. WebP format could be used for critical pages (like Homepage).



  • Use ImageOptim to optimise your images for free.


  • Retina: You provide layout images x2 or 3x, support retina display.


  • Sprite: Small images are in a sprite file (in case of icons, they can be in an SVG sprite image).


  • Width and Height: All <img> have height and width set (Don't specify px or %).


Note: Lots of developers assume that width and height are not compatible with responsive web design. It's absolutely not the case.


  • Alternative text: All <img> have an alternative text which describe the image visually.


  • Lazy loading: Images are lazyloaded (A noscript fallback is always provided).


⬆ back to top


JavaScript


Best practices


  • JavaScript Inline: You don't have any JavaScript code inline (mixed with your HTML code).


  • Concatenation: JavaScript files are concatenated.


  • Minification: JavaScript files are minified (you can add the .min suffix).


Minify Resources (HTML, CSS, and JavaScript)


  • Non-blocking: JavaScript files are loaded asynchronously using async or deferred using defer attribute.


Remove Render-Blocking JavaScript


  • Modernizr: If you need to target some specific features you can use a custom Modernizr to add classes in your <html> tag.


Customize your Modernizr


JavaScript testing


  • ESLint: No errors are flagged by ESLint (based on your configuration or standards rules)


⬆ back to top


Performance


Best practices

  • Weight page: The weight of each page is between 0kb and 500kb




  • Minified: Your HTML is minified


W3C Validator


  • Lazy loading: Images, scripts and CSS need to be lazy loaded to improve the response time of the current page (See details in their respective sections).


Performance testing


  • Google PageSpeed: All your pages were tested (not only the homepage) and have min 90/100.





⬆ back to top


Accessibility


Notes: You can watch the playlist A11ycasts with Rob Dodson


Best practices


  • Progressive enhancement: Major functionality like main navigation and search should work without JavaScript enabled.


Enable / Disable JavaScript in Chrome Developer Tools


  • Color contrast: Color contrast should at least pass WCAG AA (AAA for mobile)


Contrast ratio


Headings


  • H1: All pages have an H1 which is not the title of the website.


  • Headings: Headings should be used properly in the right order (H1 to H6)


Why headings and landmarks are so important -- A11ycasts #18


Landmarks


  • Role banner:<header> has role="banner"


  • Role navigation:<nav> has role="navigation"


  • Role main:<main> has role="main"


Using ARIA landmarks to identify regions of a page


Semantics


  • Specific HTML5 input types are used: This is especially important for mobile devices that show customized keypads and widgets for different types.


Mobile Input Types


Form


  • Label: A label is associated with each input form element. In case, a label can't be display, use aria-label instead.


Using the aria-label attribute - MDN


Accessibility testing


  • Accessibility standards testing: Use the WAVE tool to test if your page respects the accessibility standards.


Wave testing


  • Keyboard navigation: Test your website using only your keyboard in a previsible order. All interactive elements are reachable and usable.


  • Screen-reader: All pages were tested in a screen-reader (VoiceOver, ChromeVox, NVDA or Lynx).


  • Focus style: If the focus is disabled, it is replaced by visible state in CSS.

Managing Focus - A11ycasts #22


⬆ back to top


SEO


  • Google Analytics: Google Analytics is installed and correctly configured.


  • Headings logic: Heading text helps to understand the content in the current page.


  • sitemap.xml: A sitemap.xml exists and was submit in Google Search Console (ex: Google Webmaster Tools)


  • robots.txt: The robots.txt is not blocking webpages


  • Structured Data: Pages using structured data are tested and are without errors. Structured data helps crawlers understand the content in the current page.


Introduction to Structured Data | Search | Google Developers Test your page with the Structured Data Testing Tool


  • Sitemap HTML: An HTML sitemap is provided and is accessible via a link in the footer of your website.


⬆ back to top


Contributing


Open an issue or a pull request to suggest changes or additions.

Guide


The Front-End Checklist repository consists of two branches:

1. master


This branch consists of the README.md file that is automatically reflected on the Front-End Checklist website.


2. develop


This branch will be used to make some significant changes to the structure, content if needed. It is preferable to use the master branch to fix small errors or add a new item.


Contributors


Check out all the super awesome contributors.


Authors


David Dias, Geoffrey Signorato, Sandeep Ramgolam and Cédric Poilly.

目录
相关文章
|
6月前
|
JavaScript 前端开发 算法
Node.js 艺术:用代码打印出绚丽多彩的控制台柱状图
Node.js 艺术:用代码打印出绚丽多彩的控制台柱状图
89 0
|
6月前
|
存储 JavaScript
node.js之简单留言板步骤以及涉及知识点
node.js之简单留言板步骤以及涉及知识点
|
JavaScript IDE 开发工具
vs code + ts + volar == webstorm More actions + 部分重构?白嫖党的胜利?
打算用 ts + vue 写一个新项目,突然发现 vs code 竟然还有 Quick Fix... 这个功能,这个功能需要搭配 volar,因为用 vetur 的时候我没看到有出现,在配合 ts 适用是能让人有种使用 IDEA 的错觉,就是 More actions...,你甚至可以将热键改成 alt + enter(回车),那就和 IDEA 一模一样了(当然比不上 IDEA 那么多解决方法和提示)
hook+ts业务开发思路5-完成列表页面的编写
hook+ts业务开发思路5-完成列表页面的编写
58 0
hook+ts业务开发思路5-完成列表页面的编写
hook+ts业务开发思路2-完成input组件的编写
hook+ts业务开发思路2-完成input组件的编写
88 0
hook+ts业务开发思路2-完成input组件的编写
hook+ts业务开发思路3-创建数据-完成数据待办项
hook+ts业务开发思路3-创建数据-完成数据待办项
50 0
hook+ts业务开发思路3-创建数据-完成数据待办项
|
前端开发
前端工作小结5-代码中漫花谷出现很多NBSP
前端工作小结5-代码中漫花谷出现很多NBSP
73 0
前端工作小结5-代码中漫花谷出现很多NBSP
SAP QM 创建ROS维护检验工序,系统报错:Work center NMDC_QA plant NMDC does not exist for task list type S
SAP QM 创建ROS维护检验工序,系统报错:Work center NMDC_QA plant NMDC does not exist for task list type S
SAP QM 创建ROS维护检验工序,系统报错:Work center NMDC_QA plant NMDC does not exist for task list type S
|
缓存 JavaScript 前端开发
尝试:Script Lab,开发模式之知识储备//SL02
尝试:Script Lab,开发模式之知识储备//SL02
169 0
尝试:Script Lab,开发模式之知识储备//SL02
|
Go 移动开发
页面返回/取消到上个页面back(-1)和go(-1)的区别
H5页面做多了,自然就会做到页面上的返回功能,返回功能大致有两种:history.back(-1)和history.go(-1),今天我们来说说两种方法的区别。
869 0