Created
October 27, 2015 19:40
-
-
Save cimmanon/52cfaf17a80773c23a20 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.14) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin bp($point) { | |
@if $point == s { | |
@media (screen) { @content; } | |
} | |
@if $point == m { | |
@media #{$screen-m} { @content; } | |
} | |
@else if $point == l { | |
@media #{$screen-l} { @content; } | |
} | |
} | |
$directions: "rtl", | |
"ltr"; | |
@each $direction in $directions { | |
.simple-container { | |
.parent[dir=#{$direction}] & { //this will work. | |
@include bp(s) { | |
//when using bp(s) $direction is now out of scope. | |
position: absolute; | |
@if $direction == "rtl" { //this will not work :( | |
right: -15px; | |
} @else { | |
left: -15px; | |
} | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media (screen) { | |
.parent[dir=rtl] .simple-container { | |
position: absolute; | |
right: -15px; | |
} | |
} | |
@media (screen) { | |
.parent[dir=ltr] .simple-container { | |
position: absolute; | |
left: -15px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment