inline-logical.js 681 B

12345678910111213141516171819202122232425262728293031323334
  1. let Declaration = require('../declaration')
  2. class InlineLogical extends Declaration {
  3. /**
  4. * Use old syntax for -moz- and -webkit-
  5. */
  6. prefixed(prop, prefix) {
  7. return prefix + prop.replace('-inline', '')
  8. }
  9. /**
  10. * Return property name by spec
  11. */
  12. normalize(prop) {
  13. return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2')
  14. }
  15. }
  16. InlineLogical.names = [
  17. 'border-inline-start',
  18. 'border-inline-end',
  19. 'margin-inline-start',
  20. 'margin-inline-end',
  21. 'padding-inline-start',
  22. 'padding-inline-end',
  23. 'border-start',
  24. 'border-end',
  25. 'margin-start',
  26. 'margin-end',
  27. 'padding-start',
  28. 'padding-end'
  29. ]
  30. module.exports = InlineLogical