wishthis/node_modules/autoprefixer/lib/hacks/inline-logical.js

35 lines
681 B
JavaScript
Raw Normal View History

2023-08-17 09:47:40 +00:00
let Declaration = require('../declaration')
2022-01-21 08:28:41 +00:00
2023-08-17 09:47:40 +00:00
class InlineLogical extends Declaration {
/**
* Return property name by spec
*/
normalize(prop) {
return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2')
2022-01-21 08:28:41 +00:00
}
/**
* Use old syntax for -moz- and -webkit-
*/
2023-08-17 09:47:40 +00:00
prefixed(prop, prefix) {
return prefix + prop.replace('-inline', '')
2022-01-21 08:28:41 +00:00
}
2023-08-17 09:47:40 +00:00
}
InlineLogical.names = [
'border-inline-start',
'border-inline-end',
'margin-inline-start',
'margin-inline-end',
'padding-inline-start',
'padding-inline-end',
'border-start',
'border-end',
'margin-start',
'margin-end',
'padding-start',
'padding-end'
]
module.exports = InlineLogical