textarea.scss 2.0 KB

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