calc.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. {
  2. "title":"calc() as CSS unit value",
  3. "description":"Method of allowing calculated values for length units, i.e. `width: calc(100% - 3em)`",
  4. "spec":"https://w3c.github.io/csswg-drafts/css-values-3/#calc-notation",
  5. "status":"cr",
  6. "links":[
  7. {
  8. "url":"https://hacks.mozilla.org/2010/06/css3-calc/",
  9. "title":"Mozilla Hacks article"
  10. },
  11. {
  12. "url":"https://developer.mozilla.org/en/docs/Web/CSS/calc",
  13. "title":"MDN Web Docs - calc"
  14. },
  15. {
  16. "url":"https://webplatform.github.io/docs/css/functions/calc",
  17. "title":"WebPlatform Docs"
  18. }
  19. ],
  20. "bugs":[
  21. {
  22. "description":"IE 9 - 11 and Edge do not support `width: calc()` on table cells. [Bug Report](https://web.archive.org/web/20171123043312/https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10982196/)"
  23. },
  24. {
  25. "description":"IE 9 - 11 don't render `box-shadow` when `calc()` is used for any of the values"
  26. },
  27. {
  28. "description":"IE10 crashes when a div with a property using `calc()` has a child with [same property with inherit](https://stackoverflow.com/questions/19423384/css-less-calc-method-is-crashing-my-ie10)."
  29. },
  30. {
  31. "description":"IE10, IE11, and Edge < 14 don't support using `calc()` inside a `transform`. [Bug report](https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/104773/)"
  32. },
  33. {
  34. "description":"IE11 is reported to have trouble with `calc()` with nested expressions, e.g. `width: calc((100% - 10px) / 3);` (i.e. it rounds differently)"
  35. },
  36. {
  37. "description":"IE11 is reported to not support `calc()` correctly in [generated content](https://stackoverflow.com/questions/31323915/internet-explorer-incorrectly-calculates-percentage-height-for-generated-content)"
  38. },
  39. {
  40. "description":"IE11 does not support transitioning values set with `calc()`"
  41. },
  42. {
  43. "description":"Safari & iOS Safari (both 6 and 7) does not support viewport units (`vw`, `vh`, etc) in `calc()`."
  44. },
  45. {
  46. "description":"IE & Edge are reported to not support calc inside a 'flex'. (Not tested on older versions)\r\nThis example does not work: `flex: 1 1 calc(50% - 20px);`"
  47. },
  48. {
  49. "description":"IE does not support `calc()` on color functions. Example: `color: hsl(calc(60 * 2), 100%, 50%)`."
  50. },
  51. {
  52. "description":"Firefox <48 does not support `calc()` inside the `line-height`, `stroke-width`, `stroke-dashoffset`, and `stroke-dasharray` properties. [Bug report](https://bugzilla.mozilla.org/show_bug.cgi?id=594933)"
  53. },
  54. {
  55. "description":"Firefox <59 does not support `calc()` on color functions. Example: `color: hsl(calc(60 * 2), 100%, 50%)`. [Bug Report](https://bugzilla.mozilla.org/show_bug.cgi?id=984021)"
  56. },
  57. {
  58. "description":"Firefox <66 does not support `width: calc()` on table cells. [Bug Report](https://bugzilla.mozilla.org/show_bug.cgi?id=957915)"
  59. }
  60. ],
  61. "categories":[
  62. "CSS3"
  63. ],
  64. "stats":{
  65. "ie":{
  66. "5.5":"n",
  67. "6":"n",
  68. "7":"n",
  69. "8":"n",
  70. "9":"a #2",
  71. "10":"a #3",
  72. "11":"a #3"
  73. },
  74. "edge":{
  75. "12":"y",
  76. "13":"y",
  77. "14":"y",
  78. "15":"y",
  79. "16":"y",
  80. "17":"y",
  81. "18":"y",
  82. "79":"y",
  83. "80":"y",
  84. "81":"y",
  85. "83":"y",
  86. "84":"y",
  87. "85":"y",
  88. "86":"y",
  89. "87":"y",
  90. "88":"y",
  91. "89":"y",
  92. "90":"y",
  93. "91":"y",
  94. "92":"y",
  95. "93":"y",
  96. "94":"y",
  97. "95":"y",
  98. "96":"y",
  99. "97":"y",
  100. "98":"y",
  101. "99":"y",
  102. "100":"y",
  103. "101":"y",
  104. "102":"y",
  105. "103":"y",
  106. "104":"y",
  107. "105":"y",
  108. "106":"y",
  109. "107":"y",
  110. "108":"y",
  111. "109":"y",
  112. "110":"y"
  113. },
  114. "firefox":{
  115. "2":"n",
  116. "3":"n",
  117. "3.5":"n",
  118. "3.6":"n",
  119. "4":"y x",
  120. "5":"y x",
  121. "6":"y x",
  122. "7":"y x",
  123. "8":"y x",
  124. "9":"y x",
  125. "10":"y x",
  126. "11":"y x",
  127. "12":"y x",
  128. "13":"y x",
  129. "14":"y x",
  130. "15":"y x",
  131. "16":"y",
  132. "17":"y",
  133. "18":"y",
  134. "19":"y",
  135. "20":"y",
  136. "21":"y",
  137. "22":"y",
  138. "23":"y",
  139. "24":"y",
  140. "25":"y",
  141. "26":"y",
  142. "27":"y",
  143. "28":"y",
  144. "29":"y",
  145. "30":"y",
  146. "31":"y",
  147. "32":"y",
  148. "33":"y",
  149. "34":"y",
  150. "35":"y",
  151. "36":"y",
  152. "37":"y",
  153. "38":"y",
  154. "39":"y",
  155. "40":"y",
  156. "41":"y",
  157. "42":"y",
  158. "43":"y",
  159. "44":"y",
  160. "45":"y",
  161. "46":"y",
  162. "47":"y",
  163. "48":"y",
  164. "49":"y",
  165. "50":"y",
  166. "51":"y",
  167. "52":"y",
  168. "53":"y",
  169. "54":"y",
  170. "55":"y",
  171. "56":"y",
  172. "57":"y",
  173. "58":"y",
  174. "59":"y",
  175. "60":"y",
  176. "61":"y",
  177. "62":"y",
  178. "63":"y",
  179. "64":"y",
  180. "65":"y",
  181. "66":"y",
  182. "67":"y",
  183. "68":"y",
  184. "69":"y",
  185. "70":"y",
  186. "71":"y",
  187. "72":"y",
  188. "73":"y",
  189. "74":"y",
  190. "75":"y",
  191. "76":"y",
  192. "77":"y",
  193. "78":"y",
  194. "79":"y",
  195. "80":"y",
  196. "81":"y",
  197. "82":"y",
  198. "83":"y",
  199. "84":"y",
  200. "85":"y",
  201. "86":"y",
  202. "87":"y",
  203. "88":"y",
  204. "89":"y",
  205. "90":"y",
  206. "91":"y",
  207. "92":"y",
  208. "93":"y",
  209. "94":"y",
  210. "95":"y",
  211. "96":"y",
  212. "97":"y",
  213. "98":"y",
  214. "99":"y",
  215. "100":"y",
  216. "101":"y",
  217. "102":"y",
  218. "103":"y",
  219. "104":"y",
  220. "105":"y",
  221. "106":"y",
  222. "107":"y",
  223. "108":"y",
  224. "109":"y",
  225. "110":"y",
  226. "111":"y",
  227. "112":"y"
  228. },
  229. "chrome":{
  230. "4":"n",
  231. "5":"n",
  232. "6":"n",
  233. "7":"n",
  234. "8":"n",
  235. "9":"n",
  236. "10":"n",
  237. "11":"n",
  238. "12":"n",
  239. "13":"n",
  240. "14":"n",
  241. "15":"n",
  242. "16":"n",
  243. "17":"n",
  244. "18":"n",
  245. "19":"y x",
  246. "20":"y x",
  247. "21":"y x",
  248. "22":"y x",
  249. "23":"y x",
  250. "24":"y x",
  251. "25":"y x",
  252. "26":"y",
  253. "27":"y",
  254. "28":"y",
  255. "29":"y",
  256. "30":"y",
  257. "31":"y",
  258. "32":"y",
  259. "33":"y",
  260. "34":"y",
  261. "35":"y",
  262. "36":"y",
  263. "37":"y",
  264. "38":"y",
  265. "39":"y",
  266. "40":"y",
  267. "41":"y",
  268. "42":"y",
  269. "43":"y",
  270. "44":"y",
  271. "45":"y",
  272. "46":"y",
  273. "47":"y",
  274. "48":"y",
  275. "49":"y",
  276. "50":"y",
  277. "51":"y",
  278. "52":"y",
  279. "53":"y",
  280. "54":"y",
  281. "55":"y",
  282. "56":"y",
  283. "57":"y",
  284. "58":"y",
  285. "59":"y",
  286. "60":"y",
  287. "61":"y",
  288. "62":"y",
  289. "63":"y",
  290. "64":"y",
  291. "65":"y",
  292. "66":"y",
  293. "67":"y",
  294. "68":"y",
  295. "69":"y",
  296. "70":"y",
  297. "71":"y",
  298. "72":"y",
  299. "73":"y",
  300. "74":"y",
  301. "75":"y",
  302. "76":"y",
  303. "77":"y",
  304. "78":"y",
  305. "79":"y",
  306. "80":"y",
  307. "81":"y",
  308. "83":"y",
  309. "84":"y",
  310. "85":"y",
  311. "86":"y",
  312. "87":"y",
  313. "88":"y",
  314. "89":"y",
  315. "90":"y",
  316. "91":"y",
  317. "92":"y",
  318. "93":"y",
  319. "94":"y",
  320. "95":"y",
  321. "96":"y",
  322. "97":"y",
  323. "98":"y",
  324. "99":"y",
  325. "100":"y",
  326. "101":"y",
  327. "102":"y",
  328. "103":"y",
  329. "104":"y",
  330. "105":"y",
  331. "106":"y",
  332. "107":"y",
  333. "108":"y",
  334. "109":"y",
  335. "110":"y",
  336. "111":"y",
  337. "112":"y",
  338. "113":"y"
  339. },
  340. "safari":{
  341. "3.1":"n",
  342. "3.2":"n",
  343. "4":"n",
  344. "5":"n",
  345. "5.1":"n",
  346. "6":"y x",
  347. "6.1":"y",
  348. "7":"y",
  349. "7.1":"y",
  350. "8":"y",
  351. "9":"y",
  352. "9.1":"y",
  353. "10":"y",
  354. "10.1":"y",
  355. "11":"y",
  356. "11.1":"y",
  357. "12":"y",
  358. "12.1":"y",
  359. "13":"y",
  360. "13.1":"y",
  361. "14":"y",
  362. "14.1":"y",
  363. "15":"y",
  364. "15.1":"y",
  365. "15.2-15.3":"y",
  366. "15.4":"y",
  367. "15.5":"y",
  368. "15.6":"y",
  369. "16.0":"y",
  370. "16.1":"y",
  371. "16.2":"y",
  372. "16.3":"y",
  373. "16.4":"y",
  374. "TP":"y"
  375. },
  376. "opera":{
  377. "9":"n",
  378. "9.5-9.6":"n",
  379. "10.0-10.1":"n",
  380. "10.5":"n",
  381. "10.6":"n",
  382. "11":"n",
  383. "11.1":"n",
  384. "11.5":"n",
  385. "11.6":"n",
  386. "12":"n",
  387. "12.1":"n",
  388. "15":"y",
  389. "16":"y",
  390. "17":"y",
  391. "18":"y",
  392. "19":"y",
  393. "20":"y",
  394. "21":"y",
  395. "22":"y",
  396. "23":"y",
  397. "24":"y",
  398. "25":"y",
  399. "26":"y",
  400. "27":"y",
  401. "28":"y",
  402. "29":"y",
  403. "30":"y",
  404. "31":"y",
  405. "32":"y",
  406. "33":"y",
  407. "34":"y",
  408. "35":"y",
  409. "36":"y",
  410. "37":"y",
  411. "38":"y",
  412. "39":"y",
  413. "40":"y",
  414. "41":"y",
  415. "42":"y",
  416. "43":"y",
  417. "44":"y",
  418. "45":"y",
  419. "46":"y",
  420. "47":"y",
  421. "48":"y",
  422. "49":"y",
  423. "50":"y",
  424. "51":"y",
  425. "52":"y",
  426. "53":"y",
  427. "54":"y",
  428. "55":"y",
  429. "56":"y",
  430. "57":"y",
  431. "58":"y",
  432. "60":"y",
  433. "62":"y",
  434. "63":"y",
  435. "64":"y",
  436. "65":"y",
  437. "66":"y",
  438. "67":"y",
  439. "68":"y",
  440. "69":"y",
  441. "70":"y",
  442. "71":"y",
  443. "72":"y",
  444. "73":"y",
  445. "74":"y",
  446. "75":"y",
  447. "76":"y",
  448. "77":"y",
  449. "78":"y",
  450. "79":"y",
  451. "80":"y",
  452. "81":"y",
  453. "82":"y",
  454. "83":"y",
  455. "84":"y",
  456. "85":"y",
  457. "86":"y",
  458. "87":"y",
  459. "88":"y",
  460. "89":"y",
  461. "90":"y",
  462. "91":"y",
  463. "92":"y",
  464. "93":"y",
  465. "94":"y",
  466. "95":"y"
  467. },
  468. "ios_saf":{
  469. "3.2":"n",
  470. "4.0-4.1":"n",
  471. "4.2-4.3":"n",
  472. "5.0-5.1":"n",
  473. "6.0-6.1":"y x",
  474. "7.0-7.1":"y",
  475. "8":"y",
  476. "8.1-8.4":"y",
  477. "9.0-9.2":"y",
  478. "9.3":"y",
  479. "10.0-10.2":"y",
  480. "10.3":"y",
  481. "11.0-11.2":"y",
  482. "11.3-11.4":"y",
  483. "12.0-12.1":"y",
  484. "12.2-12.5":"y",
  485. "13.0-13.1":"y",
  486. "13.2":"y",
  487. "13.3":"y",
  488. "13.4-13.7":"y",
  489. "14.0-14.4":"y",
  490. "14.5-14.8":"y",
  491. "15.0-15.1":"y",
  492. "15.2-15.3":"y",
  493. "15.4":"y",
  494. "15.5":"y",
  495. "15.6":"y",
  496. "16.0":"y",
  497. "16.1":"y",
  498. "16.2":"y",
  499. "16.3":"y",
  500. "16.4":"y"
  501. },
  502. "op_mini":{
  503. "all":"n"
  504. },
  505. "android":{
  506. "2.1":"n",
  507. "2.2":"n",
  508. "2.3":"n",
  509. "3":"n",
  510. "4":"n",
  511. "4.1":"n",
  512. "4.2-4.3":"n",
  513. "4.4":"a #1",
  514. "4.4.3-4.4.4":"a #1",
  515. "109":"y"
  516. },
  517. "bb":{
  518. "7":"n",
  519. "10":"y"
  520. },
  521. "op_mob":{
  522. "10":"n",
  523. "11":"n",
  524. "11.1":"n",
  525. "11.5":"n",
  526. "12":"n",
  527. "12.1":"n",
  528. "73":"y"
  529. },
  530. "and_chr":{
  531. "110":"y"
  532. },
  533. "and_ff":{
  534. "110":"y"
  535. },
  536. "ie_mob":{
  537. "10":"y",
  538. "11":"y"
  539. },
  540. "and_uc":{
  541. "13.4":"y"
  542. },
  543. "samsung":{
  544. "4":"y",
  545. "5.0-5.4":"y",
  546. "6.2-6.4":"y",
  547. "7.2-7.4":"y",
  548. "8.2":"y",
  549. "9.2":"y",
  550. "10.1":"y",
  551. "11.1-11.2":"y",
  552. "12.0":"y",
  553. "13.0":"y",
  554. "14.0":"y",
  555. "15.0":"y",
  556. "16.0":"y",
  557. "17.0":"y",
  558. "18.0":"y",
  559. "19.0":"y",
  560. "20":"y"
  561. },
  562. "and_qq":{
  563. "13.1":"y"
  564. },
  565. "baidu":{
  566. "13.18":"y"
  567. },
  568. "kaios":{
  569. "2.5":"y",
  570. "3.0-3.1":"y"
  571. }
  572. },
  573. "notes":"Support can be somewhat emulated in older versions of IE using the non-standard `expression()` syntax.\r\n\r\nDue to the way browsers handle [sub-pixel rounding](https://johnresig.com/blog/sub-pixel-problems-in-css/) differently, layouts using `calc()` expressions may have unexpected results.",
  574. "notes_by_num":{
  575. "1":"Partial support in Android Browser 4.4 refers to the browser lacking the ability to multiply and divide values.",
  576. "2":"Partial support in IE9 refers to the browser crashing when used as a `background-position` value.",
  577. "3":"Partial support in IE10/IE11 refers to calc not working properly with various use cases mentioned in known issues"
  578. },
  579. "usage_perc_y":96.96,
  580. "usage_perc_a":0.86,
  581. "ucprefix":false,
  582. "parent":"",
  583. "keywords":"",
  584. "ie_id":"csscalc",
  585. "chrome_id":"5765241438732288",
  586. "firefox_id":"",
  587. "webkit_id":"",
  588. "shown":true
  589. }