$borderlve1: #dcdfe6; // 一級(jí)邊框
$borderlve2: #e4e7ed; // 2級(jí)邊框
$borderlve3: #ebeef5; // 3級(jí)邊框
$borderlve3: #f2f6fc; // 4級(jí)邊框
$color-header: #303133;
$color-body: #606266;
$color-body2: #909399;
$color-other: #c0c4cc;
$default-bg: #fff;
$them: #6132f6;
$dark-light: #7f7dd9;
$light: #8c97de;
$title-color: #333;
$content-color: #666;
$dec-color: #999;
$white: #fff;
$font-title: 30px;
$font-content: 28px;
$font-dec: 24px;
$color-type: (
"white": #fff,
"title": #333,
"content": #666,
"dec": #808080,
"link": #09f,
"success": green,
"danger": red,
"err": red,
"warn": orange,
);
@each $Key, $Value in $color-type {
.c-#{$Key} {
color: $Value;
}
}
@each $Key, $Value in $color-type {
.bg-#{$Key} {
background-color: $Value;
}
}
// 字體樣式
$font-type: (
"title": 32px,
"content": 30px,
"dec": 26px,
"36": 36px,
"32": 32px,
"30": 30px,
"28": 28px,
"24": 24px,
"22": 22px,
"20": 20px,
"18": 18px,
"16": 16px,
"14": 14px,
);
@each $Key, $Value in $font-type {
.f-#{$Key} {
font-size: $Value;
}
}
$font-weight-type: (
"normal": normal,
"bold": bold,
"100": 100,
"200": 200,
"300": 300,
"400": 400,
"500": 500,
"600": 600,
"700": 700,
"800": 800,
"900": 900,
);
@each $Key, $Value in $font-weight-type {
.fw-#{$Key} {
font-weight: $Value;
}
}
@mixin prefix($stylename, $value, $options: webkit moz o ms) {
#{$stylename}: $value;
@each $option in $options {
@if $option == webkit {
-webkit-#{$stylename}: $value;
} @else if $option == moz {
-moz-#{$stylename}: #{$value};
} @else if $option == o {
-o-#{$stylename}: #{$value};
} @else if $option == ms {
-ms-#{$stylename}: #{$value};
}
}
}
// 彈性盒子
@mixin flex-box($type: row, $justify: center, $align: center) {
@include prefix(display, flex);
@include prefix(box-sizing, border-box);
@include prefix(flex-direction, $type);
@include prefix(justify-content, $justify);
@include prefix(align-items, $align);
}
$flex-type: (
"auto": auto,
"none": none,
"column": column,
"column-reverse": column-reverse,
"row": row,
"row-reverse": "row-reverse",
);
$justify-conetnt: (
"start": flex-start,
"end": flex-end,
"center": center,
"between": space-between,
"around": space-around,
);
$align-items: (
"start": flex-start,
"end": flex-end,
"center": center,
"baseline ": baseline,
"stretch": stretch,
);
@each $flexKey, $flexValue in $flex-type {
@if ($flexKey!= "auto" and $flexKey!= "none") {
@each $Key, $value in $justify-conetnt {
@each $Key2, $value2 in $align-items {
.#{$flexValue}-#{$Key}-#{$Key2} {
@include flex-box($flexValue, $value, $value2);
}
}
}
}
}
// 外邊距 和 內(nèi)邊距
$spacing-types: (
m: margin,
p: padding,
);
$spacing-direction: (
t: top,
r: right,
b: bottom,
l: left,
);
// 基礎(chǔ)值
$spacing-base-size: 1px;
$spacing-sizes: (
0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
10: 10,
15: 15,
20: 20,
25: 25,
30: 30,
40: 40,
50: 50,
60: 60,
);
@each $typeKey, $type in $spacing-types {
//m-0
@each $sizeKey, $size in $spacing-sizes {
.#{$typeKey}-#{$sizeKey} {
#{$type}: $size * $spacing-base-size;
}
}
//mx-0
@each $sizeKey, $size in $spacing-sizes {
.#{$typeKey}x-#{$sizeKey} {
#{$type}-left: $size * $spacing-base-size;
#{$type}-right: $size * $spacing-base-size;
}
}
//my-0
@each $sizeKey, $size in $spacing-sizes {
.#{$typeKey}y-#{$sizeKey} {
#{$type}-top: $size * $spacing-base-size;
#{$type}-bottom: $size * $spacing-base-size;
}
}
//mt-0,mb-0,ml-0,mr-0
@each $dirKey, $dir in $spacing-direction {
@each $sizeKey, $size in $spacing-sizes {
.#{$typeKey}#{$dirKey}-#{$sizeKey} {
#{$type}-#{$dir}: $size * $spacing-base-size;
}
}
}
}
// 超出隱藏
@mixin ellipsis($rowCount: 1, $width: 100%) {
width: $width;
@if $rowCount <=1 {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} @else {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: $rowCount;
-webkit-box-orient: vertical;
}
}
// border-bottom
@mixin border-bottom($width: 100%, $height: 1px, $color: #eee) {
position: relative;
&::after {
position: absolute;
left: 0;
bottom: 1px;
width: $width;
margin-left: 50%;
content: "";
height: $height;
background: $color;
transform: translateX(-50%);
}
}
@mixin images {
& > img {
display: block;
width: 100%;
padding: 0;
margin: 0;
}
}
@mixin setFont($size: $font-content, $color: $content-color, $weight: normal) {
font-size: $size;
color: $color;
font-weight: $weight;
// letter-spacing: 0.5px;
}
@mixin linear-gradient($orientation: to right, $firstColor: #7876cc, $sencondColor: #8c97de) {
background: linear-gradient($orientation, $firstColor, $sencondColor);
}
@mixin devborder($color: red) {
@if ($isDev) {
box-sizing: border-box;
border: 1px solid $color;
}
}
scss 集
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
- 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)樟蠕,“玉大人贮聂,你說(shuō)我怎么就攤上這事∨髂” “怎么了寂汇?”我有些...
- 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)捣染。 經(jīng)常有香客問(wèn)我骄瓣,道長(zhǎng),這世上最難降的妖魔是什么? 我笑而不...
- 正文 為了忘掉前任榕栏,我火速辦了婚禮畔勤,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘扒磁。我一直安慰自己庆揪,他們只是感情好,可當(dāng)我...
- 文/花漫 我一把揭開白布妨托。 她就那樣靜靜地躺著缸榛,像睡著了一般。 火紅的嫁衣襯著肌膚如雪兰伤。 梳的紋絲不亂的頭發(fā)上内颗,一...
- 那天,我揣著相機(jī)與錄音敦腔,去河邊找鬼均澳。 笑死,一個(gè)胖子當(dāng)著我的面吹牛符衔,可吹牛的內(nèi)容都是我干的找前。 我是一名探鬼主播,決...
- 文/蒼蘭香墨 我猛地睜開眼判族,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼躺盛!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起形帮,我...
- 序言:老撾萬(wàn)榮一對(duì)情侶失蹤颗品,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后沃缘,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
- 正文 獨(dú)居荒郊野嶺守林人離奇死亡则吟,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
- 正文 我和宋清朗相戀三年槐臀,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片氓仲。...
- 正文 年R本政府宣布啥箭,位于F島的核電站谍珊,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏急侥。R本人自食惡果不足惜砌滞,卻給世界環(huán)境...
- 文/蒙蒙 一侮邀、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧贝润,春花似錦绊茧、人聲如沸。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至尊蚁,卻和暖如春亡笑,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背枝誊。 一陣腳步聲響...
- 正文 我出身青樓绝骚,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親祠够。 傳聞我的和親對(duì)象是個(gè)殘疾皇子压汪,可洞房花燭夜當(dāng)晚...