_datepicker-legacy-compat.scss 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. @use '../button/button-theme';
  2. @use '../button/icon-button-theme';
  3. @mixin legacy-button-compat-theme($theme) {
  4. .mat-datepicker-content {
  5. @include button-theme.theme($theme);
  6. @include icon-button-theme.theme($theme);
  7. }
  8. }
  9. @mixin legacy-button-compat() {
  10. .mat-datepicker-toggle .mat-mdc-button-base {
  11. width: 40px;
  12. height: 40px;
  13. padding: 8px 0;
  14. }
  15. .mat-datepicker-actions {
  16. $spacing: 8px;
  17. .mat-button-base + .mat-button-base {
  18. margin-left: $spacing;
  19. [dir='rtl'] & {
  20. margin-left: 0;
  21. margin-right: $spacing;
  22. }
  23. }
  24. }
  25. }
  26. @mixin legacy-form-field-compat() {
  27. .mat-form-field {
  28. .mat-form-field-prefix,
  29. .mat-form-field-suffix {
  30. .mat-datepicker-toggle .mat-mdc-button-base {
  31. width: 40px;
  32. height: 40px;
  33. padding: 8px 0;
  34. }
  35. }
  36. .mat-datepicker-toggle .mat-mdc-icon-button .mat-icon {
  37. font-size: 1em;
  38. display: inline-block;
  39. margin: -2px 0 1px;
  40. }
  41. }
  42. .mat-form-field-type-mat-date-range-input .mat-form-field-infix {
  43. // Bump the default width slightly since it's somewhat cramped with two inputs and a separator.
  44. width: 200px;
  45. }
  46. .mat-form-field-appearance-legacy {
  47. .mat-form-field-prefix,
  48. .mat-form-field-suffix {
  49. .mat-datepicker-toggle .mat-mdc-icon-button {
  50. font-size: inherit;
  51. width: 1.5em;
  52. height: 1.5em;
  53. padding: 0;
  54. }
  55. .mat-datepicker-toggle-default-icon {
  56. width: 1em;
  57. }
  58. .mat-datepicker-toggle .mat-mdc-icon-button .mat-icon {
  59. line-height: 1.5em;
  60. margin: 0;
  61. }
  62. }
  63. }
  64. .mat-form-field {
  65. .mat-datepicker-toggle .mat-mdc-button-base {
  66. vertical-align: middle;
  67. }
  68. &:not(.mat-form-field-appearance-legacy) .mat-datepicker-toggle .mat-mdc-button-base {
  69. vertical-align: baseline;
  70. }
  71. }
  72. }