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

The Future of CSS and HTML - 2019 Edition

Avatar for Justin Holt Justin Holt
September 20, 2019

The Future of CSS and HTML - 2019 Edition

Avatar for Justin Holt

Justin Holt

September 20, 2019
Tweet

More Decks by Justin Holt

Other Decks in Programming

Transcript

  1. Agenda Part 1: New and Upcoming CSS Features. Part 2:

    HTML5 APIs in Development Now. Wrap Up with FREE LINKS!!
  2. Media Query Ranges @media (width < 480px) {} @media (480px

    <= width < 768px) {} @media (width >= 768px) {} A syntax for defining media query ranges using ordinary comparison operators.
  3. New Psuedo-Selectors nav :any-link > span A pseudo-class for matching

    anchor elements independent of whether they have been visited. a:has(> img) {} A pseudo-class for matching ancestor and sibling elements.
  4. New Psuedo-Selectors p:matches(:first-child, .special) {} A pseudo-class for matching elements

    in a selector list. input:blank {} A psuedo-class for matching form elements when they are empty.
  5. Color Adjust Property The color-adjust property is a non-standard CSS

    extension that can be used to force printing of background colors and images. .background {background-color:#ccc;} .background.color-adjust {color-adjust: economy;} .background.color-adjust-exact {color-adjust: exact;}
  6. Focus Within A pseudo-class for matching elements that are either

    focused or that have focused descendants. :focus:not(:focus-visible) {outline: 0;}
  7. Image Set Function A function for specifying image sources based

    on the user’s resolution. p {background-image: image-set( "foo.png" 1x, "foo-2x.png" 2x, "foo-print.png" 600dpi);}
  8. Overscroll Behavior Properties for controlling when the scroll position of

    a scroll container reaches the edge of a scrollport. .messages { height: 220px; overflow: auto; overscroll-behavior-y: contain; } body { margin: 0; overscroll-behavior: none;}
  9. Accessible Media-Queries Media queries to detect and adjust styles based

    on user preferences. @media (prefers-color-scheme:dark) {} @media (prefers-reduced-motion) {}
  10. Background Sync API Microtask API Use to offload lower priority

    tasks, routines, and services to execute in background.
  11. Resize Observer API Visual Viewport API More efficient DOM polling

    for viewport and element Resize observers.