calc.json 11 KB

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