_small-box.scss 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. //
  2. // Component: Small Box
  3. //
  4. .small-box {
  5. @include border-radius($border-radius);
  6. @include box-shadow($card-shadow);
  7. display: block;
  8. margin-bottom: 20px;
  9. position: relative;
  10. // content wrapper
  11. > .inner {
  12. padding: 10px;
  13. }
  14. > .small-box-footer {
  15. background-color: rgba($black, .1);
  16. color: rgba($white, .8);
  17. display: block;
  18. padding: 3px 0;
  19. position: relative;
  20. text-align: center;
  21. text-decoration: none;
  22. z-index: 10;
  23. &:hover {
  24. background-color: rgba($black, .15);
  25. color: $white;
  26. }
  27. }
  28. h3 {
  29. @include font-size(2.2rem);
  30. font-weight: 700;
  31. margin: 0 0 10px;
  32. padding: 0;
  33. white-space: nowrap;
  34. }
  35. @include media-breakpoint-up(lg) {
  36. .col-xl-2 &,
  37. .col-lg-2 &,
  38. .col-md-2 & {
  39. h3 {
  40. @include font-size(1.6rem);
  41. }
  42. }
  43. .col-xl-3 &,
  44. .col-lg-3 &,
  45. .col-md-3 & {
  46. h3 {
  47. @include font-size(1.6rem);
  48. }
  49. }
  50. }
  51. @include media-breakpoint-up(xl) {
  52. .col-xl-2 &,
  53. .col-lg-2 &,
  54. .col-md-2 & {
  55. h3 {
  56. @include font-size(2.2rem);
  57. }
  58. }
  59. .col-xl-3 &,
  60. .col-lg-3 &,
  61. .col-md-3 & {
  62. h3 {
  63. @include font-size(2.2rem);
  64. }
  65. }
  66. }
  67. p {
  68. font-size: 1rem;
  69. > small {
  70. color: $gray-100;
  71. display: block;
  72. font-size: .9rem;
  73. margin-top: 5px;
  74. }
  75. }
  76. h3,
  77. p {
  78. z-index: 5;
  79. }
  80. // the icon
  81. .icon {
  82. color: rgba($black, .15);
  83. z-index: 0;
  84. > i {
  85. font-size: 90px;
  86. position: absolute;
  87. right: 15px;
  88. top: 15px;
  89. transition: transform $transition-speed linear;
  90. &.fa,
  91. &.fas,
  92. &.far,
  93. &.fab,
  94. &.fal,
  95. &.fad,
  96. &.ion {
  97. font-size: 70px;
  98. top: 20px;
  99. }
  100. }
  101. svg {
  102. font-size: 70px;
  103. position: absolute;
  104. right: 15px;
  105. top: 15px;
  106. transition: transform $transition-speed linear;
  107. }
  108. }
  109. // Small box hover state
  110. &:hover {
  111. text-decoration: none;
  112. // Animate icons on small box hover
  113. .icon {
  114. > i {
  115. &,
  116. &.fa,
  117. &.fas,
  118. &.far,
  119. &.fab,
  120. &.fal,
  121. &.fad,
  122. &.ion {
  123. transform: scale(1.1);
  124. }
  125. }
  126. > svg {
  127. transform: scale(1.1);
  128. }
  129. }
  130. }
  131. }
  132. @include media-breakpoint-down(sm) {
  133. // No need for icons on very small devices
  134. .small-box {
  135. text-align: center;
  136. .icon {
  137. display: none;
  138. }
  139. p {
  140. font-size: 12px;
  141. }
  142. }
  143. }