Commit a0141266d43b558e9a01f8d84857c38f35090989

Authored by 梁灏
1 parent e9ad2b7a

update Divider style

src/components/divider/divider.vue
@@ -23,9 +23,9 @@ @@ -23,9 +23,9 @@
23 }, 23 },
24 orientation: { 24 orientation: {
25 type: String, 25 type: String,
26 - default: 'left', 26 + default: 'center',
27 validator (value) { 27 validator (value) {
28 - return oneOf(value, ['left', 'right']); 28 + return oneOf(value, ['left', 'right', 'center']);
29 } 29 }
30 }, 30 },
31 dashed: { 31 dashed: {
src/styles/components/divider.less
1 -  
2 -  
3 @divider-prefix-cls: ~"@{css-prefix}divider"; 1 @divider-prefix-cls: ~"@{css-prefix}divider";
4 2
5 -@font-size-base : 14px;  
6 -@font-size-lg : @font-size-base + 2px;  
7 -@heading-color : fade(#000, 85%);  
8 -  
9 -.reset-component() {  
10 - font-family: @font-family;  
11 - font-size: @font-size-base;  
12 - line-height: @line-height-base;  
13 - color: @text-color;  
14 - box-sizing: border-box;  
15 - margin: 0;  
16 - padding: 0;  
17 - list-style: none;  
18 -}  
19 -  
20 .@{divider-prefix-cls} { 3 .@{divider-prefix-cls} {
21 - .reset-component;  
22 - background: @border-color-split; 4 + .reset-component;
  5 + background: @border-color-split;
23 6
24 - &, // for compatiable  
25 - &-vertical {  
26 - margin: 0 8px;  
27 - display: inline-block;  
28 - height: 0.9em;  
29 - width: 1px;  
30 - vertical-align: middle;  
31 - position: relative;  
32 - top: -0.06em;  
33 - }  
34 - &-horizontal {  
35 - display: block;  
36 - height: 1px;  
37 - width: 100%;  
38 - margin: 24px 0;  
39 - }  
40 - &-horizontal&-with-text {  
41 - display: table;  
42 - white-space: nowrap;  
43 - text-align: center;  
44 - background: transparent;  
45 - font-weight: 500;  
46 - color: @heading-color;  
47 - font-size: @font-size-lg;  
48 - margin: 16px 0;  
49 -  
50 - &:before,  
51 - &:after {  
52 - content: '';  
53 - display: table-cell;  
54 - position: relative;  
55 - top: 50%;  
56 - width: 50%;  
57 - border-top: 1px solid @border-color-split;  
58 - transform: translateY(50%); 7 + &, // for compatiable
  8 + &-vertical {
  9 + margin: 0 8px;
  10 + display: inline-block;
  11 + height: 0.9em;
  12 + width: 1px;
  13 + vertical-align: middle;
  14 + position: relative;
  15 + top: -0.06em;
59 } 16 }
60 - }  
61 - &-inner-text {  
62 - display: inline-block;  
63 - padding: 0 24px;  
64 - }  
65 - &-horizontal&-with-text-left {  
66 - display: table;  
67 - white-space: nowrap;  
68 - text-align: center;  
69 - background: transparent;  
70 - font-weight: 500;  
71 - color: @heading-color;  
72 - font-size: @font-size-base;  
73 - margin: 16px 0;  
74 -  
75 - &:before {  
76 - content: '';  
77 - display: table-cell;  
78 - position: relative;  
79 - top: 50%;  
80 - width: 5%;  
81 - border-top: 1px solid @border-color-split;  
82 - transform: translateY(50%); 17 + &-horizontal {
  18 + display: block;
  19 + height: 1px;
  20 + width: 100%;
  21 + margin: 24px 0;
  22 + clear: both;
83 } 23 }
84 - &:after {  
85 - content: '';  
86 - display: table-cell;  
87 - position: relative;  
88 - top: 50%;  
89 - width: 95%;  
90 - border-top: 1px solid @border-color-split;  
91 - transform: translateY(50%); 24 + &-horizontal&-with-text-center,
  25 + &-horizontal&-with-text-left,
  26 + &-horizontal&-with-text-right {
  27 + display: table;
  28 + white-space: nowrap;
  29 + text-align: center;
  30 + background: transparent;
  31 + font-weight: 500;
  32 + color: @title-color;
  33 + font-size: @font-size-large;
  34 + margin: 16px 0;
  35 + &:before,
  36 + &:after {
  37 + content: '';
  38 + display: table-cell;
  39 + position: relative;
  40 + top: 50%;
  41 + width: 50%;
  42 + border-top: 1px solid @border-color-split;
  43 + transform: translateY(50%);
  44 + }
92 } 45 }
93 - &-inner-text {  
94 - display: inline-block;  
95 - padding: 0 10px;  
96 - }  
97 - }  
98 46
99 - &-horizontal&-with-text-right {  
100 - display: table;  
101 - white-space: nowrap;  
102 - text-align: center;  
103 - background: transparent;  
104 - font-weight: 500;  
105 - color: @heading-color;  
106 - font-size: @font-size-base;  
107 - margin: 16px 0; 47 + &-horizontal&-with-text-left,
  48 + &-horizontal&-with-text-right {
  49 + font-size: @font-size-base;
  50 + .@{divider-prefix-cls}-inner-text {
  51 + display: inline-block;
  52 + padding: 0 10px;
  53 + }
  54 + }
108 55
109 - &:before {  
110 - content: '';  
111 - display: table-cell;  
112 - position: relative;  
113 - top: 50%;  
114 - width: 95%;  
115 - border-top: 1px solid @border-color-split;  
116 - transform: translateY(50%); 56 + &-horizontal&-with-text-left {
  57 + &:before {
  58 + top: 50%;
  59 + width: 5%;
  60 + }
  61 + &:after {
  62 + top: 50%;
  63 + width: 95%;
  64 + }
117 } 65 }
118 - &:after {  
119 - content: '';  
120 - display: table-cell;  
121 - position: relative;  
122 - top: 50%;  
123 - width: 5%;  
124 - border-top: 1px solid @border-color-split;  
125 - transform: translateY(50%); 66 +
  67 + &-horizontal&-with-text-right {
  68 + &:before {
  69 + top: 50%;
  70 + width: 95%;
  71 + }
  72 + &:after {
  73 + top: 50%;
  74 + width: 5%;
  75 + }
126 } 76 }
  77 +
127 &-inner-text { 78 &-inner-text {
128 - display: inline-block;  
129 - padding: 0 10px; 79 + display: inline-block;
  80 + padding: 0 24px;
  81 + }
  82 +
  83 + &-dashed {
  84 + background: none;
  85 + border-top: 1px dashed @border-color-split;
130 } 86 }
131 - }  
132 - &-dashed {  
133 - background: none;  
134 - border-top: 1px dashed @border-color-split;  
135 - }  
136 - &-horizontal&-with-text&-dashed {  
137 - border-top: 0;  
138 - &:before,  
139 - &:after {  
140 - border-style: dashed none none; 87 + &-horizontal&-with-text&-dashed,
  88 + &-horizontal&-with-text-left&-dashed,
  89 + &-horizontal&-with-text-right&-dashed {
  90 + border-top: 0;
  91 + &:before,
  92 + &:after {
  93 + border-style: dashed none none;
  94 + }
141 } 95 }
142 - }  
143 } 96 }
144 \ No newline at end of file 97 \ No newline at end of file
src/styles/custom.less
@@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
24 @text-color : #495060; 24 @text-color : #495060;
25 @font-size-base : 14px; 25 @font-size-base : 14px;
26 @font-size-small : 12px; 26 @font-size-small : 12px;
  27 +@font-size-large : 16px;
27 @line-height-base : 1.5; 28 @line-height-base : 1.5;
28 @line-height-computed : floor((@font-size-base * @line-height-base)); 29 @line-height-computed : floor((@font-size-base * @line-height-base));
29 @border-radius-base : 6px; 30 @border-radius-base : 6px;
src/styles/mixins/common.less
@@ -25,3 +25,14 @@ @@ -25,3 +25,14 @@
25 color: @subsidiary-color; 25 color: @subsidiary-color;
26 transition: all @transition-time @ease-in-out; 26 transition: all @transition-time @ease-in-out;
27 } 27 }
  28 +
  29 +.reset-component() {
  30 + font-family: @font-family;
  31 + font-size: @font-size-base;
  32 + line-height: @line-height-base;
  33 + color: @text-color;
  34 + box-sizing: border-box;
  35 + margin: 0;
  36 + padding: 0;
  37 + list-style: none;
  38 +}
28 \ No newline at end of file 39 \ No newline at end of file