|
8 | 8 | @alert-close-color: @text-color-secondary;
|
9 | 9 | @alert-close-hover-color: @icon-color-hover;
|
10 | 10 |
|
| 11 | +@alert-with-description-icon-size: 24px; |
| 12 | +@alert-with-description-no-icon-padding-vertical: @padding-md - 1px; |
| 13 | +@alert-with-description-padding-vertical: @padding-md - 1px; |
| 14 | +@alert-with-description-padding: @alert-with-description-padding-vertical 15px; |
| 15 | + |
11 | 16 | .@{alert-prefix-cls} {
|
12 | 17 | .reset-component();
|
13 | 18 |
|
14 | 19 | position: relative;
|
15 |
| - padding: 8px 15px 8px 37px; |
| 20 | + display: flex; |
| 21 | + align-items: center; |
| 22 | + padding: 8px 15px; |
16 | 23 | word-wrap: break-word;
|
17 | 24 | border-radius: @border-radius-base;
|
18 | 25 |
|
19 |
| - &&-no-icon { |
20 |
| - padding: 8px 15px; |
21 |
| - } |
22 |
| - |
23 |
| - &&-closable { |
24 |
| - padding-right: 30px; |
| 26 | + &-content { |
| 27 | + flex: 1; |
| 28 | + min-width: 0; |
25 | 29 | }
|
26 | 30 |
|
27 | 31 | &-icon {
|
28 |
| - position: absolute; |
29 |
| - top: 8px + (@font-size-base * @line-height-base / 2) - (@font-size-base / 2); |
30 |
| - left: 16px; |
| 32 | + margin-right: @margin-xs; |
31 | 33 | }
|
32 | 34 |
|
33 | 35 | &-description {
|
34 | 36 | display: none;
|
35 | 37 | font-size: @font-size-base;
|
36 |
| - line-height: 22px; |
| 38 | + line-height: @font-size-base + 8px; |
37 | 39 | }
|
38 | 40 |
|
39 | 41 | &-success {
|
|
69 | 71 | }
|
70 | 72 |
|
71 | 73 | &-close-icon {
|
72 |
| - position: absolute; |
73 |
| - top: 8px; |
74 |
| - right: 16px; |
| 74 | + margin-left: @margin-xs; |
75 | 75 | padding: 0;
|
76 | 76 | overflow: hidden;
|
77 | 77 | font-size: @font-size-sm;
|
78 |
| - line-height: 22px; |
| 78 | + line-height: @font-size-sm; |
79 | 79 | background-color: transparent;
|
80 | 80 | border: none;
|
81 | 81 | outline: none;
|
|
99 | 99 | }
|
100 | 100 |
|
101 | 101 | &-with-description {
|
102 |
| - position: relative; |
103 |
| - padding: 15px 15px 15px 64px; |
104 |
| - color: @alert-text-color; |
105 |
| - line-height: @line-height-base; |
106 |
| - border-radius: @border-radius-base; |
| 102 | + align-items: flex-start; |
| 103 | + padding: @alert-with-description-padding; |
107 | 104 | }
|
108 | 105 |
|
109 | 106 | &-with-description&-no-icon {
|
110 |
| - padding: 15px; |
| 107 | + padding: @alert-with-description-no-icon-padding-vertical 15px; |
111 | 108 | }
|
112 | 109 |
|
113 | 110 | &-with-description &-icon {
|
114 |
| - position: absolute; |
115 |
| - top: 16px; |
116 |
| - left: 24px; |
117 |
| - font-size: 24px; |
118 |
| - } |
119 |
| - |
120 |
| - &-with-description &-close-icon { |
121 |
| - position: absolute; |
122 |
| - top: 16px; |
123 |
| - right: 16px; |
124 |
| - font-size: @font-size-base; |
125 |
| - cursor: pointer; |
| 111 | + margin-right: @alert-with-description-padding-vertical; |
| 112 | + font-size: @alert-with-description-icon-size; |
126 | 113 | }
|
127 | 114 |
|
128 | 115 | &-with-description &-message {
|
|
0 commit comments