npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@precision-nutrition/super-modal

v3.1.1

Published

The default blueprint for ember-cli addons.

Downloads

64

Readme

super-modal CircleCI

A versatile, CSS-only, scrollable modal that shrink wraps its content. You must define your own styles for now.

Requirements

  • Tailwind

Elements

  • -outer - The outermost container of all modal pieces
  • -overlay - The darkened background
  • -inner - The centred area that holds the content
  • -closeButton - The close button

Attributes

  • modifierClassName - (Optional) Class name to add to the modal to differentiate between modals for styling purposes
  • outerClassNames - (Optional) Class names to add to the -outer div
  • overlayClassNames - (Optional) Class names to add to the -overlay div
  • innerClassNames - (Optional) Class names to add to the -inner div
  • closeButtonClassNames - (Optional) Class names to add to the close button button
  • disableOverlayClose - (Optional) Remove the ability to click on the overlay to close the modal

NOTES:

Because the SuperModal shrink wraps its content (i.e., the -inner div contracts to fit the content inside of it), its behaviour can depend on the type of content that it holds.

If the content has a set width or max-width, no problem, the -inner div will shrink to fit it. But if the content doesn't have a fixed width - like a bunch of 100% wide paragaphs for example - you must supply a max-width for the -inner div so that the modal doesn't fill the full width of the window. You can do this in a few different ways:

  • By passing in a max width utility class into the innerClassNames attribute
  • Adding a max-width property to a custom SuperModal-inner CSS rule.
  • Wrapping the content in a div and adding a max-width to that

Inversely, it can happen that the -inner div shrink wraps the content a little too much and the modal becomes too narrow. If this happens, add a width: 100%; max-width: Xrem (where Xrem is the desired width of the modal) to your -inner custom CSS rule, or pass equivalent utility classes into the innerClassNames attribute.

Example CSS

Copy this CSS to lay the foundation for your modal.

.SuperModal {

  /* Elements */

  &-outer {
    position: fixed;  /* Required */
    top: 0;           /* Required */
    right: 0;         /* Required */
    bottom: 0;        /* Required */
    left: 0;          /* Required */
    z-index: xxxx;    /* Required */

    padding: 1rem !important;
  }

  &-overlay {
    position: fixed; /* Required */
    top: 0;          /* Required */
    right: 0;        /* Required */
    bottom: 0;       /* Required */
    left: 0;         /* Required */
    z-index: xxxx;   /* Required */

    background-color: rgba(0, 15, 27, 0.9);
  }

  &-inner {
    margin: auto;                   /* Required */
    flex-basis: auto !important;    /* Required */
    overflow-y: auto;               /* Required */
    max-height: 100%;               /* Required */
    position: relative;             /* Required */
    z-index: xxxx;                  /* Required */

    background-color: white;
    border-radius: 1rem;
  }

  &-closeButton {
    position: absolute; /* Required */
    top: 0;             /* Required */
    right: 0;           /* Required */
    width: 3rem;        /* Required */
    height: 3rem;       /* Required */

    font-size: 1.2rem;
    font-weight: bold;
  }

  // The following is used to create a fullscreen modal similar to our fitpro photo comparison tool

  &--fullscreen {
    .SuperModal-inner {
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      background: transparent;
      margin-left: 0;
      margin-right: 0;
    }

    .SuperModal-closeButton {
      color: white;
      z-index: xxxx;
      font-size: 2rem;
    }
  }
}