Skip to content

Instantly share code, notes, and snippets.

@philoye
Created December 2, 2011 00:32
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 philoye/1420982 to your computer and use it in GitHub Desktop.
Save philoye/1420982 to your computer and use it in GitHub Desktop.
problem with sass media queries + variables
source :rubygems
gem 'fssm'
gem 'sass', git: 'git://github.com/nex3/sass.git', branch: 'master'
GIT
remote: git://github.com/nex3/sass.git
revision: a6a80a8a594d9a1f904b931ff4facf88bc4908b4
branch: master
specs:
sass (3.2.0.alpha.0)
GEM
remote: http://rubygems.org/
specs:
fssm (0.2.7)
PLATFORMS
ruby
DEPENDENCIES
fssm
sass!
bundle exec sass --watch style.sass:style.css
body {
background-color: #eeeeee; }
.page {
width: 920px;
background-color: white; }
@media screen and (max-width: 320px) {
.page {
width: 100%; } }
@media screen and (max-width: $px) {
.page {
width: 500px; } }
=respond-to($media)
@if $media == phone
@media screen and (max-width: 320px)
@content
@if $media == tablet
@media screen and (max-width: 768px)
@content
=respond-max($px)
@media screen and (max-width: $px)
@content
body
background-color: #eee
.page
width: 920px
background-color: #fff
+respond-to(phone)
width: 100%
+respond-max(768px)
width: 500px
@philoye
Copy link
Author

philoye commented Dec 6, 2011

Oops, I didn't read that pull request closely enough. That wasn't merged in at all, but @chriseppstein says an implementation is in the works.

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