textarea.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**Variable**/
  2. .vxe-textarea {
  3. position: relative;
  4. display: inline-block;
  5. &:not(.def--cols) {
  6. width: 100%;
  7. .vxe-textarea--inner {
  8. width: 100%;
  9. }
  10. }
  11. }
  12. .vxe-textarea--inner {
  13. border-radius: $vxe-border-radius;
  14. outline: 0;
  15. font-size: inherit;
  16. padding: 0 0.6em;
  17. color: $vxe-font-color;
  18. line-height: inherit;
  19. border: 1px solid $vxe-input-border-color;
  20. background-color: $vxe-textarea-background-color;
  21. display: block;
  22. padding: 0.3em 0.6em;
  23. &::placeholder {
  24. color: $vxe-input-placeholder-color;
  25. }
  26. &:focus {
  27. border: 1px solid $vxe-primary-color;
  28. }
  29. &[disabled] {
  30. cursor: not-allowed;
  31. background-color: $vxe-input-disabled-background-color;
  32. }
  33. }
  34. .vxe-textarea--inner,
  35. .vxe-textarea--autosize {
  36. line-height: $vxe-textarea-line-height;
  37. color: $vxe-font-color;
  38. font-family: $vxe-font-family;
  39. }
  40. .vxe-textarea--autosize {
  41. display: block;
  42. position: fixed;
  43. top: 0;
  44. left: 0;
  45. width: 100%;
  46. margin: 0;
  47. padding: 0.3em 0.6em;
  48. word-wrap: break-word;
  49. white-space: pre-wrap;
  50. z-index: -1;
  51. visibility: hidden;
  52. }
  53. .vxe-textarea--count {
  54. position: absolute;
  55. bottom: 0.2em;
  56. right: 1.4em;
  57. padding-left: 0.2em;
  58. color: $vxe-textarea-count-color;
  59. background-color: $vxe-textarea-count-background-color;
  60. &.is--error {
  61. color: $vxe-textarea-count-error-color;
  62. }
  63. }
  64. .vxe-textarea,
  65. .vxe-textarea--autosize {
  66. font-size: $vxe-font-size;
  67. &.size--medium {
  68. font-size: $vxe-font-size-medium;
  69. }
  70. &.size--small {
  71. font-size: $vxe-font-size-small;
  72. }
  73. &.size--mini {
  74. font-size: $vxe-font-size-mini;
  75. }
  76. }
  77. .vxe-textarea {
  78. &:not(.is--autosize) {
  79. min-height: $vxe-input-height-default;
  80. }
  81. &.size--medium {
  82. font-size: $vxe-font-size-medium;
  83. &:not(.is--autosize) {
  84. min-height: $vxe-input-height-medium;
  85. }
  86. }
  87. &.size--small {
  88. &:not(.is--autosize) {
  89. min-height: $vxe-input-height-small;
  90. }
  91. }
  92. &.size--mini {
  93. &:not(.is--autosize) {
  94. min-height: $vxe-input-height-mini;
  95. }
  96. }
  97. }