descriptions.scss 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. @use 'sass:map';
  2. @use 'mixins/mixins' as *;
  3. @use 'mixins/var' as *;
  4. @use 'common/var' as *;
  5. $descriptions-header-margin-bottom: () !default;
  6. $descriptions-header-margin-bottom: map.merge(
  7. (
  8. 'large': 20px,
  9. 'default': 16px,
  10. 'small': 12px,
  11. ),
  12. $descriptions-header-margin-bottom
  13. );
  14. $descriptions-title-font-size: () !default;
  15. $descriptions-title-font-size: map.merge(
  16. (
  17. 'large': 16px,
  18. 'default': 16px,
  19. 'small': 14px,
  20. ),
  21. $descriptions-title-font-size
  22. );
  23. $descriptions-cell-padding-bottom: () !default;
  24. $descriptions-cell-padding-bottom: map.merge(
  25. (
  26. 'large': 16px,
  27. 'default': 12px,
  28. 'small': 8px,
  29. ),
  30. $descriptions-cell-padding-bottom
  31. );
  32. $descriptions-bordered-cell-padding: () !default;
  33. $descriptions-bordered-cell-padding: map.merge(
  34. (
  35. 'large': 12px 15px,
  36. 'default': 8px 11px,
  37. 'small': 4px 7px,
  38. ),
  39. $descriptions-bordered-cell-padding
  40. );
  41. $descriptions-cell-font-size: () !default;
  42. $descriptions-cell-font-size: map.merge(
  43. (
  44. 'large': 14px,
  45. 'default': 14px,
  46. 'small': 12px,
  47. ),
  48. $descriptions-cell-font-size
  49. );
  50. @include b(descriptions) {
  51. @include set-component-css-var('descriptions', $descriptions);
  52. box-sizing: border-box;
  53. font-size: getCssVar('font-size', 'base');
  54. color: getCssVar('text-color', 'primary');
  55. @include e(header) {
  56. display: flex;
  57. justify-content: space-between;
  58. align-items: center;
  59. margin-bottom: map.get($descriptions-header-margin-bottom, 'default');
  60. @include e(title) {
  61. color: getCssVar('text-color', 'primary');
  62. font-size: map.get($descriptions-title-font-size, 'default');
  63. font-weight: bold;
  64. }
  65. }
  66. @include e(body) {
  67. background-color: getCssVar('fill-color', 'blank');
  68. .#{$namespace}-descriptions__table {
  69. border-collapse: collapse;
  70. width: 100%;
  71. .#{$namespace}-descriptions__cell {
  72. box-sizing: border-box;
  73. text-align: left;
  74. font-weight: normal;
  75. line-height: 23px;
  76. font-size: map.get($descriptions-cell-font-size, 'default');
  77. @include when(left) {
  78. text-align: left;
  79. }
  80. @include when(center) {
  81. text-align: center;
  82. }
  83. @include when(right) {
  84. text-align: right;
  85. }
  86. }
  87. &.is-bordered {
  88. .#{$namespace}-descriptions__cell {
  89. border: getCssVar('descriptions-table-border');
  90. padding: map.get($descriptions-bordered-cell-padding, 'default');
  91. }
  92. }
  93. &:not(.is-bordered) {
  94. .#{$namespace}-descriptions__cell {
  95. padding-bottom: map.get($descriptions-cell-padding-bottom, 'default');
  96. }
  97. }
  98. }
  99. }
  100. @each $size in (large, small) {
  101. @include m($size) {
  102. font-size: map.get($input-font-size, $size);
  103. @include e(header) {
  104. margin-bottom: map.get($descriptions-header-margin-bottom, $size);
  105. @include e(title) {
  106. font-size: map.get($descriptions-title-font-size, $size);
  107. }
  108. }
  109. @include e(body) {
  110. .#{$namespace}-descriptions__table {
  111. .#{$namespace}-descriptions__cell {
  112. font-size: map.get($descriptions-cell-font-size, $size);
  113. }
  114. &.is-bordered {
  115. .#{$namespace}-descriptions__cell {
  116. padding: map.get($descriptions-bordered-cell-padding, $size);
  117. }
  118. }
  119. &:not(.is-bordered) {
  120. .#{$namespace}-descriptions__cell {
  121. padding-bottom: map.get($descriptions-cell-padding-bottom, $size);
  122. }
  123. }
  124. }
  125. }
  126. }
  127. }
  128. }