calc.json 11 KB

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