Skip to content

Commit 0e654e5

Browse files
committed
update: add offset parameter to onePixelBorder mixin and update devDependencies
1 parent 38efe93 commit 0e654e5

5 files changed

Lines changed: 1882 additions & 285 deletions

File tree

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
11
{
22
"name": "qmui_web",
3-
"version": "3.0.1",
3+
"version": "3.0.2",
44
"description": "一个旨在提高 UI 开发效率、快速产生项目 UI 的前端框架",
55
"repository": {
66
"type": "git",
77
"url": "git+https://github.com/Tencent/QMUI_Web.git"
88
},
99
"main": "gulpfile.js",
1010
"dependencies": {
11-
"ansi-colors": "^3.0.5",
12-
"autoprefixer": "^9.1.5",
11+
"ansi-colors": "^3.2.1",
12+
"autoprefixer": "^9.3.1",
1313
"beeper": "^1.1.1",
14-
"browser-sync": "^2.23.6",
14+
"browser-sync": "^2.26.3",
1515
"color-support": "^1.1.3",
1616
"del": "^3.0.0",
1717
"fancy-log": "^1.3.2",
1818
"gulp": "^4.0.0",
1919
"gulp-better-sass-inheritance": "^0.0.3",
20-
"gulp-clean-css": "^3.9.3",
20+
"gulp-clean-css": "^3.10.0",
2121
"gulp-concat": "^2.6.1",
2222
"gulp-debug": "^4.0.0",
2323
"gulp-file-include": "^2.0.1",
2424
"gulp-file-sync": "^2.0.0",
2525
"gulp-if": "^2.0.2",
26-
"gulp-imagemin": "^4.1.0",
26+
"gulp-imagemin": "^5.0.3",
2727
"gulp-load-plugins": "^1.5.0",
2828
"gulp-merge-link": "^0.1.3",
2929
"gulp-plumber": "^1.2.0",
3030
"gulp-postcss": "^8.0.0",
31-
"gulp-rename": "^1.2.2",
31+
"gulp-rename": "^1.4.0",
3232
"gulp-replace": "^1.0.0",
33-
"gulp-sass": "^4.0.1",
33+
"gulp-sass": "^4.0.2",
3434
"gulp-shell": "^0.6.5",
3535
"gulp-sourcemaps": "^2.6.4",
36-
"gulp-uglify": "^3.0.0",
36+
"gulp-uglify": "^3.0.1",
3737
"imagemin-pngquant": "^6.0.0",
3838
"js-md5": "^0.7.3",
39-
"lodash": "^4.17.5",
39+
"lodash": "^4.17.11",
4040
"mkdirp": "^0.5.1",
4141
"path": "^0.12.7",
42-
"postcss-lazysprite": "^1.8.2",
42+
"postcss-lazysprite": "^2.1.4",
4343
"postcss-svg-sprite": "^1.0.6",
4444
"yargs": "^12.0.2"
4545
},
4646
"devDependencies": {
47-
"sassdoc": "^2.5.0",
47+
"sassdoc": "^2.5.1",
4848
"stylelint-wechat-work-css": "^0.4.1"
4949
},
5050
"keywords": [

qmui/mixin/_adaptation.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@
123123
/// @name bgWithOpacity
124124
/// @param {Color} $color - 背景色的颜色值
125125
/// @param {Number} $alpha - 背景色的透明度
126-
@mixin bgWithOpacity($color,$alpha) {
126+
@mixin bgWithOpacity($color, $alpha) {
127127
background-color: rgba($color, $alpha);
128128
@include forIE8 {
129-
filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#{ie-hex-str(rgba($color,$alpha))}, endcolorstr=#{ie-hex-str(rgba($color, $alpha))});
129+
filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#{ie-hex-str(rgba($color, $alpha))}, endcolorstr=#{ie-hex-str(rgba($color, $alpha))});
130130
}
131131
}
132132

qmui/mixin/tool/_effect.scss

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@
5555
border-top: 0;
5656
border-bottom-color: $borderColor;
5757
}
58-
/* 向下小三角 */
58+
/* 向下小三角 */
5959
@else if $direction == bottom {
6060
border-width: $height $width / 2;
6161
border-bottom: 0;
6262
border-top-color: $borderColor;
6363
}
64-
/* 向左小三角 */
64+
/* 向左小三角 */
6565
@else if $direction == left {
6666
border-width: $width / 2 $height;
6767
border-left: 0;
6868
border-right-color: $borderColor;
6969
}
70-
/* 向右小三角 */
70+
/* 向右小三角 */
7171
@else if $direction == right {
7272
border-width: $width / 2 $height;
7373
border-right: 0;
@@ -144,22 +144,29 @@
144144
/// @param {Color} $color - 边框的颜色
145145
/// @param {String} $position [outside] - 边框的位置,支持 outside 和 inside
146146
/// @param {Number} $borderRadius [0] - 边框的圆角
147+
/// @param {Number} $offset 水平缩进值
147148
/// @throw 在多倍屏下,本方法会利用元素的 ::after 做效果,因此需要注意使用了该方法后 ::after 则尽量避免添加样式,以免影响效果
148-
@mixin onePixelBorder($direction: all, $color: $common_color_border, $position: outside, $borderRadius: 0) {
149+
@mixin onePixelBorder($direction: all, $color: $common_color_border, $position: outside, $borderRadius: 0, $borderStyle: solid, $offset: 0) {
149150
@include borderStyleForOnePixel($direction, $color);
150151
border-radius: $borderRadius;
152+
border-style: $borderStyle;
151153
@include screenResolution(2) {
152154
position: relative;
153155
border: 0;
154156
&:after {
155157
content: "";
156158
position: absolute;
157159
top: 0;
158-
left: 0;
159-
width: 200%;
160+
left: $offset;
161+
@if $offset == 0 {
162+
width: 200%;
163+
} @else {
164+
width: calc(200% - #{$offset * 2 * 2});
165+
}
160166
height: 200%;
161167
border-radius: $borderRadius * 2;
162168
@include borderStyleForOnePixel($direction, $color);
169+
border-style: $borderStyle;
163170
transform: scale(.5);
164171
transform-origin: 0 0;
165172
@if $position == inside {
@@ -170,7 +177,11 @@
170177
}
171178
@include screenResolution(3) {
172179
&:after {
173-
width: 300%;
180+
@if $offset == 0 {
181+
width: 300%;
182+
} @else {
183+
width: calc(300% - #{$offset * 3 * 2});
184+
}
174185
height: 300%;
175186
border-radius: $borderRadius * 3;
176187
transform: scale((1 / 3));

stylelint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030
'opacity',
3131
'keyframes'
3232
],
33-
'wechat-work/comments-in-header': true, // 文件头部需要有注释 @date 和 @author
33+
'wechat-work/comments-in-header': false, // 文件头部需要有注释 @date 和 @author,QMUI Web 源码中使用的是 SassDoc 的注释格式,不被识别,因此设置为 false
3434
'wechat-work/selector-namespace-follow-filename': [true, {
3535
'fileDirWhiteList': ['widget', 'qmui'],
3636
'filenameWhitelist': []

0 commit comments

Comments
 (0)