Skip to content

Commit

Permalink
🎨 Use mixin instead of extend.
Browse files Browse the repository at this point in the history
  • Loading branch information
kayo5994 committed Apr 4, 2019
1 parent 08ff906 commit 8a1d302
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qmui_web",
"version": "3.1.2",
"version": "3.1.3",
"description": "一个旨在提高 UI 开发效率、快速产生项目 UI 的前端框架",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion project/widget/_tab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}

.qui_tabNav {
@extend %clear;
@include clear;
padding: $tabNav_padding;
border-bottom: 1px solid #DEE0E2;
}
Expand Down
4 changes: 2 additions & 2 deletions qmui/_function.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
}

.qui_txtOverflow {
@extend %text_ellipsis;
@include text-ellipsis;
}

.qui_clear {
@extend %clear;
@include clear;
}

.qui_txtNowrap {
Expand Down
19 changes: 12 additions & 7 deletions qmui/mixin/_adaptation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
///
/// @group 布局
/// @name clear
%clear {
@mixin clear {
&:after {
clear: both;
content: ".";
Expand All @@ -22,11 +22,15 @@
}
}

%clear {
@include clear;
}

/// 单行省略号
///
/// @group 外观
/// @name text-ellipsis
%text-ellipsis {
@mixin text-ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
Expand All @@ -35,8 +39,8 @@
word-wrap: normal;
}

%text_ellipsis {
@extend %text-ellipsis;
%text-ellipsis {
@include text-ellipsis;
}

/// 多行省略号
Expand All @@ -59,6 +63,7 @@
line-clamp: $line;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-webkit-text-size-adjust: none;
// stylelint-enable
box-orient: vertical;
}
Expand All @@ -67,13 +72,13 @@
///
/// @group 外观
/// @name text-breakWord
%text-breakWord {
@mixin text-breakWord {
word-wrap: break-word;
word-break: break-word;
}

%text_breakWord {
@extend %text-breakWord;
%text-breakWord {
@include text-breakWord;
}

/// 适配多倍屏的 CSS 选择器
Expand Down

0 comments on commit 8a1d302

Please sign in to comment.