From b1e2c8fd5cb5dfa46bc440a12eafaf56cd844b1c Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Mon, 24 Nov 2025 20:54:57 +0100 Subject: Docs --- .../autoprefixer/lib/hacks/border-radius.js | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 node_modules/autoprefixer/lib/hacks/border-radius.js (limited to 'node_modules/autoprefixer/lib/hacks/border-radius.js') diff --git a/node_modules/autoprefixer/lib/hacks/border-radius.js b/node_modules/autoprefixer/lib/hacks/border-radius.js new file mode 100644 index 0000000..47ea835 --- /dev/null +++ b/node_modules/autoprefixer/lib/hacks/border-radius.js @@ -0,0 +1,40 @@ +let Declaration = require('../declaration') + +class BorderRadius extends Declaration { + /** + * Return unprefixed version of property + */ + normalize(prop) { + return BorderRadius.toNormal[prop] || prop + } + + /** + * Change syntax, when add Mozilla prefix + */ + prefixed(prop, prefix) { + if (prefix === '-moz-') { + return prefix + (BorderRadius.toMozilla[prop] || prop) + } + return super.prefixed(prop, prefix) + } +} + +BorderRadius.names = ['border-radius'] + +BorderRadius.toMozilla = {} +BorderRadius.toNormal = {} + +for (let ver of ['top', 'bottom']) { + for (let hor of ['left', 'right']) { + let normal = `border-${ver}-${hor}-radius` + let mozilla = `border-radius-${ver}${hor}` + + BorderRadius.names.push(normal) + BorderRadius.names.push(mozilla) + + BorderRadius.toMozilla[normal] = mozilla + BorderRadius.toNormal[mozilla] = normal + } +} + +module.exports = BorderRadius -- cgit v1.2.3