_utilities.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. // stylelint-disable indentation
  2. // Utilities
  3. $utilities: () !default;
  4. // stylelint-disable-next-line scss/dollar-variable-default
  5. $utilities: map-merge(
  6. (
  7. // scss-docs-start utils-vertical-align
  8. "align": (
  9. property: vertical-align,
  10. class: align,
  11. values: baseline top middle bottom text-bottom text-top
  12. ),
  13. // scss-docs-end utils-vertical-align
  14. // scss-docs-start utils-float
  15. "float": (
  16. responsive: true,
  17. property: float,
  18. values: (
  19. start: left,
  20. end: right,
  21. none: none,
  22. )
  23. ),
  24. // scss-docs-end utils-float
  25. // scss-docs-start utils-overflow
  26. "overflow": (
  27. property: overflow,
  28. values: auto hidden visible scroll,
  29. ),
  30. // scss-docs-end utils-overflow
  31. // scss-docs-start utils-display
  32. "display": (
  33. responsive: true,
  34. print: true,
  35. property: display,
  36. class: d,
  37. values: inline inline-block block grid table table-row table-cell flex inline-flex none
  38. ),
  39. // scss-docs-end utils-display
  40. // scss-docs-start utils-shadow
  41. "shadow": (
  42. property: box-shadow,
  43. class: shadow,
  44. values: (
  45. null: $box-shadow,
  46. sm: $box-shadow-sm,
  47. lg: $box-shadow-lg,
  48. none: none,
  49. )
  50. ),
  51. // scss-docs-end utils-shadow
  52. // scss-docs-start utils-position
  53. "position": (
  54. property: position,
  55. values: static relative absolute fixed sticky
  56. ),
  57. "top": (
  58. property: top,
  59. values: $position-values
  60. ),
  61. "bottom": (
  62. property: bottom,
  63. values: $position-values
  64. ),
  65. "start": (
  66. property: left,
  67. class: start,
  68. values: $position-values
  69. ),
  70. "end": (
  71. property: right,
  72. class: end,
  73. values: $position-values
  74. ),
  75. "translate-middle": (
  76. property: transform,
  77. class: translate-middle,
  78. values: (
  79. null: translate(-50%, -50%),
  80. x: translateX(-50%),
  81. y: translateY(-50%),
  82. )
  83. ),
  84. // scss-docs-end utils-position
  85. // scss-docs-start utils-borders
  86. "border": (
  87. property: border,
  88. values: (
  89. null: $border-width solid $border-color,
  90. 0: 0,
  91. )
  92. ),
  93. "border-top": (
  94. property: border-top,
  95. values: (
  96. null: $border-width solid $border-color,
  97. 0: 0,
  98. )
  99. ),
  100. "border-end": (
  101. property: border-right,
  102. class: border-end,
  103. values: (
  104. null: $border-width solid $border-color,
  105. 0: 0,
  106. )
  107. ),
  108. "border-bottom": (
  109. property: border-bottom,
  110. values: (
  111. null: $border-width solid $border-color,
  112. 0: 0,
  113. )
  114. ),
  115. "border-start": (
  116. property: border-left,
  117. class: border-start,
  118. values: (
  119. null: $border-width solid $border-color,
  120. 0: 0,
  121. )
  122. ),
  123. "border-color": (
  124. property: border-color,
  125. class: border,
  126. values: map-merge($theme-colors, ("white": $white))
  127. ),
  128. "border-width": (
  129. property: border-width,
  130. class: border,
  131. values: $border-widths
  132. ),
  133. // scss-docs-end utils-borders
  134. // Sizing utilities
  135. // scss-docs-start utils-sizing
  136. "width": (
  137. property: width,
  138. class: w,
  139. values: (
  140. 25: 25%,
  141. 50: 50%,
  142. 75: 75%,
  143. 100: 100%,
  144. auto: auto
  145. )
  146. ),
  147. "max-width": (
  148. property: max-width,
  149. class: mw,
  150. values: (100: 100%)
  151. ),
  152. "viewport-width": (
  153. property: width,
  154. class: vw,
  155. values: (100: 100vw)
  156. ),
  157. "min-viewport-width": (
  158. property: min-width,
  159. class: min-vw,
  160. values: (100: 100vw)
  161. ),
  162. "height": (
  163. property: height,
  164. class: h,
  165. values: (
  166. 25: 25%,
  167. 50: 50%,
  168. 75: 75%,
  169. 100: 100%,
  170. auto: auto
  171. )
  172. ),
  173. "max-height": (
  174. property: max-height,
  175. class: mh,
  176. values: (100: 100%)
  177. ),
  178. "viewport-height": (
  179. property: height,
  180. class: vh,
  181. values: (100: 100vh)
  182. ),
  183. "min-viewport-height": (
  184. property: min-height,
  185. class: min-vh,
  186. values: (100: 100vh)
  187. ),
  188. // scss-docs-end utils-sizing
  189. // Flex utilities
  190. // scss-docs-start utils-flex
  191. "flex": (
  192. responsive: true,
  193. property: flex,
  194. values: (fill: 1 1 auto)
  195. ),
  196. "flex-direction": (
  197. responsive: true,
  198. property: flex-direction,
  199. class: flex,
  200. values: row column row-reverse column-reverse
  201. ),
  202. "flex-grow": (
  203. responsive: true,
  204. property: flex-grow,
  205. class: flex,
  206. values: (
  207. grow-0: 0,
  208. grow-1: 1,
  209. )
  210. ),
  211. "flex-shrink": (
  212. responsive: true,
  213. property: flex-shrink,
  214. class: flex,
  215. values: (
  216. shrink-0: 0,
  217. shrink-1: 1,
  218. )
  219. ),
  220. "flex-wrap": (
  221. responsive: true,
  222. property: flex-wrap,
  223. class: flex,
  224. values: wrap nowrap wrap-reverse
  225. ),
  226. "gap": (
  227. responsive: true,
  228. property: gap,
  229. class: gap,
  230. values: $spacers
  231. ),
  232. "justify-content": (
  233. responsive: true,
  234. property: justify-content,
  235. values: (
  236. start: flex-start,
  237. end: flex-end,
  238. center: center,
  239. between: space-between,
  240. around: space-around,
  241. evenly: space-evenly,
  242. )
  243. ),
  244. "align-items": (
  245. responsive: true,
  246. property: align-items,
  247. values: (
  248. start: flex-start,
  249. end: flex-end,
  250. center: center,
  251. baseline: baseline,
  252. stretch: stretch,
  253. )
  254. ),
  255. "align-content": (
  256. responsive: true,
  257. property: align-content,
  258. values: (
  259. start: flex-start,
  260. end: flex-end,
  261. center: center,
  262. between: space-between,
  263. around: space-around,
  264. stretch: stretch,
  265. )
  266. ),
  267. "align-self": (
  268. responsive: true,
  269. property: align-self,
  270. values: (
  271. auto: auto,
  272. start: flex-start,
  273. end: flex-end,
  274. center: center,
  275. baseline: baseline,
  276. stretch: stretch,
  277. )
  278. ),
  279. "order": (
  280. responsive: true,
  281. property: order,
  282. values: (
  283. first: -1,
  284. 0: 0,
  285. 1: 1,
  286. 2: 2,
  287. 3: 3,
  288. 4: 4,
  289. 5: 5,
  290. last: 6,
  291. ),
  292. ),
  293. // scss-docs-end utils-flex
  294. // Margin utilities
  295. // scss-docs-start utils-spacing
  296. "margin": (
  297. responsive: true,
  298. property: margin,
  299. class: m,
  300. values: map-merge($spacers, (auto: auto))
  301. ),
  302. "margin-x": (
  303. responsive: true,
  304. property: margin-right margin-left,
  305. class: mx,
  306. values: map-merge($spacers, (auto: auto))
  307. ),
  308. "margin-y": (
  309. responsive: true,
  310. property: margin-top margin-bottom,
  311. class: my,
  312. values: map-merge($spacers, (auto: auto))
  313. ),
  314. "margin-top": (
  315. responsive: true,
  316. property: margin-top,
  317. class: mt,
  318. values: map-merge($spacers, (auto: auto))
  319. ),
  320. "margin-end": (
  321. responsive: true,
  322. property: margin-right,
  323. class: me,
  324. values: map-merge($spacers, (auto: auto))
  325. ),
  326. "margin-bottom": (
  327. responsive: true,
  328. property: margin-bottom,
  329. class: mb,
  330. values: map-merge($spacers, (auto: auto))
  331. ),
  332. "margin-start": (
  333. responsive: true,
  334. property: margin-left,
  335. class: ms,
  336. values: map-merge($spacers, (auto: auto))
  337. ),
  338. // Negative margin utilities
  339. "negative-margin": (
  340. responsive: true,
  341. property: margin,
  342. class: m,
  343. values: $negative-spacers
  344. ),
  345. "negative-margin-x": (
  346. responsive: true,
  347. property: margin-right margin-left,
  348. class: mx,
  349. values: $negative-spacers
  350. ),
  351. "negative-margin-y": (
  352. responsive: true,
  353. property: margin-top margin-bottom,
  354. class: my,
  355. values: $negative-spacers
  356. ),
  357. "negative-margin-top": (
  358. responsive: true,
  359. property: margin-top,
  360. class: mt,
  361. values: $negative-spacers
  362. ),
  363. "negative-margin-end": (
  364. responsive: true,
  365. property: margin-right,
  366. class: me,
  367. values: $negative-spacers
  368. ),
  369. "negative-margin-bottom": (
  370. responsive: true,
  371. property: margin-bottom,
  372. class: mb,
  373. values: $negative-spacers
  374. ),
  375. "negative-margin-start": (
  376. responsive: true,
  377. property: margin-left,
  378. class: ms,
  379. values: $negative-spacers
  380. ),
  381. // Padding utilities
  382. "padding": (
  383. responsive: true,
  384. property: padding,
  385. class: p,
  386. values: $spacers
  387. ),
  388. "padding-x": (
  389. responsive: true,
  390. property: padding-right padding-left,
  391. class: px,
  392. values: $spacers
  393. ),
  394. "padding-y": (
  395. responsive: true,
  396. property: padding-top padding-bottom,
  397. class: py,
  398. values: $spacers
  399. ),
  400. "padding-top": (
  401. responsive: true,
  402. property: padding-top,
  403. class: pt,
  404. values: $spacers
  405. ),
  406. "padding-end": (
  407. responsive: true,
  408. property: padding-right,
  409. class: pe,
  410. values: $spacers
  411. ),
  412. "padding-bottom": (
  413. responsive: true,
  414. property: padding-bottom,
  415. class: pb,
  416. values: $spacers
  417. ),
  418. "padding-start": (
  419. responsive: true,
  420. property: padding-left,
  421. class: ps,
  422. values: $spacers
  423. ),
  424. // scss-docs-end utils-spacing
  425. // Text
  426. // scss-docs-start utils-text
  427. "font-family": (
  428. property: font-family,
  429. class: font,
  430. values: (monospace: var(--#{$variable-prefix}font-monospace))
  431. ),
  432. "font-size": (
  433. rfs: true,
  434. property: font-size,
  435. class: fs,
  436. values: $font-sizes
  437. ),
  438. "font-style": (
  439. property: font-style,
  440. class: fst,
  441. values: italic normal
  442. ),
  443. "font-weight": (
  444. property: font-weight,
  445. class: fw,
  446. values: (
  447. light: $font-weight-light,
  448. lighter: $font-weight-lighter,
  449. normal: $font-weight-normal,
  450. bold: $font-weight-bold,
  451. bolder: $font-weight-bolder
  452. )
  453. ),
  454. "line-height": (
  455. property: line-height,
  456. class: lh,
  457. values: (
  458. 1: 1,
  459. sm: $line-height-sm,
  460. base: $line-height-base,
  461. lg: $line-height-lg,
  462. )
  463. ),
  464. "text-align": (
  465. responsive: true,
  466. property: text-align,
  467. class: text,
  468. values: (
  469. start: left,
  470. end: right,
  471. center: center,
  472. )
  473. ),
  474. "text-decoration": (
  475. property: text-decoration,
  476. values: none underline line-through
  477. ),
  478. "text-transform": (
  479. property: text-transform,
  480. class: text,
  481. values: lowercase uppercase capitalize
  482. ),
  483. "white-space": (
  484. property: white-space,
  485. class: text,
  486. values: (
  487. wrap: normal,
  488. nowrap: nowrap,
  489. )
  490. ),
  491. "word-wrap": (
  492. property: word-wrap word-break,
  493. class: text,
  494. values: (break: break-word),
  495. rtl: false
  496. ),
  497. // scss-docs-end utils-text
  498. // scss-docs-start utils-color
  499. "color": (
  500. property: color,
  501. class: text,
  502. values: map-merge(
  503. $theme-colors,
  504. (
  505. "white": $white,
  506. "body": $body-color,
  507. "muted": $text-muted,
  508. "black-50": rgba($black, .5),
  509. "white-50": rgba($white, .5),
  510. "reset": inherit,
  511. )
  512. )
  513. ),
  514. // scss-docs-end utils-color
  515. // scss-docs-start utils-bg-color
  516. "background-color": (
  517. property: background-color,
  518. class: bg,
  519. values: map-merge(
  520. $theme-colors,
  521. (
  522. "body": $body-bg,
  523. "white": $white,
  524. "transparent": transparent
  525. )
  526. )
  527. ),
  528. // scss-docs-end utils-bg-color
  529. "gradient": (
  530. property: background-image,
  531. class: bg,
  532. values: (gradient: var(--#{$variable-prefix}gradient))
  533. ),
  534. // scss-docs-start utils-interaction
  535. "user-select": (
  536. property: user-select,
  537. values: all auto none
  538. ),
  539. "pointer-events": (
  540. property: pointer-events,
  541. class: pe,
  542. values: none auto,
  543. ),
  544. // scss-docs-end utils-interaction
  545. // scss-docs-start utils-border-radius
  546. "rounded": (
  547. property: border-radius,
  548. class: rounded,
  549. values: (
  550. null: $border-radius,
  551. 0: 0,
  552. 1: $border-radius-sm,
  553. 2: $border-radius,
  554. 3: $border-radius-lg,
  555. circle: 50%,
  556. pill: $border-radius-pill
  557. )
  558. ),
  559. "rounded-top": (
  560. property: border-top-left-radius border-top-right-radius,
  561. class: rounded-top,
  562. values: (null: $border-radius)
  563. ),
  564. "rounded-end": (
  565. property: border-top-right-radius border-bottom-right-radius,
  566. class: rounded-end,
  567. values: (null: $border-radius)
  568. ),
  569. "rounded-bottom": (
  570. property: border-bottom-right-radius border-bottom-left-radius,
  571. class: rounded-bottom,
  572. values: (null: $border-radius)
  573. ),
  574. "rounded-start": (
  575. property: border-bottom-left-radius border-top-left-radius,
  576. class: rounded-start,
  577. values: (null: $border-radius)
  578. ),
  579. // scss-docs-end utils-border-radius
  580. // scss-docs-start utils-visibility
  581. "visibility": (
  582. property: visibility,
  583. class: null,
  584. values: (
  585. visible: visible,
  586. invisible: hidden,
  587. )
  588. )
  589. // scss-docs-end utils-visibility
  590. ),
  591. $utilities
  592. );