Skip to content

Instantly share code, notes, and snippets.

@mlzxy
Last active August 29, 2015 14:25
Show Gist options
  • Save mlzxy/da09e1adb9690fb0a4c4 to your computer and use it in GitHub Desktop.
Save mlzxy/da09e1adb9690fb0a4c4 to your computer and use it in GitHub Desktop.
Sass 通过@for生成代码例子
// ----
// libsass (v3.2.5)
// ----
$aseq-10:10,20,30,40,50,60,70,80,90,100;
.h-full{
height:100% !important;
}
@for $i from 1 through length($aseq-10) {
.h-#{nth($aseq-10,$i)}{
height: nth($aseq-10,$i)+% !important;
}
}
.h-full {
height: 100% !important;
}
.h-10 {
height: 10% !important;
}
.h-20 {
height: 20% !important;
}
.h-30 {
height: 30% !important;
}
.h-40 {
height: 40% !important;
}
.h-50 {
height: 50% !important;
}
.h-60 {
height: 60% !important;
}
.h-70 {
height: 70% !important;
}
.h-80 {
height: 80% !important;
}
.h-90 {
height: 90% !important;
}
.h-100 {
height: 100% !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment