_utilities.scss 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  1. @import "./bootstrap/functions";
  2. @import "./bootstrap/variables";
  3. @import "./bootstrap/maps";
  4. @import "./bootstrap/utilities";
  5. $utilities: (
  6. // scss-docs-start utils-vertical-align
  7. "align": (
  8. property: vertical-align,
  9. class: align,
  10. values: baseline top middle bottom text-bottom text-top
  11. ),
  12. // scss-docs-end utils-vertical-align
  13. // scss-docs-start utils-float
  14. "float": (
  15. responsive: true,
  16. property: float,
  17. values: (
  18. start: left,
  19. end: right,
  20. none: none,
  21. )
  22. ),
  23. // scss-docs-end utils-float
  24. // scss-docs-start utils-overflow
  25. "overflow": (
  26. property: overflow,
  27. values: auto hidden visible scroll,
  28. ),
  29. // scss-docs-end utils-overflow
  30. // scss-docs-start utils-display
  31. "display": (
  32. responsive: true,
  33. print: true,
  34. property: display,
  35. class: d,
  36. values: inline inline-block block grid table table-row table-cell flex inline-flex none
  37. ),
  38. // scss-docs-end utils-display
  39. // scss-docs-start utils-shadow
  40. "shadow": (
  41. property: box-shadow,
  42. class: shadow,
  43. values: (
  44. null: $box-shadow,
  45. xs: $box-shadow-xs,
  46. sm: $box-shadow-sm,
  47. md: $box-shadow,
  48. lg: $box-shadow-lg,
  49. xl: $box-shadow-xl,
  50. none: none,
  51. )
  52. ),
  53. // scss-docs-end utils-shadow
  54. // scss-docs-start utils-position
  55. "position": (
  56. property: position,
  57. values: static relative absolute fixed sticky
  58. ),
  59. "top": (
  60. property: top,
  61. values: $position-values
  62. ),
  63. "bottom": (
  64. property: bottom,
  65. values: $position-values
  66. ),
  67. "start": (
  68. property: left,
  69. class: start,
  70. values: $position-values
  71. ),
  72. "end": (
  73. property: right,
  74. class: end,
  75. values: $position-values
  76. ),
  77. "translate-middle": (
  78. property: transform,
  79. class: translate-middle,
  80. values: (
  81. null: translate(-50%, -50%),
  82. x: translateX(-50%),
  83. y: translateY(-50%),
  84. )
  85. ),
  86. //Scale
  87. "transform": (
  88. property: transform,
  89. class: transform-scale,
  90. responsive: true,
  91. values: (
  92. 5: scale(.5),
  93. 6: scale(.6),
  94. 7: scale(.7),
  95. 8: scale(.8),
  96. 9: scale(.9),
  97. 10: scale(1),
  98. )
  99. ),
  100. // scss-docs-end utils-position
  101. // scss-docs-start utils-borders
  102. "border": (
  103. property: border,
  104. values: (
  105. null: $border-width solid $border-color,
  106. 0: 0,
  107. )
  108. ),
  109. "border-top": (
  110. property: border-top,
  111. responsive: true,
  112. values: (
  113. null: $border-width solid $border-color,
  114. 0: 0,
  115. )
  116. ),
  117. "border-end": (
  118. property: border-right,
  119. responsive: true,
  120. class: border-end,
  121. values: (
  122. null: $border-width solid $border-color,
  123. 0: 0,
  124. )
  125. ),
  126. "border-bottom": (
  127. property: border-bottom,
  128. responsive: true,
  129. values: (
  130. null: $border-width solid $border-color,
  131. 0: 0,
  132. )
  133. ),
  134. "border-start": (
  135. property: border-left,
  136. responsive: true,
  137. class: border-start,
  138. values: (
  139. null: $border-width solid $border-color,
  140. 0: 0,
  141. )
  142. ),
  143. "border-color": (
  144. property: border-color,
  145. class: border,
  146. values: map-merge($theme-colors, ("white": $white))
  147. ),
  148. "border-width": (
  149. property: border-width,
  150. class: border,
  151. values: $border-widths
  152. ),
  153. // scss-docs-end utils-borders
  154. // Sizing utilities
  155. // scss-docs-start utils-sizing
  156. "width": (
  157. property: width,
  158. responsive: true,
  159. class: w,
  160. values: $width
  161. ),
  162. "max-width": (
  163. property: max-width,
  164. class: mw,
  165. values: (100: 100%)
  166. ),
  167. "viewport-width": (
  168. property: width,
  169. class: vw,
  170. values: (100: 100vw)
  171. ),
  172. "min-viewport-width": (
  173. property: min-width,
  174. class: min-vw,
  175. values: (100: 100vw)
  176. ),
  177. "height": (
  178. property: height,
  179. class: h,
  180. values: (
  181. 25: 25%,
  182. 50: 50%,
  183. 75: 75%,
  184. 100: 100%,
  185. auto: auto
  186. )
  187. ),
  188. "max-height": (
  189. property: max-height,
  190. class: mh,
  191. values: (100: 100%)
  192. ),
  193. "viewport-height": (
  194. property: height,
  195. class: vh,
  196. values: (100: 100vh)
  197. ),
  198. "min-viewport-height": (
  199. property: min-height,
  200. class: min-vh,
  201. values: (
  202. 25: $section-height-25-min-height,
  203. 35: $section-height-35-min-height,
  204. 45: $section-height-45-min-height,
  205. 50: $section-height-50-min-height,
  206. 55: $section-height-55-min-height,
  207. 65: $section-height-65-min-height,
  208. 70: $section-height-70-min-height,
  209. 75: $section-height-75-min-height,
  210. 80: $section-height-80-min-height,
  211. 85: $section-height-85-min-height,
  212. 90: $section-height-90-min-height,
  213. 95: $section-height-95-min-height,
  214. 100: 100vh
  215. )
  216. ),
  217. // scss-docs-end utils-sizing
  218. // Flex utilities
  219. // scss-docs-start utils-flex
  220. "flex": (
  221. responsive: true,
  222. property: flex,
  223. values: (fill: 1 1 auto)
  224. ),
  225. "flex-direction": (
  226. responsive: true,
  227. property: flex-direction,
  228. class: flex,
  229. values: row column row-reverse column-reverse
  230. ),
  231. "flex-grow": (
  232. responsive: true,
  233. property: flex-grow,
  234. class: flex,
  235. values: (
  236. grow-0: 0,
  237. grow-1: 1,
  238. )
  239. ),
  240. "flex-shrink": (
  241. responsive: true,
  242. property: flex-shrink,
  243. class: flex,
  244. values: (
  245. shrink-0: 0,
  246. shrink-1: 1,
  247. )
  248. ),
  249. "flex-wrap": (
  250. responsive: true,
  251. property: flex-wrap,
  252. class: flex,
  253. values: wrap nowrap wrap-reverse
  254. ),
  255. "gap": (
  256. responsive: true,
  257. property: gap,
  258. class: gap,
  259. values: $spacers
  260. ),
  261. "justify-content": (
  262. responsive: true,
  263. property: justify-content,
  264. values: (
  265. start: flex-start,
  266. end: flex-end,
  267. center: center,
  268. between: space-between,
  269. around: space-around,
  270. evenly: space-evenly,
  271. )
  272. ),
  273. "align-items": (
  274. responsive: true,
  275. property: align-items,
  276. values: (
  277. start: flex-start,
  278. end: flex-end,
  279. center: center,
  280. baseline: baseline,
  281. stretch: stretch,
  282. )
  283. ),
  284. "align-content": (
  285. responsive: true,
  286. property: align-content,
  287. values: (
  288. start: flex-start,
  289. end: flex-end,
  290. center: center,
  291. between: space-between,
  292. around: space-around,
  293. stretch: stretch,
  294. )
  295. ),
  296. "align-self": (
  297. responsive: true,
  298. property: align-self,
  299. values: (
  300. auto: auto,
  301. start: flex-start,
  302. end: flex-end,
  303. center: center,
  304. baseline: baseline,
  305. stretch: stretch,
  306. )
  307. ),
  308. "order": (
  309. responsive: true,
  310. property: order,
  311. values: (
  312. first: -1,
  313. 0: 0,
  314. 1: 1,
  315. 2: 2,
  316. 3: 3,
  317. 4: 4,
  318. 5: 5,
  319. last: 6,
  320. ),
  321. ),
  322. // scss-docs-end utils-flex
  323. // Margin utilities
  324. // scss-docs-start utils-spacing
  325. "margin": (
  326. responsive: true,
  327. property: margin,
  328. class: m,
  329. values: map-merge($spacers, (auto: auto))
  330. ),
  331. "margin-x": (
  332. responsive: true,
  333. property: margin-right margin-left,
  334. class: mx,
  335. values: map-merge($spacers, (auto: auto))
  336. ),
  337. "margin-y": (
  338. responsive: true,
  339. property: margin-top margin-bottom,
  340. class: my,
  341. values: map-merge($spacers, (auto: auto))
  342. ),
  343. "margin-top": (
  344. responsive: true,
  345. property: margin-top,
  346. class: mt,
  347. values: map-merge($spacers, (auto: auto))
  348. ),
  349. "margin-end": (
  350. responsive: true,
  351. property: margin-right,
  352. class: me,
  353. values: map-merge($spacers, (auto: auto))
  354. ),
  355. "margin-bottom": (
  356. responsive: true,
  357. property: margin-bottom,
  358. class: mb,
  359. values: map-merge($spacers, (auto: auto))
  360. ),
  361. "margin-start": (
  362. responsive: true,
  363. property: margin-left,
  364. class: ms,
  365. values: map-merge($spacers, (auto: auto))
  366. ),
  367. // Negative margin utilities
  368. "negative-margin": (
  369. responsive: true,
  370. property: margin,
  371. class: m,
  372. values: $negative-spacers
  373. ),
  374. "negative-margin-x": (
  375. responsive: true,
  376. property: margin-right margin-left,
  377. class: mx,
  378. values: $negative-spacers
  379. ),
  380. "negative-margin-y": (
  381. responsive: true,
  382. property: margin-top margin-bottom,
  383. class: my,
  384. values: $negative-spacers
  385. ),
  386. "negative-margin-top": (
  387. responsive: true,
  388. property: margin-top,
  389. class: mt,
  390. values: $negative-spacers
  391. ),
  392. "negative-margin-end": (
  393. responsive: true,
  394. property: margin-right,
  395. class: me,
  396. values: $negative-spacers
  397. ),
  398. "negative-margin-bottom": (
  399. responsive: true,
  400. property: margin-bottom,
  401. class: mb,
  402. values: $negative-spacers
  403. ),
  404. "negative-margin-start": (
  405. responsive: true,
  406. property: margin-left,
  407. class: ms,
  408. values: $negative-spacers
  409. ),
  410. // Padding utilities
  411. "padding": (
  412. responsive: true,
  413. property: padding,
  414. class: p,
  415. values: $spacers
  416. ),
  417. "padding-x": (
  418. responsive: true,
  419. property: padding-right padding-left,
  420. class: px,
  421. values: $spacers
  422. ),
  423. "padding-y": (
  424. responsive: true,
  425. property: padding-top padding-bottom,
  426. class: py,
  427. values: $spacers
  428. ),
  429. "padding-top": (
  430. responsive: true,
  431. property: padding-top,
  432. class: pt,
  433. values: $spacers
  434. ),
  435. "padding-end": (
  436. responsive: true,
  437. property: padding-right,
  438. class: pe,
  439. values: $spacers
  440. ),
  441. "padding-bottom": (
  442. responsive: true,
  443. property: padding-bottom,
  444. class: pb,
  445. values: $spacers
  446. ),
  447. "padding-start": (
  448. responsive: true,
  449. property: padding-left,
  450. class: ps,
  451. values: $spacers
  452. ),
  453. // scss-docs-end utils-spacing
  454. // Text
  455. // scss-docs-start utils-text
  456. "font-family": (
  457. property: font-family,
  458. class: font,
  459. values: (monospace: var(--#{$prefix}font-monospace))
  460. ),
  461. "font-size": (
  462. rfs: true,
  463. property: font-size,
  464. class: fs,
  465. values: $font-sizes
  466. ),
  467. "font-style": (
  468. property: font-style,
  469. class: fst,
  470. values: italic normal
  471. ),
  472. "font-weight": (
  473. property: font-weight,
  474. class: fw,
  475. values: (
  476. light: $font-weight-light,
  477. lighter: $font-weight-lighter,
  478. normal: $font-weight-normal,
  479. bold: $font-weight-bold,
  480. bolder: $font-weight-bolder
  481. )
  482. ),
  483. "line-height": (
  484. property: line-height,
  485. class: lh,
  486. values: (
  487. 1: 1,
  488. sm: $line-height-sm,
  489. base: $line-height-base,
  490. lg: $line-height-lg,
  491. )
  492. ),
  493. "text-align": (
  494. responsive: true,
  495. property: text-align,
  496. class: text,
  497. values: (
  498. start: left,
  499. end: right,
  500. center: center,
  501. )
  502. ),
  503. "text-decoration": (
  504. property: text-decoration,
  505. values: none underline line-through
  506. ),
  507. "text-transform": (
  508. property: text-transform,
  509. class: text,
  510. values: lowercase uppercase capitalize
  511. ),
  512. "white-space": (
  513. property: white-space,
  514. class: text,
  515. values: (
  516. wrap: normal,
  517. nowrap: nowrap,
  518. )
  519. ),
  520. "word-wrap": (
  521. property: word-wrap word-break,
  522. class: text,
  523. values: (break: break-word),
  524. rtl: false
  525. ),
  526. // scss-docs-end utils-text
  527. // scss-docs-start utils-color
  528. "color": (
  529. property: color,
  530. class: text,
  531. values: map-merge(
  532. $theme-colors,
  533. (
  534. "white": $white,
  535. "body": $body-color,
  536. "muted": $text-muted,
  537. "black-50": rgba($black, .5),
  538. "white-50": rgba($white, .5),
  539. "reset": inherit,
  540. )
  541. )
  542. ),
  543. // scss-docs-end utils-color
  544. // scss-docs-start utils-bg-color
  545. "background-color": (
  546. property: background-color,
  547. class: bg,
  548. values: map-merge(
  549. $theme-colors,
  550. (
  551. "body": $body-bg,
  552. "white": $white,
  553. "transparent": transparent,
  554. "gray-100": $gray-100,
  555. "gray-200": $gray-200,
  556. "gray-300": $gray-300,
  557. "gray-400": $gray-400,
  558. "gray-500": $gray-500,
  559. "gray-600": $gray-600,
  560. "gray-700": $gray-700,
  561. "gray-800": $gray-800,
  562. "gray-900": $gray-900,
  563. )
  564. )
  565. ),
  566. // scss-docs-end utils-bg-color
  567. "gradient": (
  568. property: background-image,
  569. class: bg,
  570. values: (gradient: var(--#{$prefix}gradient))
  571. ),
  572. // scss-docs-start utils-interaction
  573. "user-select": (
  574. property: user-select,
  575. values: all auto none
  576. ),
  577. "pointer-events": (
  578. property: pointer-events,
  579. class: pe,
  580. values: none auto,
  581. ),
  582. // scss-docs-end utils-interaction
  583. // scss-docs-start utils-border-radius
  584. "rounded": (
  585. property: border-radius,
  586. class: rounded,
  587. values: (
  588. null: $border-radius,
  589. 0: 0,
  590. 1: $border-radius-sm,
  591. 2: $border-radius,
  592. 3: $border-radius-lg,
  593. circle: 50%,
  594. pill: $border-radius-pill
  595. )
  596. ),
  597. "rounded-top": (
  598. property: border-top-left-radius border-top-right-radius,
  599. class: rounded-top,
  600. values: (null: $border-radius)
  601. ),
  602. "rounded-end": (
  603. property: border-top-right-radius border-bottom-right-radius,
  604. class: rounded-end,
  605. values: (null: $border-radius)
  606. ),
  607. "rounded-bottom": (
  608. property: border-bottom-right-radius border-bottom-left-radius,
  609. class: rounded-bottom,
  610. values: (null: $border-radius)
  611. ),
  612. "rounded-start": (
  613. property: border-bottom-left-radius border-top-left-radius,
  614. class: rounded-start,
  615. values: (null: $border-radius)
  616. ),
  617. // scss-docs-end utils-border-radius
  618. // scss-docs-start utils-visibility
  619. "visibility": (
  620. property: visibility,
  621. class: null,
  622. values: (
  623. visible: visible,
  624. invisible: hidden,
  625. )
  626. ),
  627. // Opacity utilities
  628. "opacity": (
  629. property: opacity,
  630. values: (
  631. 0: 0,
  632. 1: .1,
  633. 2: .2,
  634. 3: .3,
  635. 4: .4,
  636. 5: .5,
  637. 6: .6,
  638. 7: .7,
  639. 8: .8,
  640. 9: .9,
  641. 10: 1
  642. ),
  643. ),
  644. // Z-index utilities
  645. "z-index": (
  646. property: z-index,
  647. values: (
  648. 0: 0,
  649. 1: 1,
  650. 2: 2,
  651. 3: 3
  652. ),
  653. ),
  654. // Letter spacing utilities
  655. "letter-spacing": (
  656. property: letter-spacing,
  657. values: (
  658. 1: 1px,
  659. 2: 2px,
  660. 3: 3px,
  661. 4: 4px,
  662. 5: 5px
  663. ),
  664. ),
  665. // Border radius utilities
  666. "border-top-left-radius": (
  667. property: border-top-left-radius,
  668. class: border-radius-top-start,
  669. responsive: true,
  670. values: (
  671. null: $border-radius,
  672. 0: 0,
  673. sm: $border-radius-sm,
  674. md: $border-radius,
  675. lg: $border-radius-lg,
  676. xl: $border-radius-xl,
  677. 2xl: $border-radius-2xl,
  678. circle: 50%,
  679. pill: $border-radius-pill
  680. )
  681. ),
  682. "border-top-right-radius": (
  683. property: border-top-right-radius,
  684. class: border-radius-top-end,
  685. responsive: true,
  686. values: (
  687. null: $border-radius,
  688. 0: 0,
  689. sm: $border-radius-sm,
  690. md: $border-radius,
  691. lg: $border-radius-lg,
  692. xl: $border-radius-xl,
  693. 2xl: $border-radius-2xl,
  694. circle: 50%,
  695. pill: $border-radius-pill
  696. )
  697. ),
  698. "border-bottom-left-radius": (
  699. property: border-bottom-left-radius,
  700. class: border-radius-bottom-start,
  701. responsive: true,
  702. values: (
  703. null: $border-radius,
  704. 0: 0,
  705. sm: $border-radius-sm,
  706. md: $border-radius,
  707. lg: $border-radius-lg,
  708. xl: $border-radius-xl,
  709. 2xl: $border-radius-2xl,
  710. circle: 50%,
  711. pill: $border-radius-pill
  712. )
  713. ),
  714. "border-bottom-right-radius": (
  715. property: border-bottom-right-radius,
  716. class: border-radius-bottom-end,
  717. responsive: true,
  718. values: (
  719. null: $border-radius,
  720. 0: 0,
  721. sm: $border-radius-sm,
  722. md: $border-radius,
  723. lg: $border-radius-lg,
  724. xl: $border-radius-xl,
  725. 2xl: $border-radius-2xl,
  726. circle: 50%,
  727. pill: $border-radius-pill
  728. )
  729. ),
  730. // Max Height Values
  731. "max-height-px": (
  732. property: max-height,
  733. class: max-height,
  734. values: (
  735. 100: $max-height-100,
  736. 150: $max-height-150,
  737. 160: $max-height-160,
  738. 200: $max-height-200,
  739. 250: $max-height-250,
  740. 300: $max-height-300,
  741. 400: $max-height-400,
  742. 500: $max-height-500,
  743. 600: $max-height-600
  744. )
  745. ),
  746. // Max Height Values vh
  747. "max-height-vh": (
  748. property: max-height,
  749. class: max-height-vh,
  750. values: (
  751. 10: $max-height-vh-10,
  752. 20: $max-height-vh-20,
  753. 30: $max-height-vh-30,
  754. 40: $max-height-vh-40,
  755. 50: $max-height-vh-50,
  756. 60: $max-height-vh-60,
  757. 70: $max-height-vh-70,
  758. 80: $max-height-vh-80,
  759. 90: $max-height-vh-90,
  760. 100: $max-height-vh-100,
  761. )
  762. ),
  763. // Min Height Values
  764. "min-height-px": (
  765. property: min-height,
  766. class: min-height,
  767. values: (
  768. 100: $min-height-100,
  769. 150: $min-height-150,
  770. 160: $min-height-160,
  771. 200: $min-height-200,
  772. 250: $min-height-250,
  773. 300: $min-height-300,
  774. 400: $min-height-400,
  775. 500: $min-height-500,
  776. 600: $min-height-600
  777. )
  778. ),
  779. // Height Values
  780. "height-px": (
  781. property: height,
  782. class: height,
  783. values: (
  784. 100: $height-100,
  785. 150: $height-150,
  786. 200: $height-200,
  787. 300: $height-300,
  788. 400: $height-400,
  789. 500: $height-500,
  790. 600: $height-600
  791. )
  792. ),
  793. // Max Width Values
  794. "max-width-px": (
  795. property: max-width,
  796. class: max-width,
  797. values: (
  798. 100: $max-width-100,
  799. 200: $max-width-200,
  800. 300: $max-width-300,
  801. 400: $max-width-400,
  802. 500: $max-width-500
  803. )
  804. ),
  805. );