Skip to content

Instantly share code, notes, and snippets.

@parhumm
Created September 25, 2014 07:31
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 parhumm/02ff4736441d731b6f1c to your computer and use it in GitHub Desktop.
Save parhumm/02ff4736441d731b6f1c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
// @if
// @function
// @mixin
// Direction Controller
$right: right;
$dir: rtl;
@if ( $dir == ltr ) {
$right: left;
} @else {
$right: right;
}
@function test($number) {
@return $number * 2;
}
@function dir-check($a, $b) {
@if $dir == ltr {
@return $a;
} @else {
@return $b;
}
}
// These Mixins check your direction and display @content
@mixin if-ltr {
@if $dir == ltr {
@content;
}
}
@mixin if-rtl {
@if $dir != ltr {
@content;
}
}
@mixin text-hidden($w: 250px, $h:50px) {
text-indent: -9999px;
line-height: 0px;
font-size: 1px;
overflow: hidden;
display: block;
width: $w;
height: $h;
}
@mixin text-hidden-2() {
text-indent: -9999px;
line-height: 0px;
font-size: 1px;
overflow: hidden;
display: block;
@content;
}
.logo-2 {
@include text-hidden-2 {
width: 100px;
height: 50px;
}
}
body {
text-align: $right;
direction: $dir;
width: test(100);
@include if-ltr {
line-height: 18px;
}
@include if-rtl {
line-height: 22px;
h1 {
line-height: 25px;
}
}
}
.logo {
@include text-hidden();
}
.footer {
@include text-hidden(150px, 30px);
}
.next {
content: dir-check('>', '<');
}
.sidebar {
float: $right;
}
.logo-2 {
text-indent: -9999px;
line-height: 0px;
font-size: 1px;
overflow: hidden;
display: block;
width: 100px;
height: 50px;
}
body {
text-align: right;
direction: rtl;
width: 200;
line-height: 22px;
}
body h1 {
line-height: 25px;
}
.logo {
text-indent: -9999px;
line-height: 0px;
font-size: 1px;
overflow: hidden;
display: block;
width: 250px;
height: 50px;
}
.footer {
text-indent: -9999px;
line-height: 0px;
font-size: 1px;
overflow: hidden;
display: block;
width: 150px;
height: 30px;
}
.next {
content: "<";
}
.sidebar {
float: right;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment