Skip to content

Instantly share code, notes, and snippets.

@cjcheshire
Created June 21, 2012 14:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjcheshire/2966063 to your computer and use it in GitHub Desktop.
Save cjcheshire/2966063 to your computer and use it in GitHub Desktop.
SASS 3.2 HTML5 Fullscreen Support
@mixin fullscreen() {
&:-webkit-full-screen {
@content;
}
&:-mozilla-full-screen {
@content;
}
&:full-screen {
@content;
}
}
@include fullscreen() {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
margin: 0;
}
@peterpeterparker
Copy link

I wasn't able to list the pseudo selector using comma (same as https://stackoverflow.com/questions/47444344/prefixed-fullscreen-psuedo-selector-on-firefox) but using a mixin is definitely a great idea which solves the issue nicely, thx @cjcheshire!

Regarding your above solution I have modified the mixin like the following:

@mixin fullscreen() {
  &:-moz-full-screen {
    @content;
  }

  &:-webkit-full-screen {
    @content;
  }

  &:-ms-fullscreen {
    @content;
  }

  &:fullscreen {
    @content;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment