把一個數變成百分比,挺重要的一個函數?。槭裁磿X得沒有用呢?比如你想讓某一列占屏幕的1/12,就可以通過percentage將它變成一個百分數
2016-09-10
https://github.com/ww18/scssRealizeRenalbe/tree/master, 用簡潔的方法實現了上面的功能,大家可以去看看,有更好的建議歡迎提出
2016-09-09
To-upper-case() 函數將字符串小寫字母轉換成大寫字母;
To-lower-case() 函數將字符串轉換成小寫字母。
To-lower-case() 函數將字符串轉換成小寫字母。
2016-09-09
$sizeType:bg md sm xs;
$fullwidth:100%;
@for $i from 1 through 12{
.col-#{nth($sizeType,1)}-#{$i},.col-#{nth($sizeType,2)}-#{$i},.col-#{nth($sizeType,3)}-#{$i},.col-#{nth($sizeType,4)}-#{$i}{
width:$fullwidth/12 * $i;
}
}
不知道這樣是不是Bootstrape 的grid
$fullwidth:100%;
@for $i from 1 through 12{
.col-#{nth($sizeType,1)}-#{$i},.col-#{nth($sizeType,2)}-#{$i},.col-#{nth($sizeType,3)}-#{$i},.col-#{nth($sizeType,4)}-#{$i}{
width:$fullwidth/12 * $i;
}
}
不知道這樣是不是Bootstrape 的grid
2016-09-06
sass的導入(@import)規則和CSS的有所不同,編譯時會將@import的scss文件合并進來只生成一個CSS文件。但是如果你在sass文件中導入css文件如@import 'reset.css',那效果跟普通CSS導入樣式文件一樣,導入的css文件不會合并到編譯后的文件中,而是以@import方式存在。
所有的sass導入文件都可以忽略后綴名.scss。一般來說基礎的文件命名方法以_開頭,如_mixin.scss。這種文件在導入的時候可以不寫下劃線,可寫成@import "mixin"。
所有的sass導入文件都可以忽略后綴名.scss。一般來說基礎的文件命名方法以_開頭,如_mixin.scss。這種文件在導入的時候可以不寫下劃線,可寫成@import "mixin"。
2016-09-06
$zips:zip(solid dashed dotted,1px 2px 3px,green blue red);
.test-zip {
content:length($zips);
}
@for $i from 1 to (length($zips)+1){
.test-#{$i}{
border:nth($zips,$i);
}
}
.test-zip {
content:length($zips);
}
@for $i from 1 to (length($zips)+1){
.test-#{$i}{
border:nth($zips,$i);
}
}
2016-08-30
$str:blue,green,#fff,#000;
$ss:append((blue, green),red,comma);
$ff:append($str,#f00,space);
.test-app {
content:length($ff),$ss;
}
$ss:append((blue, green),red,comma);
$ff:append($str,#f00,space);
.test-app {
content:length($ff),$ss;
}
2016-08-30
$joins: join(blue,(red orange),space);
$nth:$joins;
.test-join {
content:length($joins);
}
@for $i from 1 through (length($nth)) {
.test-#{$i}{
color: nth($nth,$i);
}
}
$nth:$joins;
.test-join {
content:length($joins);
}
@for $i from 1 through (length($nth)) {
.test-#{$i}{
color: nth($nth,$i);
}
}
2016-08-30