prefixes.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128
  1. let unpack = require('caniuse-lite/dist/unpacker/feature')
  2. function browsersSort(a, b) {
  3. a = a.split(' ')
  4. b = b.split(' ')
  5. if (a[0] > b[0]) {
  6. return 1
  7. } else if (a[0] < b[0]) {
  8. return -1
  9. } else {
  10. return Math.sign(parseFloat(a[1]) - parseFloat(b[1]))
  11. }
  12. }
  13. // Convert Can I Use data
  14. function f(data, opts, callback) {
  15. data = unpack(data)
  16. if (!callback) {
  17. ;[callback, opts] = [opts, {}]
  18. }
  19. let match = opts.match || /\sx($|\s)/
  20. let need = []
  21. for (let browser in data.stats) {
  22. let versions = data.stats[browser]
  23. for (let version in versions) {
  24. let support = versions[version]
  25. if (support.match(match)) {
  26. need.push(browser + ' ' + version)
  27. }
  28. }
  29. }
  30. callback(need.sort(browsersSort))
  31. }
  32. // Add data for all properties
  33. let result = {}
  34. function prefix(names, data) {
  35. for (let name of names) {
  36. result[name] = Object.assign({}, data)
  37. }
  38. }
  39. function add(names, data) {
  40. for (let name of names) {
  41. result[name].browsers = result[name].browsers
  42. .concat(data.browsers)
  43. .sort(browsersSort)
  44. }
  45. }
  46. module.exports = result
  47. // Border Radius
  48. let prefixBorderRadius = require('caniuse-lite/data/features/border-radius')
  49. f(prefixBorderRadius, browsers =>
  50. prefix(
  51. [
  52. 'border-radius',
  53. 'border-top-left-radius',
  54. 'border-top-right-radius',
  55. 'border-bottom-right-radius',
  56. 'border-bottom-left-radius'
  57. ],
  58. {
  59. browsers,
  60. feature: 'border-radius',
  61. mistakes: ['-khtml-', '-ms-', '-o-']
  62. }
  63. )
  64. )
  65. // Box Shadow
  66. let prefixBoxshadow = require('caniuse-lite/data/features/css-boxshadow')
  67. f(prefixBoxshadow, browsers =>
  68. prefix(['box-shadow'], {
  69. browsers,
  70. feature: 'css-boxshadow',
  71. mistakes: ['-khtml-']
  72. })
  73. )
  74. // Animation
  75. let prefixAnimation = require('caniuse-lite/data/features/css-animation')
  76. f(prefixAnimation, browsers =>
  77. prefix(
  78. [
  79. 'animation',
  80. 'animation-name',
  81. 'animation-duration',
  82. 'animation-delay',
  83. 'animation-direction',
  84. 'animation-fill-mode',
  85. 'animation-iteration-count',
  86. 'animation-play-state',
  87. 'animation-timing-function',
  88. '@keyframes'
  89. ],
  90. {
  91. browsers,
  92. feature: 'css-animation',
  93. mistakes: ['-khtml-', '-ms-']
  94. }
  95. )
  96. )
  97. // Transition
  98. let prefixTransition = require('caniuse-lite/data/features/css-transitions')
  99. f(prefixTransition, browsers =>
  100. prefix(
  101. [
  102. 'transition',
  103. 'transition-property',
  104. 'transition-duration',
  105. 'transition-delay',
  106. 'transition-timing-function'
  107. ],
  108. {
  109. browsers,
  110. feature: 'css-transitions',
  111. mistakes: ['-khtml-', '-ms-']
  112. }
  113. )
  114. )
  115. // Transform 2D
  116. let prefixTransform2d = require('caniuse-lite/data/features/transforms2d')
  117. f(prefixTransform2d, browsers =>
  118. prefix(['transform', 'transform-origin'], {
  119. browsers,
  120. feature: 'transforms2d'
  121. })
  122. )
  123. // Transform 3D
  124. let prefixTransforms3d = require('caniuse-lite/data/features/transforms3d')
  125. f(prefixTransforms3d, browsers => {
  126. prefix(['perspective', 'perspective-origin'], {
  127. browsers,
  128. feature: 'transforms3d'
  129. })
  130. return prefix(['transform-style'], {
  131. browsers,
  132. feature: 'transforms3d',
  133. mistakes: ['-ms-', '-o-']
  134. })
  135. })
  136. f(prefixTransforms3d, { match: /y\sx|y\s#2/ }, browsers =>
  137. prefix(['backface-visibility'], {
  138. browsers,
  139. feature: 'transforms3d',
  140. mistakes: ['-ms-', '-o-']
  141. })
  142. )
  143. // Gradients
  144. let prefixGradients = require('caniuse-lite/data/features/css-gradients')
  145. f(prefixGradients, { match: /y\sx/ }, browsers =>
  146. prefix(
  147. [
  148. 'linear-gradient',
  149. 'repeating-linear-gradient',
  150. 'radial-gradient',
  151. 'repeating-radial-gradient'
  152. ],
  153. {
  154. browsers,
  155. feature: 'css-gradients',
  156. mistakes: ['-ms-'],
  157. props: [
  158. 'background',
  159. 'background-image',
  160. 'border-image',
  161. 'mask',
  162. 'list-style',
  163. 'list-style-image',
  164. 'content',
  165. 'mask-image'
  166. ]
  167. }
  168. )
  169. )
  170. f(prefixGradients, { match: /a\sx/ }, browsers => {
  171. browsers = browsers.map(i => {
  172. if (/firefox|op/.test(i)) {
  173. return i
  174. } else {
  175. return `${i} old`
  176. }
  177. })
  178. return add(
  179. [
  180. 'linear-gradient',
  181. 'repeating-linear-gradient',
  182. 'radial-gradient',
  183. 'repeating-radial-gradient'
  184. ],
  185. {
  186. browsers,
  187. feature: 'css-gradients'
  188. }
  189. )
  190. })
  191. // Box sizing
  192. let prefixBoxsizing = require('caniuse-lite/data/features/css3-boxsizing')
  193. f(prefixBoxsizing, browsers =>
  194. prefix(['box-sizing'], {
  195. browsers,
  196. feature: 'css3-boxsizing'
  197. })
  198. )
  199. // Filter Effects
  200. let prefixFilters = require('caniuse-lite/data/features/css-filters')
  201. f(prefixFilters, browsers =>
  202. prefix(['filter'], {
  203. browsers,
  204. feature: 'css-filters'
  205. })
  206. )
  207. // filter() function
  208. let prefixFilterFunction = require('caniuse-lite/data/features/css-filter-function')
  209. f(prefixFilterFunction, browsers =>
  210. prefix(['filter-function'], {
  211. browsers,
  212. feature: 'css-filter-function',
  213. props: [
  214. 'background',
  215. 'background-image',
  216. 'border-image',
  217. 'mask',
  218. 'list-style',
  219. 'list-style-image',
  220. 'content',
  221. 'mask-image'
  222. ]
  223. })
  224. )
  225. // Backdrop-filter
  226. let prefixBackdropFilter = require('caniuse-lite/data/features/css-backdrop-filter')
  227. f(prefixBackdropFilter, { match: /y\sx|y\s#2/ }, browsers =>
  228. prefix(['backdrop-filter'], {
  229. browsers,
  230. feature: 'css-backdrop-filter'
  231. })
  232. )
  233. // element() function
  234. let prefixElementFunction = require('caniuse-lite/data/features/css-element-function')
  235. f(prefixElementFunction, browsers =>
  236. prefix(['element'], {
  237. browsers,
  238. feature: 'css-element-function',
  239. props: [
  240. 'background',
  241. 'background-image',
  242. 'border-image',
  243. 'mask',
  244. 'list-style',
  245. 'list-style-image',
  246. 'content',
  247. 'mask-image'
  248. ]
  249. })
  250. )
  251. // Multicolumns
  252. let prefixMulticolumns = require('caniuse-lite/data/features/multicolumn')
  253. f(prefixMulticolumns, browsers => {
  254. prefix(
  255. [
  256. 'columns',
  257. 'column-width',
  258. 'column-gap',
  259. 'column-rule',
  260. 'column-rule-color',
  261. 'column-rule-width',
  262. 'column-count',
  263. 'column-rule-style',
  264. 'column-span',
  265. 'column-fill'
  266. ],
  267. {
  268. browsers,
  269. feature: 'multicolumn'
  270. }
  271. )
  272. let noff = browsers.filter(i => !/firefox/.test(i))
  273. prefix(['break-before', 'break-after', 'break-inside'], {
  274. browsers: noff,
  275. feature: 'multicolumn'
  276. })
  277. })
  278. // User select
  279. let prefixUserSelect = require('caniuse-lite/data/features/user-select-none')
  280. f(prefixUserSelect, browsers =>
  281. prefix(['user-select'], {
  282. browsers,
  283. feature: 'user-select-none',
  284. mistakes: ['-khtml-']
  285. })
  286. )
  287. // Flexible Box Layout
  288. let prefixFlexbox = require('caniuse-lite/data/features/flexbox')
  289. f(prefixFlexbox, { match: /a\sx/ }, browsers => {
  290. browsers = browsers.map(i => {
  291. if (/ie|firefox/.test(i)) {
  292. return i
  293. } else {
  294. return `${i} 2009`
  295. }
  296. })
  297. prefix(['display-flex', 'inline-flex'], {
  298. browsers,
  299. feature: 'flexbox',
  300. props: ['display']
  301. })
  302. prefix(['flex', 'flex-grow', 'flex-shrink', 'flex-basis'], {
  303. browsers,
  304. feature: 'flexbox'
  305. })
  306. prefix(
  307. [
  308. 'flex-direction',
  309. 'flex-wrap',
  310. 'flex-flow',
  311. 'justify-content',
  312. 'order',
  313. 'align-items',
  314. 'align-self',
  315. 'align-content'
  316. ],
  317. {
  318. browsers,
  319. feature: 'flexbox'
  320. }
  321. )
  322. })
  323. f(prefixFlexbox, { match: /y\sx/ }, browsers => {
  324. add(['display-flex', 'inline-flex'], {
  325. browsers,
  326. feature: 'flexbox'
  327. })
  328. add(['flex', 'flex-grow', 'flex-shrink', 'flex-basis'], {
  329. browsers,
  330. feature: 'flexbox'
  331. })
  332. add(
  333. [
  334. 'flex-direction',
  335. 'flex-wrap',
  336. 'flex-flow',
  337. 'justify-content',
  338. 'order',
  339. 'align-items',
  340. 'align-self',
  341. 'align-content'
  342. ],
  343. {
  344. browsers,
  345. feature: 'flexbox'
  346. }
  347. )
  348. })
  349. // calc() unit
  350. let prefixCalc = require('caniuse-lite/data/features/calc')
  351. f(prefixCalc, browsers =>
  352. prefix(['calc'], {
  353. browsers,
  354. feature: 'calc',
  355. props: ['*']
  356. })
  357. )
  358. // Background options
  359. let prefixBackgroundOptions = require('caniuse-lite/data/features/background-img-opts')
  360. f(prefixBackgroundOptions, browsers =>
  361. prefix(['background-origin', 'background-size'], {
  362. browsers,
  363. feature: 'background-img-opts'
  364. })
  365. )
  366. // background-clip: text
  367. let prefixBackgroundClipText = require('caniuse-lite/data/features/background-clip-text')
  368. f(prefixBackgroundClipText, browsers =>
  369. prefix(['background-clip'], {
  370. browsers,
  371. feature: 'background-clip-text'
  372. })
  373. )
  374. // Font feature settings
  375. let prefixFontFeature = require('caniuse-lite/data/features/font-feature')
  376. f(prefixFontFeature, browsers =>
  377. prefix(
  378. [
  379. 'font-feature-settings',
  380. 'font-variant-ligatures',
  381. 'font-language-override'
  382. ],
  383. {
  384. browsers,
  385. feature: 'font-feature'
  386. }
  387. )
  388. )
  389. // CSS font-kerning property
  390. let prefixFontKerning = require('caniuse-lite/data/features/font-kerning')
  391. f(prefixFontKerning, browsers =>
  392. prefix(['font-kerning'], {
  393. browsers,
  394. feature: 'font-kerning'
  395. })
  396. )
  397. // Border image
  398. let prefixBorderImage = require('caniuse-lite/data/features/border-image')
  399. f(prefixBorderImage, browsers =>
  400. prefix(['border-image'], {
  401. browsers,
  402. feature: 'border-image'
  403. })
  404. )
  405. // Selection selector
  406. let prefixSelection = require('caniuse-lite/data/features/css-selection')
  407. f(prefixSelection, browsers =>
  408. prefix(['::selection'], {
  409. browsers,
  410. feature: 'css-selection',
  411. selector: true
  412. })
  413. )
  414. // Placeholder selector
  415. let prefixPlaceholder = require('caniuse-lite/data/features/css-placeholder')
  416. f(prefixPlaceholder, browsers => {
  417. prefix(['::placeholder'], {
  418. browsers: browsers.concat(['ie 10 old', 'ie 11 old', 'firefox 18 old']),
  419. feature: 'css-placeholder',
  420. selector: true
  421. })
  422. })
  423. // Placeholder-shown selector
  424. let prefixPlaceholderShown = require('caniuse-lite/data/features/css-placeholder-shown')
  425. f(prefixPlaceholderShown, browsers => {
  426. prefix([':placeholder-shown'], {
  427. browsers,
  428. feature: 'css-placeholder-shown',
  429. selector: true
  430. })
  431. })
  432. // Hyphenation
  433. let prefixHyphens = require('caniuse-lite/data/features/css-hyphens')
  434. f(prefixHyphens, browsers =>
  435. prefix(['hyphens'], {
  436. browsers,
  437. feature: 'css-hyphens'
  438. })
  439. )
  440. // Fullscreen selector
  441. let prefixFullscreen = require('caniuse-lite/data/features/fullscreen')
  442. f(prefixFullscreen, browsers =>
  443. prefix([':fullscreen'], {
  444. browsers,
  445. feature: 'fullscreen',
  446. selector: true
  447. })
  448. )
  449. // ::backdrop pseudo-element
  450. // https://caniuse.com/mdn-css_selectors_backdrop
  451. let prefixBackdrop = require('caniuse-lite/data/features/mdn-css-backdrop-pseudo-element')
  452. f(prefixBackdrop, browsers =>
  453. prefix(['::backdrop'], {
  454. browsers,
  455. feature: 'backdrop',
  456. selector: true
  457. })
  458. )
  459. // File selector button
  460. let prefixFileSelectorButton = require('caniuse-lite/data/features/css-file-selector-button')
  461. f(prefixFileSelectorButton, browsers =>
  462. prefix(['::file-selector-button'], {
  463. browsers,
  464. feature: 'file-selector-button',
  465. selector: true
  466. })
  467. )
  468. // :autofill
  469. let prefixAutofill = require('caniuse-lite/data/features/css-autofill')
  470. f(prefixAutofill, browsers =>
  471. prefix([':autofill'], {
  472. browsers,
  473. feature: 'css-autofill',
  474. selector: true
  475. })
  476. )
  477. // Tab size
  478. let prefixTabsize = require('caniuse-lite/data/features/css3-tabsize')
  479. f(prefixTabsize, browsers =>
  480. prefix(['tab-size'], {
  481. browsers,
  482. feature: 'css3-tabsize'
  483. })
  484. )
  485. // Intrinsic & extrinsic sizing
  486. let prefixIntrinsic = require('caniuse-lite/data/features/intrinsic-width')
  487. let sizeProps = [
  488. 'width',
  489. 'min-width',
  490. 'max-width',
  491. 'height',
  492. 'min-height',
  493. 'max-height',
  494. 'inline-size',
  495. 'min-inline-size',
  496. 'max-inline-size',
  497. 'block-size',
  498. 'min-block-size',
  499. 'max-block-size',
  500. 'grid',
  501. 'grid-template',
  502. 'grid-template-rows',
  503. 'grid-template-columns',
  504. 'grid-auto-columns',
  505. 'grid-auto-rows'
  506. ]
  507. f(prefixIntrinsic, browsers =>
  508. prefix(['max-content', 'min-content'], {
  509. browsers,
  510. feature: 'intrinsic-width',
  511. props: sizeProps
  512. })
  513. )
  514. f(prefixIntrinsic, { match: /x|\s#4/ }, browsers =>
  515. prefix(['fill', 'fill-available'], {
  516. browsers,
  517. feature: 'intrinsic-width',
  518. props: sizeProps
  519. })
  520. )
  521. f(prefixIntrinsic, { match: /x|\s#5/ }, browsers =>
  522. prefix(['fit-content'], {
  523. browsers,
  524. feature: 'intrinsic-width',
  525. props: sizeProps
  526. })
  527. )
  528. // Stretch value
  529. let prefixStretch = require('caniuse-lite/data/features/css-width-stretch')
  530. f(prefixStretch, browsers =>
  531. prefix(['stretch'], {
  532. browsers,
  533. feature: 'css-width-stretch',
  534. props: sizeProps
  535. })
  536. )
  537. // Zoom cursors
  538. let prefixCursorsNewer = require('caniuse-lite/data/features/css3-cursors-newer')
  539. f(prefixCursorsNewer, browsers =>
  540. prefix(['zoom-in', 'zoom-out'], {
  541. browsers,
  542. feature: 'css3-cursors-newer',
  543. props: ['cursor']
  544. })
  545. )
  546. // Grab cursors
  547. let prefixCursorsGrab = require('caniuse-lite/data/features/css3-cursors-grab')
  548. f(prefixCursorsGrab, browsers =>
  549. prefix(['grab', 'grabbing'], {
  550. browsers,
  551. feature: 'css3-cursors-grab',
  552. props: ['cursor']
  553. })
  554. )
  555. // Sticky position
  556. let prefixSticky = require('caniuse-lite/data/features/css-sticky')
  557. f(prefixSticky, browsers =>
  558. prefix(['sticky'], {
  559. browsers,
  560. feature: 'css-sticky',
  561. props: ['position']
  562. })
  563. )
  564. // Pointer Events
  565. let prefixPointer = require('caniuse-lite/data/features/pointer')
  566. f(prefixPointer, browsers =>
  567. prefix(['touch-action'], {
  568. browsers,
  569. feature: 'pointer'
  570. })
  571. )
  572. // Text decoration
  573. let prefixDecoration = require('caniuse-lite/data/features/text-decoration')
  574. f(prefixDecoration, { match: /x.*#[235]/ }, browsers =>
  575. prefix(['text-decoration-skip', 'text-decoration-skip-ink'], {
  576. browsers,
  577. feature: 'text-decoration'
  578. })
  579. )
  580. let prefixDecorationShorthand = require('caniuse-lite/data/features/mdn-text-decoration-shorthand')
  581. f(prefixDecorationShorthand, browsers =>
  582. prefix(['text-decoration'], {
  583. browsers,
  584. feature: 'text-decoration'
  585. })
  586. )
  587. let prefixDecorationColor = require('caniuse-lite/data/features/mdn-text-decoration-color')
  588. f(prefixDecorationColor, browsers =>
  589. prefix(['text-decoration-color'], {
  590. browsers,
  591. feature: 'text-decoration'
  592. })
  593. )
  594. let prefixDecorationLine = require('caniuse-lite/data/features/mdn-text-decoration-line')
  595. f(prefixDecorationLine, browsers =>
  596. prefix(['text-decoration-line'], {
  597. browsers,
  598. feature: 'text-decoration'
  599. })
  600. )
  601. let prefixDecorationStyle = require('caniuse-lite/data/features/mdn-text-decoration-style')
  602. f(prefixDecorationStyle, browsers =>
  603. prefix(['text-decoration-style'], {
  604. browsers,
  605. feature: 'text-decoration'
  606. })
  607. )
  608. // Text Size Adjust
  609. let prefixTextSizeAdjust = require('caniuse-lite/data/features/text-size-adjust')
  610. f(prefixTextSizeAdjust, browsers =>
  611. prefix(['text-size-adjust'], {
  612. browsers,
  613. feature: 'text-size-adjust'
  614. })
  615. )
  616. // CSS Masks
  617. let prefixCssMasks = require('caniuse-lite/data/features/css-masks')
  618. f(prefixCssMasks, browsers => {
  619. prefix(
  620. [
  621. 'mask-clip',
  622. 'mask-composite',
  623. 'mask-image',
  624. 'mask-origin',
  625. 'mask-repeat',
  626. 'mask-border-repeat',
  627. 'mask-border-source'
  628. ],
  629. {
  630. browsers,
  631. feature: 'css-masks'
  632. }
  633. )
  634. prefix(
  635. [
  636. 'mask',
  637. 'mask-position',
  638. 'mask-size',
  639. 'mask-border',
  640. 'mask-border-outset',
  641. 'mask-border-width',
  642. 'mask-border-slice'
  643. ],
  644. {
  645. browsers,
  646. feature: 'css-masks'
  647. }
  648. )
  649. })
  650. // CSS clip-path property
  651. let prefixClipPath = require('caniuse-lite/data/features/css-clip-path')
  652. f(prefixClipPath, browsers =>
  653. prefix(['clip-path'], {
  654. browsers,
  655. feature: 'css-clip-path'
  656. })
  657. )
  658. // Fragmented Borders and Backgrounds
  659. let prefixBoxdecoration = require('caniuse-lite/data/features/css-boxdecorationbreak')
  660. f(prefixBoxdecoration, browsers =>
  661. prefix(['box-decoration-break'], {
  662. browsers,
  663. feature: 'css-boxdecorationbreak'
  664. })
  665. )
  666. // CSS3 object-fit/object-position
  667. let prefixObjectFit = require('caniuse-lite/data/features/object-fit')
  668. f(prefixObjectFit, browsers =>
  669. prefix(['object-fit', 'object-position'], {
  670. browsers,
  671. feature: 'object-fit'
  672. })
  673. )
  674. // CSS Shapes
  675. let prefixShapes = require('caniuse-lite/data/features/css-shapes')
  676. f(prefixShapes, browsers =>
  677. prefix(['shape-margin', 'shape-outside', 'shape-image-threshold'], {
  678. browsers,
  679. feature: 'css-shapes'
  680. })
  681. )
  682. // CSS3 text-overflow
  683. let prefixTextOverflow = require('caniuse-lite/data/features/text-overflow')
  684. f(prefixTextOverflow, browsers =>
  685. prefix(['text-overflow'], {
  686. browsers,
  687. feature: 'text-overflow'
  688. })
  689. )
  690. // Viewport at-rule
  691. let prefixDeviceadaptation = require('caniuse-lite/data/features/css-deviceadaptation')
  692. f(prefixDeviceadaptation, browsers =>
  693. prefix(['@viewport'], {
  694. browsers,
  695. feature: 'css-deviceadaptation'
  696. })
  697. )
  698. // Resolution Media Queries
  699. let prefixResolut = require('caniuse-lite/data/features/css-media-resolution')
  700. f(prefixResolut, { match: /( x($| )|a #2)/ }, browsers =>
  701. prefix(['@resolution'], {
  702. browsers,
  703. feature: 'css-media-resolution'
  704. })
  705. )
  706. // CSS text-align-last
  707. let prefixTextAlignLast = require('caniuse-lite/data/features/css-text-align-last')
  708. f(prefixTextAlignLast, browsers =>
  709. prefix(['text-align-last'], {
  710. browsers,
  711. feature: 'css-text-align-last'
  712. })
  713. )
  714. // Crisp Edges Image Rendering Algorithm
  715. let prefixCrispedges = require('caniuse-lite/data/features/css-crisp-edges')
  716. f(prefixCrispedges, { match: /y x|a x #1/ }, browsers =>
  717. prefix(['pixelated'], {
  718. browsers,
  719. feature: 'css-crisp-edges',
  720. props: ['image-rendering']
  721. })
  722. )
  723. f(prefixCrispedges, { match: /a x #2/ }, browsers =>
  724. prefix(['image-rendering'], {
  725. browsers,
  726. feature: 'css-crisp-edges'
  727. })
  728. )
  729. // Logical Properties
  730. let prefixLogicalProps = require('caniuse-lite/data/features/css-logical-props')
  731. f(prefixLogicalProps, browsers =>
  732. prefix(
  733. [
  734. 'border-inline-start',
  735. 'border-inline-end',
  736. 'margin-inline-start',
  737. 'margin-inline-end',
  738. 'padding-inline-start',
  739. 'padding-inline-end'
  740. ],
  741. {
  742. browsers,
  743. feature: 'css-logical-props'
  744. }
  745. )
  746. )
  747. f(prefixLogicalProps, { match: /x\s#2/ }, browsers =>
  748. prefix(
  749. [
  750. 'border-block-start',
  751. 'border-block-end',
  752. 'margin-block-start',
  753. 'margin-block-end',
  754. 'padding-block-start',
  755. 'padding-block-end'
  756. ],
  757. {
  758. browsers,
  759. feature: 'css-logical-props'
  760. }
  761. )
  762. )
  763. // CSS appearance
  764. let prefixAppearance = require('caniuse-lite/data/features/css-appearance')
  765. f(prefixAppearance, { match: /#2|x/ }, browsers =>
  766. prefix(['appearance'], {
  767. browsers,
  768. feature: 'css-appearance'
  769. })
  770. )
  771. // CSS Scroll snap points
  772. let prefixSnappoints = require('caniuse-lite/data/features/css-snappoints')
  773. f(prefixSnappoints, browsers =>
  774. prefix(
  775. [
  776. 'scroll-snap-type',
  777. 'scroll-snap-coordinate',
  778. 'scroll-snap-destination',
  779. 'scroll-snap-points-x',
  780. 'scroll-snap-points-y'
  781. ],
  782. {
  783. browsers,
  784. feature: 'css-snappoints'
  785. }
  786. )
  787. )
  788. // CSS Regions
  789. let prefixRegions = require('caniuse-lite/data/features/css-regions')
  790. f(prefixRegions, browsers =>
  791. prefix(['flow-into', 'flow-from', 'region-fragment'], {
  792. browsers,
  793. feature: 'css-regions'
  794. })
  795. )
  796. // CSS image-set
  797. let prefixImageSet = require('caniuse-lite/data/features/css-image-set')
  798. f(prefixImageSet, browsers =>
  799. prefix(['image-set'], {
  800. browsers,
  801. feature: 'css-image-set',
  802. props: [
  803. 'background',
  804. 'background-image',
  805. 'border-image',
  806. 'cursor',
  807. 'mask',
  808. 'mask-image',
  809. 'list-style',
  810. 'list-style-image',
  811. 'content'
  812. ]
  813. })
  814. )
  815. // Writing Mode
  816. let prefixWritingMode = require('caniuse-lite/data/features/css-writing-mode')
  817. f(prefixWritingMode, { match: /a|x/ }, browsers =>
  818. prefix(['writing-mode'], {
  819. browsers,
  820. feature: 'css-writing-mode'
  821. })
  822. )
  823. // Cross-Fade Function
  824. let prefixCrossFade = require('caniuse-lite/data/features/css-cross-fade')
  825. f(prefixCrossFade, browsers =>
  826. prefix(['cross-fade'], {
  827. browsers,
  828. feature: 'css-cross-fade',
  829. props: [
  830. 'background',
  831. 'background-image',
  832. 'border-image',
  833. 'mask',
  834. 'list-style',
  835. 'list-style-image',
  836. 'content',
  837. 'mask-image'
  838. ]
  839. })
  840. )
  841. // Read Only selector
  842. let prefixReadOnly = require('caniuse-lite/data/features/css-read-only-write')
  843. f(prefixReadOnly, browsers =>
  844. prefix([':read-only', ':read-write'], {
  845. browsers,
  846. feature: 'css-read-only-write',
  847. selector: true
  848. })
  849. )
  850. // Text Emphasize
  851. let prefixTextEmphasis = require('caniuse-lite/data/features/text-emphasis')
  852. f(prefixTextEmphasis, browsers =>
  853. prefix(
  854. [
  855. 'text-emphasis',
  856. 'text-emphasis-position',
  857. 'text-emphasis-style',
  858. 'text-emphasis-color'
  859. ],
  860. {
  861. browsers,
  862. feature: 'text-emphasis'
  863. }
  864. )
  865. )
  866. // CSS Grid Layout
  867. let prefixGrid = require('caniuse-lite/data/features/css-grid')
  868. f(prefixGrid, browsers => {
  869. prefix(['display-grid', 'inline-grid'], {
  870. browsers,
  871. feature: 'css-grid',
  872. props: ['display']
  873. })
  874. prefix(
  875. [
  876. 'grid-template-columns',
  877. 'grid-template-rows',
  878. 'grid-row-start',
  879. 'grid-column-start',
  880. 'grid-row-end',
  881. 'grid-column-end',
  882. 'grid-row',
  883. 'grid-column',
  884. 'grid-area',
  885. 'grid-template',
  886. 'grid-template-areas',
  887. 'place-self'
  888. ],
  889. {
  890. browsers,
  891. feature: 'css-grid'
  892. }
  893. )
  894. })
  895. f(prefixGrid, { match: /a x/ }, browsers =>
  896. prefix(['grid-column-align', 'grid-row-align'], {
  897. browsers,
  898. feature: 'css-grid'
  899. })
  900. )
  901. // CSS text-spacing
  902. let prefixTextSpacing = require('caniuse-lite/data/features/css-text-spacing')
  903. f(prefixTextSpacing, browsers =>
  904. prefix(['text-spacing'], {
  905. browsers,
  906. feature: 'css-text-spacing'
  907. })
  908. )
  909. // :any-link selector
  910. let prefixAnyLink = require('caniuse-lite/data/features/css-any-link')
  911. f(prefixAnyLink, browsers =>
  912. prefix([':any-link'], {
  913. browsers,
  914. feature: 'css-any-link',
  915. selector: true
  916. })
  917. )
  918. // unicode-bidi
  919. let bidiIsolate = require('caniuse-lite/data/features/mdn-css-unicode-bidi-isolate')
  920. f(bidiIsolate, browsers =>
  921. prefix(['isolate'], {
  922. browsers,
  923. feature: 'css-unicode-bidi',
  924. props: ['unicode-bidi']
  925. })
  926. )
  927. let bidiPlaintext = require('caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext')
  928. f(bidiPlaintext, browsers =>
  929. prefix(['plaintext'], {
  930. browsers,
  931. feature: 'css-unicode-bidi',
  932. props: ['unicode-bidi']
  933. })
  934. )
  935. let bidiOverride = require('caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override')
  936. f(bidiOverride, { match: /y x/ }, browsers =>
  937. prefix(['isolate-override'], {
  938. browsers,
  939. feature: 'css-unicode-bidi',
  940. props: ['unicode-bidi']
  941. })
  942. )
  943. // overscroll-behavior selector
  944. let prefixOverscroll = require('caniuse-lite/data/features/css-overscroll-behavior')
  945. f(prefixOverscroll, { match: /a #1/ }, browsers =>
  946. prefix(['overscroll-behavior'], {
  947. browsers,
  948. feature: 'css-overscroll-behavior'
  949. })
  950. )
  951. // text-orientation
  952. let prefixTextOrientation = require('caniuse-lite/data/features/css-text-orientation')
  953. f(prefixTextOrientation, browsers =>
  954. prefix(['text-orientation'], {
  955. browsers,
  956. feature: 'css-text-orientation'
  957. })
  958. )
  959. // print-color-adjust
  960. let prefixPrintAdjust = require('caniuse-lite/data/features/css-print-color-adjust')
  961. f(prefixPrintAdjust, browsers =>
  962. prefix(['print-color-adjust', 'color-adjust'], {
  963. browsers,
  964. feature: 'css-print-color-adjust'
  965. })
  966. )