UNPKG

chayns-components

Version:

A set of beautiful React components for developing chayns® applications.

16 lines (14 loc) 559 B
"use strict"; exports.__esModule = true; exports.default = getTappWidth; /** * Gets the inner width of the tapp. * @returns {int} - returns the inner width of the tapp. If there is no tapp element, it will return null. */ function getTappWidth() { const element = document.querySelector('.tapp'); if (!element) return null; const computedStyle = window.getComputedStyle(element); return parseInt(computedStyle.width, 10) - parseInt(computedStyle.paddingLeft, 10) - parseInt(computedStyle.paddingRight, 10); } //# sourceMappingURL=tappWidth.js.map