skeleton-item.scss 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. @use 'mixins/mixins' as *;
  2. @use 'common/var' as *;
  3. @include b(skeleton) {
  4. @include css-var-from-global(('skeleton', 'circle-size'), ('avatar', 'size'));
  5. }
  6. @mixin circle-size($size) {
  7. width: $size;
  8. height: $size;
  9. line-height: $size;
  10. }
  11. @include b(skeleton) {
  12. @include e(item) {
  13. background: getCssVar('skeleton-color');
  14. display: inline-block;
  15. height: 16px;
  16. border-radius: getCssVar('border-radius-base');
  17. width: 100%;
  18. }
  19. @include e(circle) {
  20. border-radius: 50%;
  21. width: getCssVar('skeleton-circle-size');
  22. height: getCssVar('skeleton-circle-size');
  23. line-height: getCssVar('skeleton-circle-size');
  24. }
  25. @include e(button) {
  26. height: 40px;
  27. width: 64px;
  28. border-radius: 4px;
  29. }
  30. @include e(p) {
  31. width: 100%;
  32. @include when(last) {
  33. width: 61%;
  34. }
  35. @include when(first) {
  36. width: 33%;
  37. }
  38. }
  39. @include e(text) {
  40. width: 100%;
  41. height: getCssVar('font-size-small');
  42. }
  43. @include e(caption) {
  44. height: getCssVar('font-size-extra-small');
  45. }
  46. @include e(h1) {
  47. height: getCssVar('font-size-extra-large');
  48. }
  49. @include e(h3) {
  50. height: getCssVar('font-size-large');
  51. }
  52. @include e(h5) {
  53. height: getCssVar('font-size-medium');
  54. }
  55. @include e(image) {
  56. width: unset;
  57. display: flex;
  58. align-items: center;
  59. justify-content: center;
  60. border-radius: 0;
  61. svg {
  62. color: getCssVar('svg-monochrome-grey');
  63. fill: currentColor;
  64. width: 22%;
  65. height: 22%;
  66. }
  67. }
  68. }