Blame view

uni_modules/uview-plus/libs/css/common.scss 2.64 KB
a2702f6d   刘淇   巡查计划
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
  // 超出行数,自动显示行尾省略号,最多5
  // 来自uview-plus的温馨提示:当您在控制台看到此报错,说明需要在App.vuestyle标签加上【lang="scss"
  @for $i from 1 through 10 {
  	.u-line-#{$i},
  	.up-line-#{$i} {
  		/* #ifdef APP-NVUE */
  		// nvue下,可以直接使用lines属性,这是weex特有样式
  		lines: $i;
  		text-overflow: ellipsis;
  		overflow: hidden;
  		flex: 1;
  		/* #endif */
  
  		/* #ifndef APP-NVUE */
  		// vue下,单行和多行显示省略号需要单独处理
  		@if $i == 1 {
  			overflow: hidden;
  			white-space: nowrap;
  			text-overflow: ellipsis;
  		} @else {
  			display: -webkit-box!important;
  			overflow: hidden;
  			text-overflow: ellipsis;
  			word-break: break-all;
  			-webkit-line-clamp: $i;
  			-webkit-box-orient: vertical!important;
  		}
  		/* #endif */
  	}
  }
  
  
  // 此处加上!important并非随意乱用,而是因为目前*.nvue页面编译到H5时,
  // App.vue的样式会被uni-appview元素的自带border属性覆盖,导致无效
  // 综上,这是uni-app的缺陷导致我们为了多端兼容,而必须要加上!important
  // 移动端兼容性较好,直接使用0.5px去实现细边框,不使用伪元素形式实现
  .u-border,
  .up-border {
  	border-width: 0.5px!important;
  	border-color: $u-border-color!important;
      border-style: solid;
  }
  
  .u-border-top,
  .up-border-top {
  	border-top-width: 0.5px!important;
  	border-color: $u-border-color!important;
      border-top-style: solid;
  }
  
  .u-border-left,
  .up-border-left {
  	border-left-width: 0.5px!important;
  	border-color: $u-border-color!important;
      border-left-style: solid;
  }
  
  .u-border-right,
  .up-border-right {
  	border-right-width: 0.5px!important;
  	border-color: $u-border-color!important;
      border-right-style: solid;
  }
  
  .u-border-bottom,
  .up-border-bottom {
  	border-bottom-width: 0.5px!important;
  	border-color: $u-border-color!important;
      border-bottom-style: solid;
  }
  
  .u-border-top-bottom,
  .up-border-top-bottom {
  	border-top-width: 0.5px!important;
  	border-bottom-width: 0.5px!important;
  	border-color: $u-border-color!important;
      border-top-style: solid;
      border-bottom-style: solid;
  }
  
  // 去除button的所有默认样式,让其表现跟普通的viewtext元素一样
  .u-reset-button,
  .up-reset-button {
  	padding: 0;
  	background-color: transparent;
  	/* #ifndef APP-PLUS */
  	font-size: inherit;
  	line-height: inherit;
  	color: inherit;
  	/* #endif */
  	/* #ifdef APP-NVUE */
  	border-width: 0;
  	/* #endif */
  }
  
  /* #ifndef APP-NVUE */
  .u-reset-button::after,
  .up-reset-button::after {
     border: none;
  }
  /* #endif */
  
  .u-hover-class,
  .up-hover-class {
  	opacity: 0.7;
  }
  
  .cursor-pointer {
  	/* #ifdef H5 */
  	cursor: pointer;
  	/* #endif */
  }