How to use the dom-helpers/css function in dom-helpers

To help you get started, we’ve selected a few dom-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-bootstrap / react-overlays / src / ModalManager.js View on Github external
// because we will override it
    containerState.style = {
      overflow: container.style.overflow,
      paddingRight: container.style.paddingRight,
    };

    if (containerState.overflowing) {
      // use computed style, here to get the real padding
      // to add our scrollbar width
      style.paddingRight = `${parseInt(
        css(container, 'paddingRight') || 0,
        10,
      ) + this.scrollbarSize}px`;
    }

    css(container, style);
  }
github react-bootstrap / react-overlays / src / ModalManager.js View on Github external
setContainerStyle(containerState, container) {
    let style = { overflow: 'hidden' };

    // we are only interested in the actual `style` here
    // because we will override it
    containerState.style = {
      overflow: container.style.overflow,
      paddingRight: container.style.paddingRight,
    };

    if (containerState.overflowing) {
      // use computed style, here to get the real padding
      // to add our scrollbar width
      style.paddingRight = `${parseInt(
        css(container, 'paddingRight') || 0,
        10,
      ) + this.scrollbarSize}px`;
    }

    css(container, style);
  }
github react-bootstrap / react-overlays / test / ModalManagerSpec.js View on Github external
it('should reset overflow style to the computed one', () => {
      let modal = new Modal({});

      expect(css(container, 'overflow')).to.equal('scroll');

      manager.add(modal, container);
      manager.remove(modal);

      expect(container.style.overflow).to.equal('');
      expect(css(container, 'overflow')).to.equal('scroll');
    });
github AndriySvyryd / UnicornHack / src / UnicornHack.Web / ClientApp / src / components / Accordion.tsx View on Github external
getDimensionValue(elem: HTMLElement) {
        const top = css(elem, 'marginTop') ?? 0;
        const bottom = css(elem, 'marginBottom') ?? 0;
        return (elem.offsetHeight +
            (top == 0 ? 0 : parseInt(top, 10)) +
            (bottom == 0 ? 0 : parseInt(bottom, 10))
        );
    }
github react-bootstrap / react-bootstrap / src / BootstrapModalManager.js View on Github external
adjustAndStore = (prop, element, adjust) => {
    const actual = element.style[prop];
    element.dataset[prop] = actual;
    css(element, prop, `${parseFloat(css(element, prop)) + adjust}px`);
  };
github react-bootstrap / react-bootstrap / src / BootstrapModalManager.js View on Github external
restore = (prop, element) => {
    const value = element.dataset[prop];
    if (value !== undefined) {
      delete element.dataset[prop];
      css(element, prop, value);
    }
  };
github reactjs / react-transition-group / stories / transitions / Bootstrap.js View on Github external
function getHeight(elem) {
  let value = elem.offsetHeight;
  let margins = ['marginTop', 'marginBottom'];

  return (value +
    parseInt(style(elem, margins[0]), 10) +
    parseInt(style(elem, margins[1]), 10)
  );
}
github reactjs / react-transition-group / stories / transitions / Bootstrap.js View on Github external
function getHeight(elem) {
  let value = elem.offsetHeight;
  let margins = ['marginTop', 'marginBottom'];

  return (value +
    parseInt(style(elem, margins[0]), 10) +
    parseInt(style(elem, margins[1]), 10)
  );
}
github AndriySvyryd / UnicornHack / src / UnicornHack.Web / ClientApp / src / components / Accordion.tsx View on Github external
getDimensionValue(elem: HTMLElement) {
        const top = css(elem, 'marginTop') ?? 0;
        const bottom = css(elem, 'marginBottom') ?? 0;
        return (elem.offsetHeight +
            (top == 0 ? 0 : parseInt(top, 10)) +
            (bottom == 0 ? 0 : parseInt(bottom, 10))
        );
    }