|
16 | 16 | border: 1px solid @oui-textarea-border-color; |
17 | 17 |
|
18 | 18 | &__textarea { |
| 19 | + #oui > .animate(); |
| 20 | + |
19 | 21 | display: block; |
20 | 22 | width: 100%; |
21 | 23 | resize: none; |
|
52 | 54 |
|
53 | 55 | // Set this state when element is focused. |
54 | 56 | &_active { |
55 | | - border-color: @oui-textarea-border-color-focus; |
56 | | - background-color: @oui-textarea-background-color-focus; |
57 | | - box-shadow: @oui-textarea-shadow-focus; |
58 | | - } |
59 | | - |
60 | | - &_error { |
61 | | - border-color: @oui-textarea-border-color-error; |
62 | | - background-color: @oui-textarea-background-color-error; |
63 | | - box-shadow: none; |
64 | | - |
65 | | - .@{selector}__footer { |
66 | | - border-color: @oui-textarea-border-color-error; |
67 | | - color: @oui-textarea-footer-error-color; |
68 | | - } |
| 57 | + .textarea-focus-style(); |
69 | 58 | } |
70 | 59 |
|
71 | 60 | &_disabled { |
|
87 | 76 | } |
88 | 77 | } |
89 | 78 |
|
90 | | - .textarea-legacy-base() { |
91 | | - #oui > .input-base(); |
| 79 | + .textarea-error( |
| 80 | + @selector |
| 81 | + ) { |
| 82 | + &_error { |
| 83 | + .textarea-error-style(@selector); |
| 84 | + } |
| 85 | + } |
92 | 86 |
|
| 87 | + .textarea-focus-style() { |
| 88 | + #oui > .animate(); |
| 89 | + |
| 90 | + border-color: @oui-textarea-border-color-focus; |
| 91 | + outline: none; |
| 92 | + background-color: @oui-textarea-background-color-focus; |
| 93 | + box-shadow: @oui-textarea-shadow-focus; |
| 94 | + } |
| 95 | + |
| 96 | + .textarea-error-style( |
| 97 | + @selector |
| 98 | + ) { |
| 99 | + border-color: @oui-textarea-border-color-error; |
| 100 | + background-color: @oui-textarea-background-color-error; |
| 101 | + box-shadow: none; |
| 102 | + |
| 103 | + .@{selector}__footer { |
| 104 | + border-color: @oui-textarea-border-color-error; |
| 105 | + color: @oui-textarea-footer-error-color; |
| 106 | + } |
| 107 | + } |
| 108 | + |
| 109 | + .textarea-legacy-base() { |
93 | 110 | padding: @oui-textarea-field-padding; |
94 | 111 | font-size: @oui-textarea-font-size; |
95 | 112 | line-height: @oui-textarea-line-height; |
96 | 113 | font-weight: @oui-textarea-font-weight; |
97 | 114 | color: @oui-textarea-color; |
| 115 | + |
| 116 | + &::selection { |
| 117 | + background: @oui-textarea-selection-background-color; |
| 118 | + color: @oui-textarea-selection-font-color; |
| 119 | + } |
| 120 | + |
| 121 | + &::-moz-selection { |
| 122 | + background: @oui-textarea-selection-background-color; |
| 123 | + color: @oui-textarea-selection-font-color; |
| 124 | + } |
| 125 | + |
| 126 | + &:focus { |
| 127 | + .textarea-focus-style(); |
| 128 | + } |
98 | 129 | } |
99 | 130 |
|
100 | | - .textarea-legacy-status() { |
101 | | - #oui > .input-status(); |
| 131 | + .textarea-legacy-error() { |
| 132 | + &:not(:disabled), |
| 133 | + &:not(:disabled):hover, |
| 134 | + &:not(:disabled):active, |
| 135 | + &:not(:disabled):focus { |
| 136 | + border-color: @oui-textarea-border-color-error; |
| 137 | + background-color: @oui-textarea-background-color-error; |
| 138 | + box-shadow: none; |
| 139 | + } |
| 140 | + |
| 141 | + &:not(:disabled):focus { |
| 142 | + box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.35); |
| 143 | + } |
| 144 | + |
| 145 | + &::selection { |
| 146 | + background: @oui-textarea-selection-background-color-error; |
| 147 | + color: #fff; |
| 148 | + } |
| 149 | + |
| 150 | + &::-moz-selection { |
| 151 | + background: @oui-textarea-selection-background-color-error; |
| 152 | + color: #fff; |
| 153 | + } |
102 | 154 | } |
103 | 155 |
|
104 | 156 | .textarea-legacy-inline() { |
|
0 commit comments