Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JSDC

 JSDC

Talk @ JSDC 2014
12.10.2014

Mu-An Chiou

October 12, 2014
Tweet

More Decks by Mu-An Chiou

Other Decks in Programming

Transcript

  1. These classes are no where to be found: ! .avatar-upload-label

    .billing-extra-yolo .login-form-fixed Stale selectors and partials
  2. These selectors are too damn complicated: ! #adv_code_search .enterprise .site-search

    .search-page-label: body.page-profile .profilecols .tabnav .pagehead-actions li.t .discussion-hidden .timeline-comment-content .timeline-commen .prose-diff > .markdown-body li .wraps-task-list-item-checkbo Deep selectors
  3. Stylesheets should not contain js- prefixed classes: ! .js-avatar-uploader .js-prorated-for-days

    .js-branch-name-suggestion Special prefixed classes git grep -n '[#.]js-' -- app/assets/stylesheets
  4. The ALT attribute if(!img.hasAttribute('alt')) { console.warn(“Missing alt attribute on", img)

    } if(!img.hasAttribute('alt')) { console.warn(“Missing alt attribute on", img) }
  5. Accessible text – aria-label text = node.innerText text += node.getAttribute(‘alt')

    text += node.getAttribute(‘aria-label') ! if(text.length == 0) { console.warn("Missing accessible text", this) }