source: node_modules/autoprefixer/lib/hacks/border-radius.js@ 2058e5c

Last change on this file since 2058e5c was 2058e5c, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Working / before login

  • Property mode set to 100644
File size: 907 bytes
Line 
1let Declaration = require('../declaration')
2
3class BorderRadius extends Declaration {
4 /**
5 * Return unprefixed version of property
6 */
7 normalize(prop) {
8 return BorderRadius.toNormal[prop] || prop
9 }
10
11 /**
12 * Change syntax, when add Mozilla prefix
13 */
14 prefixed(prop, prefix) {
15 if (prefix === '-moz-') {
16 return prefix + (BorderRadius.toMozilla[prop] || prop)
17 }
18 return super.prefixed(prop, prefix)
19 }
20}
21
22BorderRadius.names = ['border-radius']
23
24BorderRadius.toMozilla = {}
25BorderRadius.toNormal = {}
26
27for (let ver of ['top', 'bottom']) {
28 for (let hor of ['left', 'right']) {
29 let normal = `border-${ver}-${hor}-radius`
30 let mozilla = `border-radius-${ver}${hor}`
31
32 BorderRadius.names.push(normal)
33 BorderRadius.names.push(mozilla)
34
35 BorderRadius.toMozilla[normal] = mozilla
36 BorderRadius.toNormal[mozilla] = normal
37 }
38}
39
40module.exports = BorderRadius
Note: See TracBrowser for help on using the repository browser.