From 8a1d3022356d30c5c866206c4546ff6acc085eb3 Mon Sep 17 00:00:00 2001 From: kayo5994 <330956999@qq.com> Date: Thu, 4 Apr 2019 20:36:43 +0800 Subject: [PATCH] :art: Use mixin instead of extend. --- package.json | 2 +- project/widget/_tab.scss | 2 +- qmui/_function.scss | 4 ++-- qmui/mixin/_adaptation.scss | 19 ++++++++++++------- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 714c609..0aa2d4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qmui_web", - "version": "3.1.2", + "version": "3.1.3", "description": "一个旨在提高 UI 开发效率、快速产生项目 UI 的前端框架", "repository": { "type": "git", diff --git a/project/widget/_tab.scss b/project/widget/_tab.scss index d15d1b9..8460f2c 100644 --- a/project/widget/_tab.scss +++ b/project/widget/_tab.scss @@ -24,7 +24,7 @@ } .qui_tabNav { - @extend %clear; + @include clear; padding: $tabNav_padding; border-bottom: 1px solid #DEE0E2; } diff --git a/qmui/_function.scss b/qmui/_function.scss index 06d9b61..51651a0 100644 --- a/qmui/_function.scss +++ b/qmui/_function.scss @@ -30,11 +30,11 @@ } .qui_txtOverflow { - @extend %text_ellipsis; + @include text-ellipsis; } .qui_clear { - @extend %clear; + @include clear; } .qui_txtNowrap { diff --git a/qmui/mixin/_adaptation.scss b/qmui/mixin/_adaptation.scss index 7af83a9..d529451 100644 --- a/qmui/mixin/_adaptation.scss +++ b/qmui/mixin/_adaptation.scss @@ -11,7 +11,7 @@ /// /// @group 布局 /// @name clear -%clear { +@mixin clear { &:after { clear: both; content: "."; @@ -22,11 +22,15 @@ } } +%clear { + @include clear; +} + /// 单行省略号 /// /// @group 外观 /// @name text-ellipsis -%text-ellipsis { +@mixin text-ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; @@ -35,8 +39,8 @@ word-wrap: normal; } -%text_ellipsis { - @extend %text-ellipsis; +%text-ellipsis { + @include text-ellipsis; } /// 多行省略号 @@ -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; } @@ -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 选择器