Skip to content

Instantly share code, notes, and snippets.

@cimmanon
Created October 27, 2015 19:40
Show Gist options
  • Save cimmanon/52cfaf17a80773c23a20 to your computer and use it in GitHub Desktop.
Save cimmanon/52cfaf17a80773c23a20 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// 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;
}
}
}
}
}
@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