SlideShare una empresa de Scribd logo
1 de 100
Descargar para leer sin conexión
Designing for
Inclusion with
Media Queries
Boston CSS August 16, 2017
?
Level setting
What is the web?
HTML JS
CSS
HTML JS
CSS
HTML
describes meaning
JavaScript
adds behavior
CSS
creates priority
What is compliance?
Responsive Design is adapting
design to an unknown browser.
You don’t make an assumption
about where it will be accessed.
Inclusive Design is adapting
design to an unknown user.
You don’t make an assumption
about who will use it.
What is a browser?
How does CSS fit in?
Media Queries describe
meaning in context
The basics
The absence of
support for media
queries is in fact the
first media query.
—Bryan Rieger
Disabilities
Cognitive
Physical
When any device’s viewport
reaches a minimum width of
30 ems, do the following:
@media (min-width: 30em) { … }
Media Rule keyword
Media Feature Selectors and
declarations
Why ems?
When a device with a
screen’s viewport reaches a
minimum width of 30 ems,
do the following:
@media
screen
and (min-width: 30em) { … }
Media Type
Media Rule keyword
Media Feature Selectors and
declarations
all
aural
braille
embossed
handheld
print
projection
screen
speech
tty
tv
All media type devices
Speech and sound synthesizers
Braille tactile feedback devices
Paged braille printers
Small or handheld devices
Printers
Projected presentations
Computer screens
Speech synthesizers
Teletypes and terminals
Television-type devices
all
aural
braille
embossed
handheld
print
projection
screen
speech
tty
tv
All media type devices
Speech and sound synthesizers
Braille tactile feedback devices
Paged braille printers
Small or handheld devices
Printers
Projected presentations
Computer screens
Speech synthesizers
Teletypes and terminals
Television-type devices
all
aural
braille
embossed
handheld
print
projection
screen
speech
tty
tv
All media type devices
Speech and sound synthesizers
Braille tactile feedback devices
Paged braille printers
Small or handheld devices
Printers
Projected presentations
Computer screens
Speech synthesizers
Teletypes and terminals
Television-type devices
all
aural
braille
embossed
handheld
print
projection
screen
speech
tty
tv
All media type devices
Speech and sound synthesizers
Braille tactile feedback devices
Paged braille printers
Small or handheld devices
Printers
Projected presentations
Computer screens
Speech synthesizers
Teletypes and terminals
Television-type devices
all
aural
braille
embossed
handheld
print
projection
screen
speech
tty
tv
All media type devices
Speech and sound synthesizers
Braille tactile feedback devices
Paged braille printers
Small or handheld devices
Printers
Projected presentations
Computer screens
Speech synthesizers
Teletypes and terminals
Television-type devices
all
aural
braille
embossed
handheld
print
projection
screen
speech
tty
tv
All media type devices
Speech and sound synthesizers
Braille tactile feedback devices
Paged braille printers
Small or handheld devices
Printers
Projected presentations
Computer screens
Speech synthesizers
Teletypes and terminals
Television-type devices
width and
height
height
width
aspect-ratio
color
color-index
grid
monochrome
orientation
resolution
scan
Height of the target media
Width of the target media
Ratio between the viewport’s height and width
The presence of color
Number of entries in the color look-up table
The device is a grid device (TTY terminal, etc.)
Uses shades of a single color
Landscape or portrait
Display density (DPI, DPCM, etc.)
Type of scanning process (ex: progressive)
device-aspect-ratio
device-height
device-width
Deprecated
Logic
@media (min-width: 30em) { … }
if
@media
screen
and (min-height: 20em)
and (min-width: 30em) { … }
and
@media
(max-width: 10em),
(min-width: 20em) { … }
or
@media
not monochrome
and (max-width: 10em) { … }
not
.theme-background {
background: linear-gradient(to bottom, #FF9900 0%, #FFFFFF 100%);
}
@media (grid) {
.theme-background {
img {
display: none;
}
}
}
@media
print,
monochrome {
.theme-background {
background: transparent;
}
}
Using them
Don’t go overboard
Treat layout as an
enhancement
Let content
determine
breakpoints
.c-component {
color: #000000;
}
@supports (background-blend-mode: multiply) {
.c-component {
color: #FFFFFF;
}
}
.c-component {
background: linear-gradient(to bottom, #FF9900 0%, #FFFFFF 100%);
display: block;
@supports (display: flex) {
display: flex;
}
@media (grid) {
img {
display: none;
}
}
@media
print, monochrome {
background: transparent;
}
}
The
Obscure
Stuff
button svg {
fill: #B8E986;
}
@media (-ms-high-contrast: active) {
button svg {
fill: buttonFace;
}
}
windowText
<a>
highlightText & highlight
buttonFace
window
Text
Links
Selected text
Button label
Background
.background {
animation-name: zoom-and-pan;
}
@media (prefers-reduced-motion) {
.background {
animation: none;
}
}
The Future
Color Gamut
interaction
/* A pointing device with limited accuracy */
@media (pointer: coarse) { … }
/* An accurate pointing device */
@media (pointer: fine) { … }
/* No pointing device */
@media (pointer: none) { … }
/* No hover support */
@media (hover: none) { … }
/* Device supports hovering */
@media (hover: hover) { … }
/* Device can emulate hover (i.e. long press) */
@media (hover: on-demand) { … }
display
/* Normal browser appearance (tabs and other UI chrome) */
@media (display-mode: browser) { … }
/* Browser viewport uses all available space, no UI chrome */
@media (display-mode: fullscreen) { … }
/* Browser will behave like a native app */
@media (display-mode: minimal-ui) { … }
/* Will behave like a native app, with some minor exceptions */
@media (display-mode: standalone) { … }
/* Display updates infrequently */
@media (update: slow) { … }
/* Display updates frequently */
@media (update: fast) { … }
/* No update frequency info transmitted */
@media (update: none) { … }
Mobile First
Andres Galante
Small, Portrait, Slow,
Interlace, Monochrome,
Coarse, Non-Hover
light-level
@media (light-level: normal) { … }
dim
washed
The device is used in a environment with a light level in
the ideal range for the screen, and which does not
necessitate any particular adjustment.
The device is used in a dim environment, where
excessive contrast and brightness would be distracting
or uncomfortable to the reader. For example: night
time, or a dimly illuminated indoor environment.
The device is used in an exceptionally bright
environment, causing the screen to be washed out and
difficult to read. For example: bright daylight.
normal
dim
washed
scripting
@media (scripting: enabled) { … }
none
initial-only
initial-only
Indicates that scripting is enabled during
the initial page load, but is not supported
afterwards. Examples are printed pages, or
pre-rendering network proxies that render
a page on a server and send a nearly-static
version of the page to the user.”
“
HOT DRAMA!
inverted-colors
@media (inverted-colors) {
img,
video {
filter: invert(100%);
}
}
@media (prefers-reduced-motion) { … }
Custom
:root {
}
--brand-primary: #B300CC ;
--brand-secondary: #FFDE00 ;
My cool
webpage!
body {
background-color: var(--brand-secondary);
color: var(--brand-primary);
}
My cool
webpage!
var themeStyles = document.body.style;
themeStyles.setProperty(
'--brand-primary', '#FFDE00'
);
themeStyles.setProperty(
'--brand-secondary', '#B300CC'
);
My cool
webpage!
My cool
webpage!
My cool
webpage!
My cool
webpage!
Invert Theme
My cool
webpage!
Invert Theme
@custom-media --custom-bp (property: value);
@media (--custom-bp) { … }
@media (--custom-bp) { … }
My cool
webpage!
Thanks!
ericwbailey.design
ericwbailey
most places (but mostly Twitter)
WebAIM: Articles
http://webaim.org/articles/
Accessibility is about people, not standards - Part of a whole
http://incl.ca/accessibility-people-not-standards/
Think you know the top web browsers? - Samsung Internet Developers
https://medium.com/samsung-internet-dev/think-you-know-the-top-web-browsers-458a0a070175
alrra/browser-logos
https://github.com/alrra/browser-logos/tree/master/src
References and Resources
Micah Godbolt on Twitter: “Writing correct CSS once is pretty easy. Makin…”
https://twitter.com/micahgodbolt/status/864260989629353985
Rethinking the Mobile Web by Yiibu
https://www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu
Your Body Text Is Too Small - Marvel Blog
https://blog.marvelapp.com/body-text-small/
A Summer Designing for Autism
https://medium.com/google-design/a-summer-designing-for-autism-5859f8096b0b
Generation uX – how to make websites age-friendly | Be Good To Your Users
http://whatusersdo.com/blog/make-websites-age-friendly/
What I've learned about motor impairment | SimplePrimate
http://simpleprimate.com/blog/motor
PX, EM or REM Media Queries
https://zellwk.com/blog/media-query-units/
The EMs have it: Proportional Media Queries FTW! - Cloud Four
https://cloudfour.com/thinks/the-ems-have-it-proportional-media-queries-ftw/
Media Queries Level 4: 9. Appendix A: Deprecated Media Features
https://www.w3.org/TR/mediaqueries-4/#mf-deprecated
Logic in Media Queries | CSS Tricks
https://css-tricks.com/logic-in-media-queries/
Size Calculator
https://sizecalc.com/
Using media queries | MDN
https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
James Kyle on Twitter: “The biggest thing that breaks down CSS…”
https://twitter.com/thejameskyle/status/861539784312840192
Media Type Examples
https://storify.com/ericwbailey/media-type-examples
@media - CSS | MDN
https://developer.mozilla.org/en-US/docs/Web/CSS/@media
7 Habits of Highly Effective Media Queries | Brad Frost
http://bradfrost.com/blog/post/7-habits-of-highly-effective-media-queries/
@supports will change your life | Charlotte Jackson
https://www.lottejackson.com/learning/supports-will-change-your-life
cssnano: A modular minifier based on the PostCSS ecosystem
http://cssnano.co/
User Queries | Blog | Decade City
https://decadecity.net/blog/2015/06/28/user-queries
How to use -ms-high-contrast | Greg Whitworth
http://www.gwhitworth.com/blog/2017/04/how-to-use-ms-high-contrast
Shaun Finglas on Twitter: “Protip - max brightness and high contrast…”
http://www.gwhitworth.com/blog/2017/04/how-to-use-ms-high-contrast
Responsive Design for Motion | WebKit
https://webkit.org/blog/7551/responsive-design-for-motion/
Media Queries Level 5: Editor’s Draft, 16 May 2017
https://drafts.csswg.org/mediaqueries-5/
Responsive Color with Media Queries
http://furbo.org/color/ResponsiveColor/
Touch Devices Should Not Be Judged By Their Size | CSS-Tricks
https://css-tricks.com/touch-devices-not-judged-size/
Lighthouse | Web | Google Developers
https://developers.google.com/web/tools/lighthouse/
Mobile, Small, Portrait, Slow, Interlace, Monochrome, Coarse, Non-Hover,
First | CSS- Tricks
https://css-tricks.com/mobile-small-portrait-slow-interlace-monochrome-coarse-non-hover-first/
How Many People With Disabilities Use My Website? - Mightybytes
https://www.mightybytes.com/blog/how-many-people-with-disabilities-use-my-website/
It’s Time To Start Using CSS Custom Properties - Smashing Magazine
https://www.smashingmagazine.com/2017/04/start-using-css-custom-properties/
Locally Scoped CSS Variables: What, How, and Why | Una Kravets Online
https://una.im/local-css-vars/
Steve Gardner on Twitter: “CSS variables (custom properties) makes…”
https://twitter.com/steveg3003/status/888500276847562752

Más contenido relacionado

Similar a Designing for Inclusion with Media Queries: Boston CSS

Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Patrick Lauke
 
Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...
Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...
Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...
Patrick Lauke
 
CSS3 Media Queries & Kick Start for Mobile
CSS3 Media Queries & Kick Start for MobileCSS3 Media Queries & Kick Start for Mobile
CSS3 Media Queries & Kick Start for Mobile
ambientphoto
 
Introduction to Responsive Web Design
Introduction to Responsive Web DesignIntroduction to Responsive Web Design
Introduction to Responsive Web Design
Shawn Calvert
 
Developing for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic WelterlinDeveloping for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic Welterlin
Razorfish
 
Multimedia unit-1.doc
Multimedia unit-1.docMultimedia unit-1.doc
Multimedia unit-1.doc
polast
 
World Usability Day Future Browsing 12.11.2009
World Usability Day Future Browsing 12.11.2009World Usability Day Future Browsing 12.11.2009
World Usability Day Future Browsing 12.11.2009
Patrick Lauke
 
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
rit2011
 

Similar a Designing for Inclusion with Media Queries: Boston CSS (20)

Adaptive layouts - standards>next Manchester 23.03.2011
Adaptive layouts - standards>next Manchester 23.03.2011Adaptive layouts - standards>next Manchester 23.03.2011
Adaptive layouts - standards>next Manchester 23.03.2011
 
Media queries A to Z
Media queries A to ZMedia queries A to Z
Media queries A to Z
 
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
 
Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...
Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...
Смартфоны и планшетники - mobile-friendly веб-разработка помимо десктопа - RI...
 
Responsive Design for SharePoint
Responsive Design for SharePointResponsive Design for SharePoint
Responsive Design for SharePoint
 
CSS3 Media Queries & Kick Start for Mobile
CSS3 Media Queries & Kick Start for MobileCSS3 Media Queries & Kick Start for Mobile
CSS3 Media Queries & Kick Start for Mobile
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 
Responsive Web Design - Devoxx UK - 2014-06-13
Responsive Web Design - Devoxx UK - 2014-06-13Responsive Web Design - Devoxx UK - 2014-06-13
Responsive Web Design - Devoxx UK - 2014-06-13
 
Multimedia notes
Multimedia  notesMultimedia  notes
Multimedia notes
 
Introduction to Responsive Web Design
Introduction to Responsive Web DesignIntroduction to Responsive Web Design
Introduction to Responsive Web Design
 
Adobe 30iun2011
Adobe 30iun2011Adobe 30iun2011
Adobe 30iun2011
 
Developing for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic WelterlinDeveloping for Responsive Design - Frederic Welterlin
Developing for Responsive Design - Frederic Welterlin
 
Android training day 3
Android training day 3Android training day 3
Android training day 3
 
Multimedia unit-1.doc
Multimedia unit-1.docMultimedia unit-1.doc
Multimedia unit-1.doc
 
Computer ed.
Computer ed.Computer ed.
Computer ed.
 
World Usability Day Future Browsing 12.11.2009
World Usability Day Future Browsing 12.11.2009World Usability Day Future Browsing 12.11.2009
World Usability Day Future Browsing 12.11.2009
 
Responsive webdesign WordCampNL 2012
Responsive webdesign WordCampNL 2012Responsive webdesign WordCampNL 2012
Responsive webdesign WordCampNL 2012
 
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
смартфоны и планшетники. веб разработка помимо десктопа. Patrick h. lauke. зал 1
 
Output ch # 6
Output ch # 6Output ch # 6
Output ch # 6
 
3d internet
3d internet3d internet
3d internet
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Designing for Inclusion with Media Queries: Boston CSS