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

@visual-framework/vf-card-container

v3.2.3

Published

vf-card-container component

Downloads

1,623

Readme

Card component

npm version

About

A multi-column container for vf-card.

Usage

Section header

  • Use one card container for all cards that belong to the same section.
  • Always include a vf-section header to the card container. This ensures that your page will not have skipped headings between the cards and the preceding content outside the container.
  • If you do not want the section header to be visible, you can hide it by passing hidden as true (hidden: true) inside the container_section__header section in card container config.yml setting. This value (true) applies the class vf-u-sr-only (for screen reader only) to the section header and hides it. See the example with the hidden header below.
  • Hiding the heading can only be applied to a section header that is not a link (i.e. the default variant). Section headers that act as links should not be hidden because when users navigate with the keyboard the header is selected as a link but it will not be visible to them.

Card container background

  • Use a white background for both striped (green) cards and bordered (white) cards.
  • vf-u-background-color-ui--grey--light (which is called 'Gray lightest' in the equivalent WP block) may be used as an alternative background of bordered (white) cards, especially when the section header is hidden and there is no text between the section header and the cards.

Columns

The containier defaults to three columns (the recommended number of image-based cards per row). However if text-only cards are being used, a 4-column variant is supported cards_per_row: 4 which appends CSS class vf-card-container__col-4.

CSS Custom Properties

The vf-card component allows for a CSS custom property to be set to define the aspect-ratio of the card image. This can be set per card, but with the vf-card-container you should aim for consistency across the vf-cards it is displaying. Therefore we can pass the aspect-ratio value from this component and it will cascade through the CSS onto the cards. This is encapsulated to this container, which allows you to set different aspect-ratio values for different containers as needed.

To set the aspect-ratio you will need to set the card_custom_aspect_ratio key/value pair in the .yml or the {#{% render %}#} api of the vf-card-container as needed.

Accessibility

This component targets WCAG 2.1 AA accessibility.

Pages that use this component

The Meet our people page at the EMBL-EBI site includes examples of the card container that pass the basic contrast tests for accessibility.

Install

This repository is distributed with npm. After installing npm, you can install vf-card-container with this command.

$ yarn add --dev @visual-framework/vf-card-container

Sass/CSS

The style files included are written in Sass. If you're using a VF-core project, you can import it like this:

@import "@visual-framework/vf-card-container/index.scss";

Make sure you import Sass requirements along with the modules. You can use a project boilerplate or the vf-sass-starter

Help