0

I am removing the box shadow CSS with my media query:

.myelements {
    @include box-shadow(2px 2px 3px #000);
}

@media (max-width: 768px) {
    .myelements {
        -moz-box-shadow: none;
        -webkit-box-shadow: none;
        box-shadow: none;
    }
}

Instead of re-defining the css as none and having to use all the vendor prefixes I was wondering if there was more elegant sassier way? I am using SASS and Compass.

beingalex
  • 2,416
  • 4
  • 32
  • 71

2 Answers2

4

The correct value is none:

.myelements {
    @include box-shadow(2px 2px 3px #000);
}

@media (max-width: 768px) {
    .myelements {
        @include box-shadow(none);
    }
}

However, you should avoid repeatedly setting/unsetting properties whenever possible to get a smaller CSS file:

.myelements {
    // nothing
}

@media (min-width: 768px) {
    .myelements {
        @include box-shadow(2px 2px 3px #000);
    }
}
cimmanon
  • 67,211
  • 17
  • 165
  • 171
1

Make it transparent:

.myelements {
    @include box-shadow(2px 2px 3px #000);
}

@media (max-width: 768px) {
    @include box-shadow(0 0 0 0 rgba(0,0,0,0));
}
Alex
  • 11,115
  • 12
  • 51
  • 64
  • 1
    Is that the most elegant way? I thought there may of been a `@include box-shadow(none);` or something. – beingalex May 15 '14 at 11:52