textarea.scss 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. color: $vxe-font-color;
  36. font-family: $vxe-font-family;
  37. }
  38. .vxe-textarea--autosize {
  39. display: block;
  40. position: fixed;
  41. top: 0;
  42. left: 0;
  43. width: 100%;
  44. margin: 0;
  45. padding: 0.3em 0.6em;
  46. word-wrap: break-word;
  47. white-space: pre-wrap;
  48. z-index: -1;
  49. visibility: hidden;
  50. }
  51. .vxe-textarea--count {
  52. position: absolute;
  53. bottom: 0.2em;
  54. right: 1.4em;
  55. padding-left: 0.2em;
  56. color: $vxe-textarea-count-color;
  57. background-color: $vxe-textarea-count-background-color;
  58. &.is--error {
  59. color: $vxe-textarea-count-error-color;
  60. }
  61. }
  62. .vxe-textarea,
  63. .vxe-textarea--autosize {
  64. font-size: $vxe-font-size;
  65. &.size--medium {
  66. font-size: $vxe-font-size-medium;
  67. }
  68. &.size--small {
  69. font-size: $vxe-font-size-small;
  70. }
  71. &.size--mini {
  72. font-size: $vxe-font-size-mini;
  73. }
  74. }
  75. .vxe-textarea {
  76. &:not(.is--autosize) {
  77. min-height: $vxe-input-height-default;
  78. }
  79. &.size--medium {
  80. font-size: $vxe-font-size-medium;
  81. &:not(.is--autosize) {
  82. min-height: $vxe-input-height-medium;
  83. }
  84. }
  85. &.size--small {
  86. &:not(.is--autosize) {
  87. min-height: $vxe-input-height-small;
  88. }
  89. }
  90. &.size--mini {
  91. &:not(.is--autosize) {
  92. min-height: $vxe-input-height-mini;
  93. }
  94. }
  95. }