You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

630 lines
14 KiB

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