_theme-squares.scss 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* ------------------------------------------------------------------------------
  2. *
  3. * # Pace. Squares theme
  4. *
  5. * Squares css spinner theme for Pace.
  6. *
  7. * ---------------------------------------------------------------------------- */
  8. // Check if component is enabled
  9. @if $enable-pace {
  10. // Define variables
  11. $pace-show-text: true;
  12. $pace-overlay-color: $color-slate-900;
  13. $pace-loader-color: $white;
  14. $pace-loader-size: 1.875rem;
  15. $pace-loader-border-width: 0.125rem;
  16. $pace-loader-border-spacer: ($pace-loader-border-width + 0.5rem);
  17. // Pace theme styles
  18. // ------------------------------
  19. // Overlay
  20. .pace-running {
  21. position: fixed;
  22. top: 0;
  23. left: 0;
  24. width: 100%;
  25. height: 100%;
  26. background-color: $pace-overlay-color;
  27. // Hide all content
  28. > *:not(.pace) {
  29. opacity: 0;
  30. }
  31. }
  32. // Base
  33. .pace {
  34. position: fixed;
  35. top: 50%;
  36. left: 0;
  37. right: 0;
  38. margin-top: -($pace-loader-size / 2);
  39. z-index: 9999;
  40. user-select: none;
  41. pointer-events: none;
  42. // Change colors on light/dark backgrounds
  43. @if (lightness($pace-overlay-color) < 75) {
  44. color: $white;
  45. }
  46. }
  47. // Progress
  48. .pace-progress {
  49. width: 100% !important;
  50. }
  51. // Activity
  52. .pace-activity {
  53. // Squares
  54. &:before,
  55. &:after {
  56. position: absolute;
  57. top: 0;
  58. left: 0;
  59. right: 0;
  60. margin: auto;
  61. content: "";
  62. border: $pace-loader-border-width solid $pace-loader-color;
  63. }
  64. // Big
  65. &:before {
  66. animation: rotation_reverse 2s linear infinite;
  67. @include size($pace-loader-size);
  68. }
  69. // Small
  70. &:after {
  71. top: ($pace-loader-border-spacer / 2);
  72. animation: rotation 2s linear infinite;
  73. @include size($pace-loader-size - $pace-loader-border-spacer);
  74. }
  75. }
  76. // Hide inactive
  77. .pace-inactive {
  78. display: none;
  79. }
  80. // Progress text
  81. @if $pace-show-text {
  82. .pace-progress:after {
  83. content: attr(data-progress-text);
  84. text-align: center;
  85. width: 100%;
  86. display: inline-block;
  87. white-space: nowrap;
  88. margin-top: $pace-loader-size + ($spacer / 1.5);
  89. }
  90. }
  91. }