text-emphasis-position.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 TextEmphasisPosition = function (_Declaration) {
  7. _inherits(TextEmphasisPosition, _Declaration);
  8. function TextEmphasisPosition() {
  9. _classCallCheck(this, TextEmphasisPosition);
  10. return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
  11. }
  12. TextEmphasisPosition.prototype.set = function set(decl, prefix) {
  13. if (prefix === '-webkit-') {
  14. decl.value = decl.value.replace(/\s*(right|left)\s*/i, '');
  15. }
  16. return _Declaration.prototype.set.call(this, decl, prefix);
  17. };
  18. return TextEmphasisPosition;
  19. }(Declaration);
  20. Object.defineProperty(TextEmphasisPosition, 'names', {
  21. enumerable: true,
  22. writable: true,
  23. value: ['text-emphasis-position']
  24. });
  25. module.exports = TextEmphasisPosition;