How to use the @instructure/ui-utils.px function in @instructure/ui-utils

To help you get started, we’ve selected a few @instructure/ui-utils 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 instructure / instructure-ui / packages / ui-layout / src / DrawerLayout / index.js View on Github external
shouldOverlayTray (minWidth, trayWidth, contentWidth, trayIsOverlayed) {
    if (!this._content) return false

    const minWidthPx = px(minWidth, this._content)

    if (trayIsOverlayed) {
      return (contentWidth - trayWidth) < minWidthPx
    } else {
      return contentWidth < minWidthPx
    }
  }
github instructure / instructure-ui / packages / ui-drawer-layout / src / DrawerLayout / index.js View on Github external
shouldOverlayTray (minWidth, trayWidth, contentWidth, trayIsOverlayed) {
    if (!this._content) return false

    const minWidthPx = px(minWidth, this._content)

    if (trayIsOverlayed) {
      return (contentWidth - trayWidth) < minWidthPx
    } else {
      return contentWidth < minWidthPx
    }
  }
github instructure / instructure-ui / packages / ui-layout / src / parseQuery.js View on Github external
Object.keys(query).forEach((selectorName) => {
    const { minWidth, maxWidth, minHeight, maxHeight } = query[selectorName]
    rules.push([
      selectorName,
      {
        minWidth: px(minWidth, el) || 0,
        maxWidth: px(maxWidth, el) || Infinity,
        minHeight: px(minHeight, el) || 0,
        maxHeight: px(maxHeight, el) || Infinity
      }
    ])
  })