grid-row-align.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5. var Declaration = require('../declaration');
  6. var GridRowAlign = function (_Declaration) {
  7. _inherits(GridRowAlign, _Declaration);
  8. function GridRowAlign() {
  9. _classCallCheck(this, GridRowAlign);
  10. return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
  11. }
  12. /**
  13. * Do not prefix flexbox values
  14. */
  15. GridRowAlign.prototype.check = function check(decl) {
  16. return decl.value.indexOf('flex-') === -1 && decl.value !== 'baseline';
  17. };
  18. /**
  19. * Change property name for IE
  20. */
  21. GridRowAlign.prototype.prefixed = function prefixed(prop, prefix) {
  22. return prefix + 'grid-row-align';
  23. };
  24. /**
  25. * Change IE property back
  26. */
  27. GridRowAlign.prototype.normalize = function normalize() {
  28. return 'align-self';
  29. };
  30. return GridRowAlign;
  31. }(Declaration);
  32. Object.defineProperty(GridRowAlign, 'names', {
  33. enumerable: true,
  34. writable: true,
  35. value: ['grid-row-align']
  36. });
  37. module.exports = GridRowAlign;