calc.json 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  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://drafts.csswg.org/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://www.webplatform.org/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. },
  98. "firefox":{
  99. "2":"n",
  100. "3":"n",
  101. "3.5":"n",
  102. "3.6":"n",
  103. "4":"y x",
  104. "5":"y x",
  105. "6":"y x",
  106. "7":"y x",
  107. "8":"y x",
  108. "9":"y x",
  109. "10":"y x",
  110. "11":"y x",
  111. "12":"y x",
  112. "13":"y x",
  113. "14":"y x",
  114. "15":"y x",
  115. "16":"y",
  116. "17":"y",
  117. "18":"y",
  118. "19":"y",
  119. "20":"y",
  120. "21":"y",
  121. "22":"y",
  122. "23":"y",
  123. "24":"y",
  124. "25":"y",
  125. "26":"y",
  126. "27":"y",
  127. "28":"y",
  128. "29":"y",
  129. "30":"y",
  130. "31":"y",
  131. "32":"y",
  132. "33":"y",
  133. "34":"y",
  134. "35":"y",
  135. "36":"y",
  136. "37":"y",
  137. "38":"y",
  138. "39":"y",
  139. "40":"y",
  140. "41":"y",
  141. "42":"y",
  142. "43":"y",
  143. "44":"y",
  144. "45":"y",
  145. "46":"y",
  146. "47":"y",
  147. "48":"y",
  148. "49":"y",
  149. "50":"y",
  150. "51":"y",
  151. "52":"y",
  152. "53":"y",
  153. "54":"y",
  154. "55":"y",
  155. "56":"y",
  156. "57":"y",
  157. "58":"y",
  158. "59":"y",
  159. "60":"y",
  160. "61":"y",
  161. "62":"y",
  162. "63":"y",
  163. "64":"y",
  164. "65":"y",
  165. "66":"y",
  166. "67":"y",
  167. "68":"y",
  168. "69":"y",
  169. "70":"y",
  170. "71":"y",
  171. "72":"y",
  172. "73":"y",
  173. "74":"y",
  174. "75":"y",
  175. "76":"y",
  176. "77":"y",
  177. "78":"y",
  178. "79":"y",
  179. "80":"y",
  180. "81":"y",
  181. "82":"y",
  182. "83":"y",
  183. "84":"y",
  184. "85":"y",
  185. "86":"y",
  186. "87":"y",
  187. "88":"y",
  188. "89":"y",
  189. "90":"y",
  190. "91":"y",
  191. "92":"y",
  192. "93":"y",
  193. "94":"y",
  194. "95":"y"
  195. },
  196. "chrome":{
  197. "4":"n",
  198. "5":"n",
  199. "6":"n",
  200. "7":"n",
  201. "8":"n",
  202. "9":"n",
  203. "10":"n",
  204. "11":"n",
  205. "12":"n",
  206. "13":"n",
  207. "14":"n",
  208. "15":"n",
  209. "16":"n",
  210. "17":"n",
  211. "18":"n",
  212. "19":"y x",
  213. "20":"y x",
  214. "21":"y x",
  215. "22":"y x",
  216. "23":"y x",
  217. "24":"y x",
  218. "25":"y x",
  219. "26":"y",
  220. "27":"y",
  221. "28":"y",
  222. "29":"y",
  223. "30":"y",
  224. "31":"y",
  225. "32":"y",
  226. "33":"y",
  227. "34":"y",
  228. "35":"y",
  229. "36":"y",
  230. "37":"y",
  231. "38":"y",
  232. "39":"y",
  233. "40":"y",
  234. "41":"y",
  235. "42":"y",
  236. "43":"y",
  237. "44":"y",
  238. "45":"y",
  239. "46":"y",
  240. "47":"y",
  241. "48":"y",
  242. "49":"y",
  243. "50":"y",
  244. "51":"y",
  245. "52":"y",
  246. "53":"y",
  247. "54":"y",
  248. "55":"y",
  249. "56":"y",
  250. "57":"y",
  251. "58":"y",
  252. "59":"y",
  253. "60":"y",
  254. "61":"y",
  255. "62":"y",
  256. "63":"y",
  257. "64":"y",
  258. "65":"y",
  259. "66":"y",
  260. "67":"y",
  261. "68":"y",
  262. "69":"y",
  263. "70":"y",
  264. "71":"y",
  265. "72":"y",
  266. "73":"y",
  267. "74":"y",
  268. "75":"y",
  269. "76":"y",
  270. "77":"y",
  271. "78":"y",
  272. "79":"y",
  273. "80":"y",
  274. "81":"y",
  275. "83":"y",
  276. "84":"y",
  277. "85":"y",
  278. "86":"y",
  279. "87":"y",
  280. "88":"y",
  281. "89":"y",
  282. "90":"y",
  283. "91":"y",
  284. "92":"y",
  285. "93":"y",
  286. "94":"y",
  287. "95":"y",
  288. "96":"y",
  289. "97":"y"
  290. },
  291. "safari":{
  292. "3.1":"n",
  293. "3.2":"n",
  294. "4":"n",
  295. "5":"n",
  296. "5.1":"n",
  297. "6":"y x",
  298. "6.1":"y",
  299. "7":"y",
  300. "7.1":"y",
  301. "8":"y",
  302. "9":"y",
  303. "9.1":"y",
  304. "10":"y",
  305. "10.1":"y",
  306. "11":"y",
  307. "11.1":"y",
  308. "12":"y",
  309. "12.1":"y",
  310. "13":"y",
  311. "13.1":"y",
  312. "14":"y",
  313. "14.1":"y",
  314. "15":"y",
  315. "TP":"y"
  316. },
  317. "opera":{
  318. "9":"n",
  319. "9.5-9.6":"n",
  320. "10.0-10.1":"n",
  321. "10.5":"n",
  322. "10.6":"n",
  323. "11":"n",
  324. "11.1":"n",
  325. "11.5":"n",
  326. "11.6":"n",
  327. "12":"n",
  328. "12.1":"n",
  329. "15":"y",
  330. "16":"y",
  331. "17":"y",
  332. "18":"y",
  333. "19":"y",
  334. "20":"y",
  335. "21":"y",
  336. "22":"y",
  337. "23":"y",
  338. "24":"y",
  339. "25":"y",
  340. "26":"y",
  341. "27":"y",
  342. "28":"y",
  343. "29":"y",
  344. "30":"y",
  345. "31":"y",
  346. "32":"y",
  347. "33":"y",
  348. "34":"y",
  349. "35":"y",
  350. "36":"y",
  351. "37":"y",
  352. "38":"y",
  353. "39":"y",
  354. "40":"y",
  355. "41":"y",
  356. "42":"y",
  357. "43":"y",
  358. "44":"y",
  359. "45":"y",
  360. "46":"y",
  361. "47":"y",
  362. "48":"y",
  363. "49":"y",
  364. "50":"y",
  365. "51":"y",
  366. "52":"y",
  367. "53":"y",
  368. "54":"y",
  369. "55":"y",
  370. "56":"y",
  371. "57":"y",
  372. "58":"y",
  373. "60":"y",
  374. "62":"y",
  375. "63":"y",
  376. "64":"y",
  377. "65":"y",
  378. "66":"y",
  379. "67":"y",
  380. "68":"y",
  381. "69":"y",
  382. "70":"y",
  383. "71":"y",
  384. "72":"y",
  385. "73":"y",
  386. "74":"y",
  387. "75":"y",
  388. "76":"y",
  389. "77":"y",
  390. "78":"y",
  391. "79":"y",
  392. "80":"y"
  393. },
  394. "ios_saf":{
  395. "3.2":"n",
  396. "4.0-4.1":"n",
  397. "4.2-4.3":"n",
  398. "5.0-5.1":"n",
  399. "6.0-6.1":"y x",
  400. "7.0-7.1":"y",
  401. "8":"y",
  402. "8.1-8.4":"y",
  403. "9.0-9.2":"y",
  404. "9.3":"y",
  405. "10.0-10.2":"y",
  406. "10.3":"y",
  407. "11.0-11.2":"y",
  408. "11.3-11.4":"y",
  409. "12.0-12.1":"y",
  410. "12.2-12.5":"y",
  411. "13.0-13.1":"y",
  412. "13.2":"y",
  413. "13.3":"y",
  414. "13.4-13.7":"y",
  415. "14.0-14.4":"y",
  416. "14.5-14.8":"y",
  417. "15":"y"
  418. },
  419. "op_mini":{
  420. "all":"n"
  421. },
  422. "android":{
  423. "2.1":"n",
  424. "2.2":"n",
  425. "2.3":"n",
  426. "3":"n",
  427. "4":"n",
  428. "4.1":"n",
  429. "4.2-4.3":"n",
  430. "4.4":"a #1",
  431. "4.4.3-4.4.4":"a #1",
  432. "94":"y"
  433. },
  434. "bb":{
  435. "7":"n",
  436. "10":"y"
  437. },
  438. "op_mob":{
  439. "10":"n",
  440. "11":"n",
  441. "11.1":"n",
  442. "11.5":"n",
  443. "12":"n",
  444. "12.1":"n",
  445. "64":"y"
  446. },
  447. "and_chr":{
  448. "94":"y"
  449. },
  450. "and_ff":{
  451. "92":"y"
  452. },
  453. "ie_mob":{
  454. "10":"y",
  455. "11":"y"
  456. },
  457. "and_uc":{
  458. "12.12":"y"
  459. },
  460. "samsung":{
  461. "4":"y",
  462. "5.0-5.4":"y",
  463. "6.2-6.4":"y",
  464. "7.2-7.4":"y",
  465. "8.2":"y",
  466. "9.2":"y",
  467. "10.1":"y",
  468. "11.1-11.2":"y",
  469. "12.0":"y",
  470. "13.0":"y",
  471. "14.0":"y",
  472. "15.0":"y"
  473. },
  474. "and_qq":{
  475. "10.4":"y"
  476. },
  477. "baidu":{
  478. "7.12":"y"
  479. },
  480. "kaios":{
  481. "2.5":"y"
  482. }
  483. },
  484. "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.",
  485. "notes_by_num":{
  486. "1":"Partial support in Android Browser 4.4 refers to the browser lacking the ability to multiply and divide values.",
  487. "2":"Partial support in IE9 refers to the browser crashing when used as a `background-position` value.",
  488. "3":"Partial support in IE10/IE11 refers to calc not working properly with various use cases mentioned in known issues"
  489. },
  490. "usage_perc_y":97.15,
  491. "usage_perc_a":1.08,
  492. "ucprefix":false,
  493. "parent":"",
  494. "keywords":"",
  495. "ie_id":"csscalc",
  496. "chrome_id":"5765241438732288",
  497. "firefox_id":"",
  498. "webkit_id":"",
  499. "shown":true
  500. }