Skip to content

Instantly share code, notes, and snippets.

@roubaobaozi
Created March 26, 2014 02:38
Show Gist options
  • Save roubaobaozi/9775949 to your computer and use it in GitHub Desktop.
Save roubaobaozi/9775949 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="someclass notip">notip</div>
<div class="someclass">not notip</div>
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
$dropdown-width: 100px;
$comp-tip: true;
@mixin tip($pos:right) {
}
@mixin dropdown-pos($pos:right) {
&:not(.notip) {
@if $comp-tip == true{
@if $pos == right {
top:$dropdown-width * -0.6;
background-color: #f00;
@include tip($pos:$pos);
}
}
}
&.notip {
@if $pos == right {
top: 0;
left:$dropdown-width * 0.8;
background-color: #00f;
}
}
}
.someclass { @include dropdown-pos(); }
.someclass:not(.notip) {
top: -60px;
background-color: #f00;
}
.someclass.notip {
top: 0;
left: 80px;
background-color: #00f;
}
<div class="someclass notip">notip</div>
<div class="someclass">not notip</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment