skeleton.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. @import "./animation.scss";
  2. @import './variables.scss';
  3. $module: #{$prefix}-skeleton;
  4. .#{$module} {
  5. &-avatar,
  6. &-image,
  7. &-title,
  8. &-button {
  9. background: $color-skeleton_default-bg-default;
  10. border-radius: $radius-skeleton_item;
  11. }
  12. &-avatar {
  13. &-circle {
  14. border-radius: 50%;
  15. }
  16. &-extra-extra-small {
  17. width: $width-skeleton_avatar_extra_extra_small;
  18. height: $width-skeleton_avatar_extra_extra_small;
  19. }
  20. &-extra-small {
  21. width: $width-skeleton_avatar_extra_small;
  22. height: $width-skeleton_avatar_extra_small;
  23. }
  24. &-medium {
  25. width: $width-skeleton_avatar_medium;
  26. height: $width-skeleton_avatar_medium;
  27. }
  28. &-small {
  29. width: $width-skeleton_avatar_small;
  30. height: $width-skeleton_avatar_small;
  31. }
  32. &-large {
  33. width: $width-skeleton_avatar_large;
  34. height: $width-skeleton_avatar_large;
  35. }
  36. &-extra-large {
  37. width: $width-skeleton_avatar_extra_large;
  38. height: $width-skeleton_avatar_extra_large;
  39. }
  40. }
  41. &-paragraph {
  42. margin: $spacing-none;
  43. padding: $spacing-none;
  44. list-style-type: none;
  45. li {
  46. background: $color-skeleton_default-bg-default;
  47. border-radius: $radius-skeleton_li;
  48. width: 100%;
  49. height: $height-skeleton_li;
  50. margin-bottom: $spacing-skeleton_li-marginBottom;
  51. &:last-child {
  52. width: 60%;
  53. margin-bottom: $spacing-none;
  54. }
  55. &:first-child {
  56. width: 100%;
  57. }
  58. }
  59. }
  60. &-title {
  61. width: 100%;
  62. height: $height-skeleton_title;
  63. }
  64. &-button {
  65. width: $width-skeleton_button;
  66. height: $height-skeleton_button;
  67. }
  68. &-image {
  69. width: 100%;
  70. height: 100%;
  71. }
  72. &-active {
  73. .#{$module}-avatar,
  74. .#{$module}-image,
  75. .#{$module}-title,
  76. .#{$module}-button,
  77. .#{$module}-paragraph li {
  78. background: linear-gradient(
  79. 90deg,
  80. $color-skeleton_default-bg-default 25%,
  81. $color-skeleton_loading-gradient-bg-active 44%,
  82. $color-skeleton_default-bg-default 88%
  83. );
  84. background-size: 400% 100%;
  85. animation: $animation_duration-skeleton-highlight skeleton-loading $animation_function-skeleton-highlight infinite;
  86. }
  87. }
  88. @keyframes skeleton-loading {
  89. 0% {
  90. background-position: 100% 50%;
  91. }
  92. 100% {
  93. background-position: 0 50%;
  94. }
  95. }
  96. }
  97. @import './rtl.scss';