_utilities.scss 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. // ==========================================================================
  2. // UTILITIES
  3. // ==========================================================================
  4. @use 'sass:map';
  5. @use '../abstracts/variables' as v;
  6. @use '../abstracts/mixins' as mix;
  7. // Spacing utilities
  8. @each $key, $value in v.$spacers {
  9. .mt-#{$key} { margin-top: $value !important; }
  10. .mb-#{$key} { margin-bottom: $value !important; }
  11. .ml-#{$key} { margin-left: $value !important; }
  12. .mr-#{$key} { margin-right: $value !important; }
  13. .mx-#{$key} {
  14. margin-left: $value !important;
  15. margin-right: $value !important;
  16. }
  17. .my-#{$key} {
  18. margin-top: $value !important;
  19. margin-bottom: $value !important;
  20. }
  21. .m-#{$key} { margin: $value !important; }
  22. .pt-#{$key} { padding-top: $value !important; }
  23. .pb-#{$key} { padding-bottom: $value !important; }
  24. .pl-#{$key} { padding-left: $value !important; }
  25. .pr-#{$key} { padding-right: $value !important; }
  26. .px-#{$key} {
  27. padding-left: $value !important;
  28. padding-right: $value !important;
  29. }
  30. .py-#{$key} {
  31. padding-top: $value !important;
  32. padding-bottom: $value !important;
  33. }
  34. .p-#{$key} { padding: $value !important; }
  35. }
  36. // Auto margins
  37. .mx-auto {
  38. margin-left: auto !important;
  39. margin-right: auto !important;
  40. }
  41. .ml-auto { margin-left: auto !important; }
  42. .mr-auto { margin-right: auto !important; }
  43. // Display utilities (keeping only basic display, flex/grid moved to their own files)
  44. .d-none { display: none !important; }
  45. .d-inline { display: inline !important; }
  46. .d-inline-block { display: inline-block !important; }
  47. .d-block { display: block !important; }
  48. // Container classes
  49. .container {
  50. width: 100%;
  51. padding-right: map.get(v.$spacers, 2);
  52. padding-left: map.get(v.$spacers, 2);
  53. margin-right: auto;
  54. margin-left: auto;
  55. @include mix.respond-to-min('xl') {
  56. max-width: 1296px;
  57. }
  58. @include mix.respond-to-max('md') {
  59. padding-right: map.get(v.$spacers, 4);
  60. padding-left: map.get(v.$spacers, 4);
  61. }
  62. }
  63. .container-fluid {
  64. width: 100%;
  65. padding-right: map.get(v.$spacers, 3);
  66. padding-left: map.get(v.$spacers, 3);
  67. margin-right: auto;
  68. margin-left: auto;
  69. }
  70. // Position utilities
  71. .position-relative { position: relative !important; }
  72. .position-absolute { position: absolute !important; }
  73. .position-fixed { position: fixed !important; }
  74. .position-sticky { position: sticky !important; }
  75. // Position placement utilities
  76. .top-0 { top: 0 !important; }
  77. .top-50 { top: 50% !important; }
  78. .bottom-0 { bottom: 0 !important; }
  79. .left-0 { left: 0 !important; }
  80. .left-50 { left: 50% !important; }
  81. .right-0 { right: 0 !important; }
  82. // Position spacing utilities
  83. @each $key, $value in v.$spacers {
  84. .top-#{$key} { top: $value !important; }
  85. .bottom-#{$key} { bottom: $value !important; }
  86. .left-#{$key} { left: $value !important; }
  87. .right-#{$key} { right: $value !important; }
  88. }
  89. // Transform utilities
  90. .translate-center {
  91. transform: translate(-50%, -50%) !important;
  92. }
  93. .translate-x-center {
  94. transform: translateX(-50%) !important;
  95. }
  96. .translate-y-center {
  97. transform: translateY(-50%) !important;
  98. }
  99. // Common positioned links
  100. .overlay-link {
  101. position: absolute;
  102. top: 0;
  103. left: 0;
  104. width: 100%;
  105. height: 100%;
  106. z-index: 1;
  107. text-decoration: none;
  108. background-color: transparent;
  109. }
  110. // Text utilities
  111. .text-truncate {
  112. overflow: hidden !important;
  113. text-overflow: ellipsis !important;
  114. white-space: nowrap !important;
  115. }
  116. .text-center { text-align: center !important; }
  117. .text-left { text-align: left !important; }
  118. .text-right { text-align: right !important; }
  119. // Text colors
  120. .text-primary { color: v.$primary !important; }
  121. .text-white { color: v.$white !important; }
  122. .text-dark { color: v.$dark-gray !important; }
  123. .text-muted { color: v.$gray !important; }
  124. .text-accent {color: var(--color-accent) !important;}
  125. // Background utilities
  126. .bg-primary { background-color: v.$primary !important; }
  127. .bg-light { background-color: v.$light-gray !important; }
  128. .bg-white { background-color: v.$white !important; }
  129. .bg-dark { background-color: v.$primary-dark !important; }
  130. .bg-transparent { background-color: transparent !important; }
  131. .bg-gradient {
  132. background: v.$primary-gradient !important;
  133. }
  134. // Section spacing
  135. .section {
  136. padding: map.get(v.$spacers, 5) 0;
  137. }
  138. // Z-index utilities
  139. .z-high { z-index: map.get(v.$z-indices, 'modal') !important; }
  140. .z-medium { z-index: map.get(v.$z-indices, 'navbar') !important; }
  141. .z-low { z-index: map.get(v.$z-indices, 'default') !important; }
  142. // Responsive visibility utilities (basic display only)
  143. @each $breakpoint, $value in v.$breakpoints {
  144. @include mix.respond-to-min($breakpoint) {
  145. .d-#{$breakpoint}-none { display: none !important; }
  146. .d-#{$breakpoint}-block { display: block !important; }
  147. .d-#{$breakpoint}-inline { display: inline !important; }
  148. .d-#{$breakpoint}-inline-block { display: inline-block !important; }
  149. }
  150. }
  151. // Shadow utilities
  152. .shadow-sm { box-shadow: v.$box-shadow-sm !important; }
  153. .shadow { box-shadow: v.$box-shadow !important; }
  154. .shadow-lg { box-shadow: v.$box-shadow-lg !important; }
  155. .shadow-none { box-shadow: none !important; }
  156. // Border utilities
  157. .border { border: 1px solid v.$light-gray !important; }
  158. .border-top { border-top: 1px solid v.$light-gray !important; }
  159. .border-right { border-right: 1px solid v.$light-gray !important; }
  160. .border-bottom { border-bottom: 1px solid v.$light-gray !important; }
  161. .border-left { border-left: 1px solid v.$light-gray !important; }
  162. .border-0 { border: 0 !important; }
  163. // Border colors
  164. .border-primary { border-color: v.$primary !important; }
  165. .border-white { border-color: v.$white !important; }
  166. .border-dark { border-color: v.$dark-gray !important; }
  167. // Border radius utilities
  168. .rounded { border-radius: v.$border-radius !important; }
  169. .rounded-sm { border-radius: v.$border-radius-sm !important; }
  170. .rounded-lg { border-radius: v.$border-radius-lg !important; }
  171. .rounded-circle { border-radius: 50% !important; }
  172. .rounded-0 { border-radius: 0 !important; }
  173. // Width and height utilities
  174. .w-100 { width: 100% !important; }
  175. .w-75 { width: 75% !important; }
  176. .w-50 { width: 50% !important; }
  177. .w-25 { width: 25% !important; }
  178. .w-auto { width: auto !important; }
  179. .h-100 { height: 100% !important; }
  180. .h-75 { height: 75% !important; }
  181. .h-50 { height: 50% !important; }
  182. .h-25 { height: 25% !important; }
  183. .h-auto { height: auto !important; }
  184. // Overflow utilities
  185. .overflow-hidden { overflow: hidden !important; }
  186. .overflow-visible { overflow: visible !important; }
  187. .overflow-auto { overflow: auto !important; }
  188. .overflow-scroll { overflow: scroll !important; }
  189. .overflow-y { overflow: hidden !important; overflow-y: auto !important; }
  190. .overflow-x { overflow: hidden !important; overflow-x: auto !important; }
  191. // Cursor utilities
  192. .cursor-pointer { cursor: pointer !important; }
  193. .cursor-default { cursor: default !important; }
  194. .cursor-not-allowed { cursor: not-allowed !important; }
  195. // Visibility utilities
  196. .visible { visibility: visible !important; }
  197. .invisible { visibility: hidden !important; }
  198. // ===== Text Shadow Utilities =====
  199. // --- Dark Shadows (for light text on dark backgrounds) ---
  200. $dark-text-shadows: (
  201. 'default': 1px 1px 3px rgba(0, 0, 0, 0.6),
  202. 'strong': 2px 2px 8px rgba(0, 0, 0, 0.75),
  203. 'intense': 4px 4px 12px rgba(0, 0, 0, 0.8),
  204. // CORREGIDO: Valor envuelto en paréntesis para tratarlo como una sola lista.
  205. 'epic': (0 4px 10px rgba(0,0,0,0.6), 0 8px 25px rgba(0,0,0,0.8)),
  206. 'glow': 0 0 15px rgba(0, 0, 0, 0.9),
  207. 'hard': 3px 3px 0px #1a1a1a
  208. );
  209. // Generate base .text-shadow class
  210. .text-shadow {
  211. text-shadow: map.get($dark-text-shadows, 'default');
  212. }
  213. // Generate all dark shadow modifier classes
  214. @each $name, $value in $dark-text-shadows {
  215. @if $name != 'default' {
  216. .text-shadow--#{$name} {
  217. text-shadow: $value;
  218. }
  219. }
  220. }
  221. // --- Light Effects & White Shadows (for dark text on light backgrounds) ---
  222. $soft-light-text-effects: (
  223. // Softer glow with less blur and opacity.
  224. 'glow': 0 0 6px rgba(255, 255, 255, 0.6),
  225. // A very delicate letterpress effect, almost imperceptible.
  226. 'letterpress': (0 1px 0px rgba(255,255,255,0.4), 0 1px 1px rgba(0,0,0,0.15)),
  227. // A much softer engraved look with less depth.
  228. 'engraved': (1px 1px 1px rgba(0,0,0,0.15), -1px -1px 1px rgba(255,255,255,0.5)),
  229. // A very gentle highlight, like a faint sheen of light.
  230. 'highlight': 0 1px 3px rgba(255, 255, 255, 0.3),
  231. // Softer glow with less blur and opacity.
  232. 'white': 0 0 1px rgb(126, 123, 123),
  233. );
  234. // Generate all light effect classes
  235. @each $name, $value in $soft-light-text-effects {
  236. .text-shadowl--#{$name} {
  237. text-shadow: $value;
  238. }
  239. }