Skip to content

Instantly share code, notes, and snippets.

@jackmakesthings
Forked from aarongustafson/mq4-hover.css
Last active August 28, 2015 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackmakesthings/e0dd4862d18f94cef9f0 to your computer and use it in GitHub Desktop.
Save jackmakesthings/e0dd4862d18f94cef9f0 to your computer and use it in GitHub Desktop.
Code samples from my Responsive Day Out talk Where Do We Go From Here?
@media (hover:hover) {
/* hover-related interactions are A-OK */
}
@media (hover:on-demand) {
/* hover-related interactions are potentially difficult,
maybe do something else instead */
}
@media (hover:none) {
/* No hover possible :-( */
}
@media (pointer:fine) {
/* Smaller links and buttons are ok */
}
@media (pointer:coarse) {
/* Larger links and buttons are probably a good idea */
}
function detectType( event ) {
switch( event.pointerType ) {
case "mouse:
/* mouse input detected */
break;
case "pen":
/* pen/stylus input detected */
break;
case "touch:
/* touch input detected */
break;
default:
/* pointerType is empty (could not be detected) or UA-specific custom type */
}
}
if ( window.PointerEvent ) {
window.addEventListener( "pointerdown", detectType, false );
}
<meta name=“msapplication-cortanavcd" content="http://myapp.io/vcd.xml">
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="groupPost">
<CommandPrefix>Group Post</CommandPrefix>
<Example>Group Post add note</Example>
<Command Name="addNote">
<Example>add a note {message} using group post</Example>
<ListenFor RequireAppName="BeforeOrAfterPhrase">[please] add a note [that] {noteSubject}</ListenFor>
<Feedback>adding {noteSubject} to Group Post</Feedback>
<Navigate Target="/addNote.htm"/>
</Command>
<PhraseTopic Label="noteSubject" Scenario="Dictation"></PhraseTopic>
</CommandSet>
</VoiceCommands>
body {
max-width: 64em;
}
@media screen and (min-width: 64em) {
body {
font-size: 1.5625vw; /* ( 1em / 64em ) * 100 */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment