8
0

inputtext.css 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. @import "../../../mixins/_rounded.css";
  6. @import "../../../mixins/_focus.css";
  7. @import "../../../mixins/_shadow.css";
  8. :root {
  9. --ck-input-text-width: 18em;
  10. }
  11. .ck.ck-input-text {
  12. @mixin ck-rounded-corners;
  13. @mixin ck-box-shadow var(--ck-inner-shadow);
  14. background: var(--ck-color-input-background);
  15. border: 1px solid var(--ck-color-input-border);
  16. padding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);
  17. min-width: var(--ck-input-text-width);
  18. /* This is important to stay of the same height as surrounding buttons */
  19. min-height: var(--ck-ui-component-min-height);
  20. /* Apply some smooth transition to the box-shadow and border. */
  21. transition-property: box-shadow, border;
  22. transition: .2s ease-in-out;
  23. &:focus {
  24. @mixin ck-focus-ring;
  25. @mixin ck-box-shadow var(--ck-focus-outer-shadow), var(--ck-inner-shadow);
  26. }
  27. &[readonly] {
  28. border: 1px solid var(--ck-color-input-disabled-border);
  29. background: var(--ck-color-input-disabled-background);
  30. color: var(--ck-color-input-disabled-text);
  31. &:focus {
  32. /* The read-only input should have a slightly less visible shadow when focused. */
  33. @mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow), var(--ck-inner-shadow);
  34. }
  35. }
  36. &.ck-error {
  37. border-color: var(--ck-color-input-error-border);
  38. animation: ck-text-input-shake .3s ease both;
  39. &:focus {
  40. @mixin ck-box-shadow var(--ck-focus-error-outer-shadow), var(--ck-inner-shadow);
  41. }
  42. }
  43. }
  44. @keyframes ck-text-input-shake {
  45. 20% {
  46. transform: translateX(-2px);
  47. }
  48. 40% {
  49. transform: translateX(2px);
  50. }
  51. 60% {
  52. transform: translateX(-1px);
  53. }
  54. 80% {
  55. transform: translateX(1px);
  56. }
  57. }