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

@illinois-toolkit/ilw-columns

v1.0.0

Published

Illinois Toolkit: This uses the CSS flexbox to split the container into multiple sections.

Downloads

88

Readme

ilw-columns

Links: ilw-columns in Builder | Illinois Web Theme | Toolkit Development

Overview

This uses the CSS flexbox to split the container into multiple sections. On smaller containers (700px or less), the flexbox will shrink to a single column and items will be stacked.

This will automatically style the components inside the ilw-columns component to the height of the largest item in the group.

This is meant to take the place of the old il-image-feature and il-video-feature, as well as some of the other issues that people were trying to solve with those components. This also allows people to put a small number of statistics, quotes, or cards in a page without having to worry about stacking.

Attributes

  • mode: the relative size and position of the columns. See below for options.
  • theme: blue, orange, blue-gradient, orange-gradient, gray, white. Defaults to white. This is only the background of the columns.
  • width: no width attribute will make it fit the container, full will break the container and go full width, auto will break the container, but only for the background, and page will contain the contents but allow the background to go full width.
  • gap: a length / percentage CSS of padding between the columns. Defaults to none.
  • padding: standard length / percentage CSS of padding around the grid. Defaults to 0 0 40px 0 to handle padding.
  • reverse: If the columns should reverse, so items on the left will show up on the right. This will have no effect on a smaller container where it stacks.

Mode options

  • 1x1: all columns are equal length. This is the default option
  • 1x2: Last column is twice the length of the rest of the columns
  • 2x1: First column is twice the length of the rest of the columns
  • 1x3: Last column is three times the length of the rest of the columns
  • 3x1: First column is three times the length of the rest of the columns
  • 1x2x1: The middle columns are twice the length of the rest of the columns

Code Examples

Three columns with information, all the same size.

<ilw-columns mode="1x1">
   <ilw-content>
     <h3>Information about undergraduate programs</h3>
     <p>.....</p>
     <p>.....</p>
   </ilw-content>
   <ilw-content>
     <h3>Information about graduate programs</h3>
     <p>.....</p>
     <p>.....</p>
   </ilw-content>
   <ilw-content>
     <h3>Information about online programs</h3>
     <p>.....</p>
     <p>.....</p>
   </ilw-content>
</ilw-columns>

An image to the left that takes a fourth of the width

<ilw-columns mode="1x3">
   <img src="photo.png" alt="" class="ilw-image-cover">
   <ilw-content>
     <h3>Information about graduate programs</h3>
     <p>.....</p>
     <p>.....</p>
   </il-content>
</ilw-columns>

Accessibility Notes and Use

Use the reverse attribute sparingly, as this disrupts the semantic order. Only use this if one of the items is marked decorative and will not be read by a screen reader.

These columns will shrink down until it gets to a certain container size. If you have a lot of columns, be aware that these may shrink to an unacceptable size or do weird results (like you have one word per line).

This is using the manual slot assignment process using the MutationObserver interface to watch for changes in the DOM.

External References

  • https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries
  • https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox
  • https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow#slotassignment
  • https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/observe