grid-start.js 670 B

123456789101112131415161718192021222324252627282930313233
  1. let Declaration = require('../declaration')
  2. class GridStart extends Declaration {
  3. /**
  4. * Do not add prefix for unsupported value in IE
  5. */
  6. check(decl) {
  7. let value = decl.value
  8. return !value.includes('/') && !value.includes('span')
  9. }
  10. /**
  11. * Return a final spec property
  12. */
  13. normalize(prop) {
  14. return prop.replace('-start', '')
  15. }
  16. /**
  17. * Change property name for IE
  18. */
  19. prefixed(prop, prefix) {
  20. let result = super.prefixed(prop, prefix)
  21. if (prefix === '-ms-') {
  22. result = result.replace('-start', '')
  23. }
  24. return result
  25. }
  26. }
  27. GridStart.names = ['grid-row-start', 'grid-column-start']
  28. module.exports = GridStart